基于多头注意力机制与轻量化YOLOv8的钢材缺陷检测模型
A Steel Defect Detection Model Based on Multi-Head Self-Attention and Lightweight YOLOv8
摘要: 为了提升钢材表面细微复杂缺陷的检测效果,本文提出一种基于多头注意力机制与轻量化YOLOv8模型。首先,在基础检测网络中加入MHSA注意力模块,起到对干扰信息的抑制作用,并增强模型对钢材图像复杂空间关系的理解能力,实现复杂环境中模型的有效特征捕获。然后,针对钢材表面缺陷细微的问题,引入小目标检测层,有效提升模型特征提取能力,进一步提高钢材缺陷检测精度,并在原C2f模块中加入RepGhost网络形成改进轻量化主干网络,大幅度加快了检测速度。与原YOLOv8模型相比,改进后的模型性能更加优越,mAP50值提高了1.9%,P值提高了8.2%,mAP50-95值提高了0.4%,能够为钢材表面缺陷的检测提供一种有效的方案。
Abstract: In this paper, in order to improve the detection effect of subtle and complex defects on the steel surface, a model based on multi-head attention and lightweight YOLOv8 was proposed. Firstly, the MHSA attention module is added to the backbone detection network to suppress the interference information and enhance the model’s ability to understand the complex spatial relationship of steel images, so as to realize the effective feature capture of the model in complex environments. Then, in order to solve the problem of subtle defects on the surface of steel, a small target detection layer was introduced to enhance the feature extraction ability, and the accuracy of steel detection was further improved, and the RepGhost network was added to the C2f module to form a lightweight backbone network, which greatly accelerated the detection speed. Compared with the original YOLOv8 model, the performance of the improved model is superior, the mAP50 value is increased by 1.9%, the P value is increased by 8.2%, and the mAP50-95 value is increased by 0.4%, which can provide an effective solution for the detection of steel surface defects.
参考文献
|
[1]
|
周孟然, 王昊男, 高立鹏, 等. 基于YOLOv5s-FCS的钢材表面缺陷检测[J]. 科学技术与工程, 2024, 24(14): 5901-5910.
|
|
[2]
|
梁礼明, 龙鹏威, 金家新, 等. 基于改进YOLOv8s的钢材表面缺陷检测算法[J]. 浙江大学学报(工学版), 2025, 59(3): 512-522.
|
|
[3]
|
徐莲蓉, 梁少华. 改进YOLOv8的钢材表面缺陷检测算法[J]. 现代电子技术, 2025, 48(4): 173-180.
|
|
[4]
|
冒浩杰, 巩永旺. 改进YOLOv5s的小目标钢材表面缺陷检测算法[J/OL]. 电子科技: 1-10. 2025-03-24.[CrossRef]
|
|
[5]
|
张航, 周毅, 邱宇峰. 融合HGnetv2和注意力机制的钢材表面缺陷检测方法[J/OL]. 电子测量与仪器学报: 1-16. http://kns.cnki.net/kcms/detail/11.2488.TN.20241227.0940.008.html, 2025-03-23.
|
|
[6]
|
Zhu, G., Qi, H. and Lv, K. (2025) DGYOLOv8: An Enhanced Model for Steel Surface Defect Detection Based on YOLOv8. Mathematics, 13, Article No. 831. [Google Scholar] [CrossRef]
|
|
[7]
|
郝用兴, 建文芳, 牛金星, 等. 基于YOLOv8-MHSA-DCN的水下垃圾识别研究[J]. 制造业自动化, 2025, 47(1): 96-102.
|
|
[8]
|
高佳杰, 司亚超. 基于YOLOv8的无人机图像目标检测算法[J]. 河北建筑工程学院学报, 2024, 42(4): 241-249.
|
|
[9]
|
刘文兵, 雷钰, 李广飞, 等. 基于Bi-LSTM和多头自注意力的空战目标意图识别模型[J]. 航空科学技术, 2024, 35(10): 86-94.
|
|
[10]
|
孙翠羽, 雷皓安, 范谦, 等. 基于视觉面部特征疲劳驾驶检测方法[J]. 交通科技与经济, 2025, 27(2): 57-65.
|
|
[11]
|
曹庆园, 朱建鸿. 基于改进残差网络的混凝土砂石骨料种类识别研究[J]. 计算机科学, 2024, 51(S2): 308-313.
|
|
[12]
|
孙毅, 张双德. 基于改进YOLOv5s的轻量化牛油果成熟度检测方法[J]. 信息技术与信息化, 2024(10): 103-107.
|
|
[13]
|
赵曙光, 易文, 陆小辰. 基于YOLOV7-Tiny的轻量化钢材表面缺陷检测方法[J/OL]. 东华大学学报(自然科学版): 1-11. 2025-03-23. [Google Scholar] [CrossRef]
|