Mining shovel detection algorithm based on improved YOLOv7
-
摘要:
针对现有基于深度学习的电铲检测方法未能很好地平衡检测速度与检测精度的问题,提出了一种改进YOLOv7模型,并将其用于矿用电铲检测。该模型以YOLOv7模型为基础,在主干网络中采用轻量化GhostNet网络进行特征提取,在颈部网络中采用轻量级GSConv替换部分普通卷积,以减少模型参数量和计算量,提高模型检测速度;考虑到轻量化改进后模型参数量减少对特征信息提取能力的影响,在不增加计算量的前提下,对颈部网络进行进一步改进,在扩展高效层聚合网络(ELAN)中嵌入坐标注意力机制(CA),同时利用双向特征金字塔网络(BiFPN)改进路径聚合网络(PANet),以提高网络对特征信息的提取能力,进而有效提高模型检测精度。实验结果表明,与YOLOv7模型相比,改进YOLOv7模型的参数量减少了75.4%,每秒浮点运算次数减少了82.9%,检测速度提高了24.3%;相较于其他目标检测模型,改进YOLOv7模型在检测速度和检测精度方面取得了良好的平衡,满足在露天煤矿场景下对电铲进行实时、准确检测的需求,为嵌入到移动设备中提供了有利条件。
Abstract:The existing deep learning based shovel detection methods fail to balance detection speed and precision well. In order to solve the above problem, an improved YOLOv7 model is proposed and applied to mining shovel detection. This model is based on the YOLOv7 model, using a lightweight GhostNet network for feature extraction in the backbone network. This model replaces some ordinary convolutions with lightweight GSConv in the neck network to reduce the number of model parameters and computation, and improve the detection speed of the model. Considering the impact of reduced model parameters on feature information extraction capability after lightweight improvement, the neck network is further improved without increasing computational complexity. The coordinate attention mechanism (CA) is embedded in the extended efficient layer aggregation network (ELAN). The bidirectional feature pyramid network (BiFPN) is used to improve path aggregation network (PANet) to enhance the network's capability to extract feature information. Furthermore, it effectively improves the precision of model detection. The experimental results show that compared with the YOLOv7 model, the improved YOLOv7 model reduces the number of parameters by 75.4%, reduces the number of floating-point operations per second by 82.9%, and improves the detection speed by 24.3%. Compared with other object detection models, the improved YOLOv7 model achieves a good balance between detection speed and precision, meeting the demand for real-time and accurate detection of electric shovels in open-pit coal mine scenarios. It provides favorable conditions for embedding into mobile devices.
-
Key words:
- mining electric shovel /
- object detection /
- lightweight /
- YOLOv7 /
- GhostNet /
- GSConv /
- coordinate attention mechanism /
- bidirectional feature pyramid
-
表 1 不同轻量化模块引入不同位置对比实验结果
Table 1. Comparative experimental results of different lightweight modules introduced at different positions
模型 平均精度/% 参数量/106个 每秒浮点运算次数/109 检测时间/ms YOLOv7 93.56 37.227 105.216 25.1 YOLOv7+GSConv替换主干网络及颈部网络 57.52 24.184 69.444 49.2 YOLOv7+GSConv替换颈部网络 86.32 28.476 91.377 22.3 YOLOv7+GhostNet替换主干网络+GSConv替换颈部网络 88.62 7.392 15.665 14.3 表 2 不同注意力机制对比实验结果
Table 2. Comparative experimental results of different attention mechanisms
模型 平均精度/% 参数量/106个 检测时间/ms YOLOv7 93.56 37.227 25.1 YOLOv7+CA 94.53 37.545 30.5 YOLOv7+SE 93.89 37.456 29.0 YOLOv7+CBAM 94.10 37.712 32.5 YOLOv7+CA+BiFPN 95.12 39.002 33.9 表 3 不同模型对比实验结果
Table 3. Comparative experimental results of different models
模型 平均精度/% 参数量/106个 每秒浮点运算次数/109 检测时间/ms 帧速率/(帧·s−1) Faster R−CNN 96.43 136.812 369.866 172.4 5.8 YOLOv3 80.52 61.556 155.363 59.7 16.8 YOLOv4 87.12 63.970 142.003 51.3 19.5 YOLOv5 89.25 46.664 114.662 33.2 30.1 YOLOv7 93.56 37.227 105.216 25.1 39.8 改进YOLOv7 91.75 9.143 17.966 19.0 52.6 -
[1] 王劲泽. 浅析如何提高露天矿供电系统可靠性[J]. 内蒙古煤炭经济,2017(11):22-23.WANG Jinze. How to improve the reliability of power supply system in open pit mine[J]. Inner Mongolia Coal Economy,2017(11):22-23. [2] 郭安斌,苏红俊,闫孝姮. 基于 UWB 技术的矿山电铲定位算法研究[J]. 工矿自动化,2020,46(12):95-100.GUO Anbin,SU Hongjun,YAN Xiaoheng. Research on positioning algorithm of electric mine shovel based on UWB technology[J]. Industry and Mine Automation,2020,46(12):95-100. [3] 曹连民,崔久龙,刘现文,等. 连续采煤机电缆卷放装置设计[J]. 煤矿机械,2019,40(6):108-111.CAO Lianmin,CUI Jiulong,LIU Xianwen,et al. Design of cable release device for continuous shearer[J]. Coal Mine Machinery,2019,40(6):108-111. [4] 南晓虎,丁雷. 深度学习的典型目标检测算法综述[J]. 计算机应用研究,2020,37(增刊2):15-21.NAN Xiaohu,DING Lei. Review of typical target detection algorithms for deep learning[J]. Application Research of Computers,2020,37(S2):15-21. [5] 赵学军,李建. 一种基于深度学习的煤矸石检测方法[J]. 矿业科学学报,2021,6(6):730-736.ZHAO Xuejun,LI Jian. A method of coal gangue detection based on deep learning[J]. Journal of Mining Science and Technology,2021,6(6):730-736. [6] 李亚辉,刘俊. 基于轻量级深度网络的目标识别方法[J]. 计算机应用研究,2020,37(3):919-923.LI Yahui,LIU Jun. Object recognition method based on lightweight depth network[J]. Application Research of Computers,2020,37(3):919-923. [7] 李坤伦,魏泽发,宋焕生. 基于SqueezeNet卷积神经网络的车辆颜色识别[J]. 长安大学学报(自然科学版),2020,40(4):109-116.LI Kunlun,WEI Zefa,SONG Huansheng. Vehicle color recognition based on SqueezeNet[J]. Journal of Chang'an University (Natural Science Edition),2020,40(4):109-116. [8] 廖慕钦. 基于深度学习的智能交通车辆检测与跟踪[D]. 长沙:中南林业科技大学,2021.LIAO Muqin. Intelligent transportation vehicle detection and tracking based on deep learning[D]. Changsha:Central South University of Forestry and Technology,2021. [9] DENG Tianmin,WU Yongjun. Simultaneous vehicle and lane detection via MobileNetV3 in car following scene[J]. Plos One,2022,17(3). DOI: 10.1371/journal.pone.0264551. [10] 孔维刚,李文婧,王秋艳,等. 基于改进YOLOv4算法的轻量化网络设计与实现[J]. 计算机工程,2022,48(3):181-188.KONG Weigang,LI Wenjing,WANG Qiuyan,et al. Design and implementation of lightweight network based on improved YOLOv4 algorithm[J]. Computer Engineering,2022,48(3):181-188. [11] 徐承优. 可用于移动端的轻量级语义分割网络研究及其在盲人视觉辅助中的应用[D]. 杭州:浙江大学,2020.XU Chengyou. Research on lightweight semantic segmentation networks for mobile devices and application in the assistance of the visually impaired[D]. Hangzhou:Zhejiang University,2020. [12] 宋中山,肖博文,艾勇,等. 基于改进YOLOv4的轻量化目标检测算[J]. 电子测量技术,2022,45(16):142-152.SONG Zhongshan,XIAO Bowen,AI Yong,et al. Improved lightweight YOLOv4 target detection algorithm[J]. Electronic Measurement Technology,2022,45(16):142-152. [13] 蒋镕圻,叶泽聪,彭月平,等. 针对弱小无人机目标的轻量级目标检测算法[J]. 激光与光电子学进展,2022,59(8):109-120.JIANG Rongqi,YE Zecong,PENG Yueping,et al. Lightweight target detection algorithm for small and weak drone targets[J]. Laser & Optoelectronics Progress,2022,59(8):109-120. [14] 杨锦辉,李鸿,杜芸彦,等. 基于改进YOLOv5s的轻量化目标检测算法[J]. 电光与控制,2023,30(2):24-30.YANG Jinhui,LI Hong,DU Yunyan,et al. A lightweight object detection algorithm based on improved YOLOv5s[J]. Electronics Optics & Control,2023,30(2):24-30. [15] WANG C Y,BOCHKOVSKIY A,LIAO H Y M. YOLOv7:trainable bag-of-freebies sets new state-of-the-art for real-time object detectors[C]. IEEE/CVF Conference on Computer Vision and Pattern Recognition,Vancouver,2023:7464-7475. [16] HAN Kai,WANG Yunhe,TIAN Qi,et al. GhostNet:more features from cheap operations[C]. IEEE/CVF Conference on Computer Vision and Pattern Recognition,Seattle,2020:1580-1589. [17] 张佳璐.基于深度学习的道路车辆检测算法研究[D].临沂:临沂大学,2023.ZHANG Jialu.Road vehicle detection algorithms based on deep learning[D].Linyi:Linyi University,2023. [18] HU Jie,SHEN Li,SUN Gang. Squeeze-and-excitation networks[C]. IEEE/CVF Conference on Computer Vision and Pattern Recognition,Salt Lake City,2018:7132-7141. [19] WOO S H,PARK J Y,LEE J Y,et al. CBAM:convolutional block attention module[C]. European Conference on Computer Vision,Munich,2018:3-19. [20] HOU Qibin,ZHOU Daquan,FENG Jiashi. Coordinate attention for efficient mobile network design[C]. IEEE/CVF Conference on Computer Vision and Pattern Recognition,Nashville,2021:13713-13722. [21] TAN Mingxing,PANG Ruoming,LE Q V. Efficientdet:scalable and efficient object detection[C]. IEEE/CVF Conference on Computer Vision and Pattern Recognition,Seattle,2020:10781-10790. [22] MA Long,MA Tengyu,LIU Risheng,et al. Toward fast,flexible,and robust low-light image enhancement[C]. IEEE/CVF Conference on Computer Vision and Pattern Recognition,New Orleans,2022:5637-5646.