Coal and gangue recognition research based on improved YOLOv5
-
摘要: 现有基于深度学习的煤矸识别方法应用于井下复杂环境中时易出现误检和漏检情况,且对小目标煤矸的识别精度低。针对该问题,提出一种改进YOLOv5模型,并基于该模型实现煤矸识别。对采集的煤与矸石数据进行数据增强,以丰富数据集,提高数据利用率;在空间金字塔池化(SPP)模块中引入空洞卷积和残差块,得到残差ASPP模块,可在不损失图像信息的前提下,增大卷积输出感受野,强化模型对深层特征的提取;采用AdaBelief优化算法代替YOLOv5原有的Adam优化算法,提高模型的收敛速度与识别精度。实验结果表明:AdaBelief优化算法和残差ASPP模块可有效提高YOLOv5模型的精确率、召回率和平均精度均值(mAP);改进YOLOv5模型的mAP达到94.43%,比原始YOLOv5模型提高了2.27%,帧率降低了0.03 帧/s,性能优于SSD,Faster R−CNN,YOLOv3,YOLOv4等主流目标检测模型;在极端黑暗的环境中,改进YOLOv5模型也能准确划定目标边界,识别效果优于其他改进YOLOv5模型。Abstract: The existing deep learning-based coal and gangue recognition methods are prone to false detection and missed detection when applied to underground complex environments. The recognition precision of small target coal and gangue is low. In order to solve this problem, an improved YOLOv5 model is proposed, and coal and gangue recognition is realized based on that model. Data enhancement is carried out on the collected coal and gangue data to enrich the data set and improve the data utilization rate. The atrous convolution and residual block are introduced into the spatial pyramid pooling (SPP) module to obtain the residual ASPP module. On the premise of not losing image information, the convolution output receptive field can be increased to enhance the extraction of deep features from the model. The AdaBelief optimization algorithm is used to replace the original Adam optimization algorithm of YOLOv5 to improve the convergence speed and recognition precision of the model. The experimental results show that the AdaBelief optimization algorithm and residual ASPP module can effectively improve the precision, recall rate and mean average precision (mAP) of the YOLOv5 model. The mAP of the improved YOLOv5 model reaches 94.43%, which is 2.27% higher than that of original YOLOv5 model. The frame rate is reduced by 0.03 frames/s. The performance of the improved YOLOv5 model is superior to SSD, Faster R-CNN, YOLOv3, YOLOv4 and other mainstream target detection models. In extremely dark environments, the improved YOLOv5 model can also accurately delineate the target boundary, and the recognition effect is better than other improved YOLOv5 models.
-
表 1 优化算法对比实验结果
Table 1. Comparison of experimental results of optimization algorithms
算法 精确率/% 召回率/% mAP/% 帧率/(帧·s−1) Adam 90.74 93.11 91.68 16.33 SGDM 88.83 91.95 90.92 16.79 AdaBelief 91.07 94.16 92.07 16.31 表 2 采用不同空洞率时的实验结果
Table 2. Experimental results with different void ratios
空洞率组合 精确率/% 召回率/% mAP/% 无 89.61 94.12 90.85 [6,12,18,24] 87.35 88.39 87.99 [1,3,5,7] 91.02 95.18 91.75 [2,3,7,13] 90.19 94.33 91.03 [1,2,5,9] 91.36 96.64 92.46 表 3 特征提取模块对比实验结果
Table 3. Comparison of experimental results of feature extraction modules
特征提取
模块精确率/% 召回率/% mAP/% 帧率/(帧·s−1) SPP 90.11 95.19 90.89 16.21 ASPP 91.36 96.54 91.98 16.13 残差ASPP 91.92 96.95 92.25 16.25 表 4 主流目标检测模型性能对比
Table 4. Performance comparison of mainstream target detection models
模型 mAP/% 帧率/(帧·s−1) SSD 81.81 16.58 Faster R−CNN 83.53 11.91 YOLOv3 86.69 16.44 YOLOv4 91.35 15.93 原始YOLOv5 92.16 15.65 改进YOLOv5 94.43 15.62 -
[1] 曾伟,熊俊杰,赵伟哲,等. “双碳”目标下智慧社区新能源消纳的政策与技术研究[J]. 价格理论与实践,2022(4):71-75,205.ZENG Wei,XIONG Junjie,ZHAO Weizhe,et al. Policy and technology research on new energy consumption in smart communities under the carbon peaking and carbon neutrality strategy[J]. Price:Theory & Practice,2022(4):71-75,205. [2] 钱鸣高,缪协兴,许家林. 资源与环境协调(绿色)开采[J]. 煤炭学报,2007,33(1):1-7. doi: 10.3321/j.issn:0253-9993.2007.01.001QIAN Minggao,MIAO Xiexing,XU Jialin. Green mining of coal resources harmonizing with environment[J]. Journal of China Coal Society,2007,33(1):1-7. doi: 10.3321/j.issn:0253-9993.2007.01.001 [3] 曹现刚,薛祯也. 基于迁移学习的GoogLenet煤矸石图像识别[J]. 软件导刊,2019,18(12):183-186.CAO Xiangang,XUE Zhenye. Coal gangue identification by using transfer learning in GoogLenet[J]. Software Guide,2019,18(12):183-186. [4] PU Yuanyuan,APEL D B,SZMIGIEL A,et al. Image recognition of coal and coal gangue using a convolutional neural network and transfer learning[J]. Energies,2019,12(9):1-11. [5] 杜京义,史志芒,郝乐,等. 轻量化煤矸目标检测方法研究[J]. 工矿自动化,2021,47(11):119-125.DU Jingyi,SHI Zhimang,HAO Le,et al. Research on lightweight coal and gangue target detection method[J]. Industry and Mine Automation,2021,47(11):119-125. [6] 汝洪芳,张冬冬. YOLOv5检测煤矸石的改进方法[J]. 黑龙江科技大学学报,2021,31(6):818-823. doi: 10.3969/j.issn.2095-7262.2021.06.023RU Hongfang,ZHANG Dongdong. Coal gangue detection method based on improved YOLOv5[J]. Journal of Heilongjiang University of Science and Technology,2021,31(6):818-823. doi: 10.3969/j.issn.2095-7262.2021.06.023 [7] 桂方俊,李尧. 基于CBA−YOLO模型的煤矸石检测[J]. 工矿自动化,2022,48(6):128-133.GUI Fangjun,LI Yao. Coal gangue detection based on CBA-YOLO model[J]. Journal of Mine Automation,2022,48(6):128-133. [8] 沈科,季亮,张袁浩,等. 基于改进YOLOv5s模型的煤矸目标检测[J]. 工矿自动化,2021,47(11):107-111,118.SHEN Ke,JI Liang,ZHANG Yuanhao,et al. Research on coal and gangue detection algorithm based on improved YOLOv5s model[J]. Industry and Mine Automation,2021,47(11):107-111,118. [9] REDMON J, DIVVALA S, GIRSHICK R, et al. You only look once: unified, real-time object detection[EB/OL]. [2022-05-25]. https://arxiv.org/abs/1506.02640. [10] BOCHKOVSKIY A, WANG C Y, LIAO H Y M. YOLOv4: optimal speed and accuracy of object detection[EB/OL]. [2022-05-25]. https://arxiv.org/abs/2004.10934. [11] HE Kaiming,ZHANG Xiangyu,REN Shaoqing,et al. Spatial pyramid pooling in deep convolutional networks for visual recognition[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence,2015,37(9):1904-1916. doi: 10.1109/TPAMI.2015.2389824 [12] 林清平,张麒麟,肖蕾. 采用改进YOLOv5网络的遥感图像目标识别方法[J]. 空军预警学院学报,2021,35(2):117-120.LIN Qingping,ZHANG Qilin,XIAO Lei. Method of remote sensing image target recognition based on improved YOLOv5 network[J]. Journal of Air Force Early Warning Academy,2021,35(2):117-120. [13] CHEN L C,PAPANDREOU G,KOKKINOS I,et al. DeepLab:semantic image segmentation with deep convolutional nets,atrous convolution,and fully connected CRFs[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence,2018,40(4):834-848. doi: 10.1109/TPAMI.2017.2699184 [14] KINGMA D P, BA J. Adam: a method for stochastic optimization[EB/OL]. [2022-05-25]. https://arxiv.org/abs/1412.6980. [15] ROBBINS H, MONRO S. A stochastic approximation method[M]. New York: Springer, 1985. [16] YU F, KOLTUN V. Multi-scale context aggregation by dilated convolutions[EB/OL]. [2022-05-25]. https://arxiv.org/abs/1511.07122.