一种改进YOLOv7的钢铁表面缺陷检测优化模型
An optimized model for detecting steel surface defect based on improved YOLOv7
史健婷 1李洋1
作者信息
- 1. 黑龙江科技大学 计算机与信息工程学院,哈尔滨 150022
- 折叠
摘要
为满足工业钢材表面缺陷检测对高实时性和准确性的需求,提出了一种基于YOLOv7改进的钢材表面缺陷检测算法.该算法引入K-means++算法聚类分析,使锚框能够适应数据集内所有缺陷类型,同时通过分别引入SENet、CBAM、ECANet和CA注意力机制,提高模型对目标信息的关注程度.结果表明,在NEU-DET数据集上,改进后的四种算法与原YOLOv7 算法相比具有更高的检测精度.YOLOv7+CBAM 算法的效果最好,相较于 YOLOv7 算法检测精度提高了1.64%,对裂纹缺陷的精度提升了8.59%.与以往的钢表面缺陷检测算法相比,改进后的算法取得了显著的性能提升,检测速度为32 M,检测精度达到了80.79%,在保持原检测速度基本不变的情况下,精准地检测钢材表面缺陷.
Abstract
This paper is aimed at meeting the urgent demand for high real-time and accuracy in in-dustrial steel surface defect detection and proposes ansteel surface defect detection algorithm based on YOLOv7 improved.The study firstly introduces K-means++algorithm clustering analysis for the anchor frame adapting to all defect types in the dataset;and introducing the SENet,CBAM,ECANet,and CA attention mechanisms,respectively,for improving the model′s attention to the target information at the same time.The results show that in the NEU-DET dataset,the improved four algorithms have higher de-tection accuracy compared with the original YOLOv7 algorithm.The YOLOv7+CBAM algorithm is most effective,with an increase of 1.64%in the detection accuracy relative to the YOLOv7 algorithm,and an increase of 8.59%in the fine detection accuracy of crack defects.Compared with the previous steel sur-face defect detection algorithm,the improved algorithm achieves significant improvement in performance,with a detection speed of 32 M and a detection accuracy of 80.79%,as which accurately detects the steel surface defects while keeping the original detection speed basically unchanged.
关键词
缺陷检测/YOLOv7算法/K-means++/CBAM注意力机制Key words
defect detection/YOLOv7 algorithm/K-means++/CBAM attention mechanism引用本文复制引用
出版年
2024