DOI:10.3969/j.issn.1003-5060.2026.03.005
基于改进 YOLOv5s-seg 的废钢分类分割算法
王哲 $ ^{1} $,杨文 $ ^{2} $,范彬彬 $ ^{1} $,顾志远 $ ^{1} $,吴孟武 $ ^{1} $
(1. 武汉理工大学汽车工程学院,湖北武汉 430070;2. 中冶南方工程技术有限公司,湖北武汉 430223)
摘要
为解决废钢回收场景中人工分拣效率低和安全隐患高等问题,文章基于改进 YOLOv5-seg 算法建立废钢分类及实例分割模型,旨在利用计算机视觉技术代替人工分拣。在主干网络中引入 CBAM(convolutional block attention module)注意力机制强调废钢特征,同时用 EIOU(efficient intersection over union)替换原网络中的 CIOU(complete intersection over union)损失函数,加快收敛速度;通过线下数据增强算法对废钢厂采集的图片进行图像增强,并在改进前、后算法构建的两类模型上训练及验证。结果表明:改进的 YOLOv5-seg 废钢分类及实例分割模型边界框和掩膜的平均检测精度达到 98%、96%,比原模型提高了 5%、3%;全类别分类平均精度高达 96.5%,比原模型提高了 5.8%;改进模型与其他经典的实例分割模型相比也表现出优异的检测性能。该文所提算法具有较好的应用前景。
关键词
钢铁回收料;废钢分类;实例分割;注意力机制;损失函数
中图分类号:TP274.5
文献标志码:A
文章编号:1003-5060(2026)03-0317-08
Steel scrap classification and segmentation algorithm based on improved YOLOv5s-seg
WANG Zhe $ ^{1} $, YANG Wen $ ^{2} $, FAN Binbin $ ^{1} $, GU Zhiyuan $ ^{1} $, WU Mengwu $ ^{1} $
(1. School of Automotive Engineering, Wuhan University of Technology, Wuhan 430070, China; 2. WISDRI Engineering and Research Incorporation Limited, Wuhan 430223, China)
Abstract
In order to solve the problems of low efficiency and high security risks of manual sorting in steel scrap recycling scenarios, a steel scrap classification and instance segmentation model was established based on the improved YOLOv5s-seg algorithm, aiming to replace manual sorting with computer vision technology. Convolutional block attention module (CBAM) was introduced into the backbone network to emphasize the characteristics of steel scrap. At the same time, the complete intersection over union (CIOU) loss function in the original network was replaced by efficient intersection over union (EIOU) to accelerate the convergence speed. The offline data enhancement algorithm was used to enhance the images collected from the steel scrap mill, and the models before and after the improvement were trained and verified. The results show that the average detection accuracy of the improved YOLOv5s-seg steel scrap classification and instance segmentation model for boundary box and mask reaches 98% and 96%, respectively, which is 5% and 3% higher than that of the original model; the average accuracy for all categories reaches 96.5%, an increase of 5.8% compared with the original model. In addition, the improved model has excellent detection performance compared with other classical instance segmentation models. The proposed algorithm has a good application prospect.
Keywords
steel recycling materials; steel scrap classification; instance segmentation; attention mechanism; loss function
收稿日期:2023-11-24
修回日期:2024-04-29
基金项目:国家自然科学基金资助项目(52275370);湖北省重点研发计划资助项目(2022BAD100)