机床与液压2024,Vol.52Issue(24) :228-235.DOI:10.3969/j.issn.1001-3881.2024.24.033

融合SA注意力机制的YOLO5s在石油油管表面缺陷检测的应用

The Application of YOLOv5s with SA Attention Mechanism in Surface Defect Detection of Oil Pipes

郭桂标 邢雪 刘宇琦 王超 孙明革
机床与液压2024,Vol.52Issue(24) :228-235.DOI:10.3969/j.issn.1001-3881.2024.24.033

融合SA注意力机制的YOLO5s在石油油管表面缺陷检测的应用

The Application of YOLOv5s with SA Attention Mechanism in Surface Defect Detection of Oil Pipes

郭桂标 1邢雪 1刘宇琦 1王超 1孙明革1
扫码查看

作者信息

  • 1. 吉林化工学院信息与控制工程学院,吉林吉林 132022
  • 折叠

摘要

针对石油厂油管表面缺陷检测存在检测精度低、速度慢和模型复杂等问题,提出一种 SA-YOLO 算法.以YOLOv5s模型为基础,对原数据集进行预处理,采用BoTNet Transformer结构代替Backbone特征主干的部分卷积,并用multi-head self-attention(MHSA)替换卷积层,以减少网络层,同时提高获取全局信息的能力;最后,将Shuffle Attention(SA)注意力机制融合到C3结构中,根据每个位置的重要性得到注意力权重,从而提高模型的泛化能力和计算效率,减少运行时间.实验结果表明:SA-YOLO算法在石油厂采集的数据集上的均值平均精度(mAP)达到了 93%,较原 YOLOv5s 算法提高了3.3%,检测速度以及检测精度均明显提高.

Abstract

In view of the problems of low detection accuracy,slow speed,and complex models in the surface defect detection of oil pipes in oil plants,a SA-YOLO algorithm was proposed.Based on the YOLOv5s model,the original dataset was preprocessed,then the partial convolution of the Backbone feature backbone was replaced with the BoTNet Transformer structure,and directly the convolutional layer was replaced with multi-head self-attention(MHSA),to reduce network layers and improve the ability of obtaining global infor-mation.Finally,the Shuffle Attention mechanism was integrated into the C3 structure,and attention weights were obtained by the impor-tance of each position,thereby improving the generalization ability and computational efficiency of the model,and reducing runtime.The experimental results show that the mean average precision(mAP)of the SA-YOLO algorithm on the dataset collected by the oil plant reaches 93%,which is 3.3%higher than the original YOLOv5s algorithm,the detection speed and accuracy are significantly improved.

关键词

缺陷检测/BoTNet/Transformer结构/Shuffle/Attention(SA)注意力机制

Key words

defect detection/BoTNet Transformer structure/SA attention mechanism

引用本文复制引用

出版年

2024
机床与液压
中国机械工程学会 广州机械科学研究院有限公司

机床与液压

CSTPCD北大核心
影响因子:0.32
ISSN:1001-3881
段落导航相关论文