留言板

尊敬的读者、作者、审稿人, 关于本刊的投稿、审稿、编辑和出版的任何问题, 您可以本页添加留言。我们将尽快给您答复。谢谢您的支持!

姓名
邮箱
手机号码
标题
留言内容
验证码

基于改进YOLOv7的露头区岩石裂缝检测识别

王婷婷 王洪涛 黄志贤 杨明昊 赵万春 郑雄杰

王婷婷,王洪涛,黄志贤,等. 基于改进YOLOv7的露头区岩石裂缝检测识别[J]. 地质科技通报,2025,44(1):1-14 doi: 10.19509/j.cnki.dzkq.tb20230425
引用本文: 王婷婷,王洪涛,黄志贤,等. 基于改进YOLOv7的露头区岩石裂缝检测识别[J]. 地质科技通报,2025,44(1):1-14 doi: 10.19509/j.cnki.dzkq.tb20230425
WANG Tingting,WANG Hongtao,HUANG Zhixian,et al. Rock fracture detection and identification in outcrop areas via improved YOLOv7[J]. Bulletin of Geological Science and Technology,2025,44(1):1-14 doi: 10.19509/j.cnki.dzkq.tb20230425
Citation: WANG Tingting,WANG Hongtao,HUANG Zhixian,et al. Rock fracture detection and identification in outcrop areas via improved YOLOv7[J]. Bulletin of Geological Science and Technology,2025,44(1):1-14 doi: 10.19509/j.cnki.dzkq.tb20230425

基于改进YOLOv7的露头区岩石裂缝检测识别

doi: 10.19509/j.cnki.dzkq.tb20230425
基金项目: 国家自然科学基金项目(52074088,52174022,51574088,51404073);东北石油大学省杰青后备人才项目(SJQH202002);2020年度东北石油大学西部油田开拓专项(XBYTKT202001);黑龙江省博士后科研启动项目(LBH-Q20074;LBH-Q21086);控制科学与工程团队专项(2022TSTD-04)
详细信息
    作者简介:

    王婷婷:E-mail:wangtingting@nepu.edu.cn

    通讯作者:

    E-mail:zhaowanchun@nepu.edu.cn

  • 中图分类号: P583

Rock fracture detection and identification in outcrop areas via improved YOLOv7

More Information
  • 摘要:

    野外露头区岩石裂缝的检测对于裂缝性油气藏的地质勘测具有重要意义,但传统的图像处理算法对岩石裂缝检测效果欠佳,经典的深度学习模型检测效率与复杂地质环境的岩石裂缝检测精度较低,因此提出了一种改进的露头区岩石裂缝检测算法YOLOv7-PCN。首先,融入PConv(partial convolution)模块替换主干网络的部分标准卷积,从而降低网络计算量,提高网络检测速度;其次,引入坐标注意力机制(coordinate attention,简称CA),增强对裂缝关键边缘与密集分布位置特征的提取能力;最后,边界框回归损失函数使用NWD(normalized Wasserstein distance)度量方式,优化了网络训练的收敛速度,提高了复杂地质环境岩石图像分辨率较低与小目标裂缝的定位检测精度。同时在数据处理方面结合数据增强方法构建了露头区岩石裂缝数据集,提高了网络模型的泛化能力。实验结果表明,该算法在4种岩石类别(白云岩、灰岩、泥岩和砂岩)的裂缝检测上mAP值(平均精确率的均值)达到82.5%,相比于原YOLOv7算法,提升了7.7%,同时模型参数量减少了29.6%,模型计算量节省了31.2%,模型检测速度提升了39.2%。本研究提出的改进YOLOv7岩石裂缝检测算法,在实现轻量化同时使得复杂环境下的裂缝检测结果更加准确,为地质岩石裂缝识别与勘测任务提供了重要的技术参考。

     

  • 图 1  PConv模块结构图

    Input为模块输入部分;Output为模块输出部分;Identity为神经网络的恒等映射操作;Filters为神经网络的滤波器;hw分别为输入、输出特征图的高与宽;k为滤波器的高宽大小;cp为输入、输出特征图及滤波器的相应通道数

    Figure 1.  Structure diagram of PConv module

    图 2  CA模块结构图

    Input为模块输入部分;Output为模块输出部分;X Avg Pool与Y Avg Pool分别代表输入特征图水平与垂直方向的全局平均池化操作;Concat与Conv2d分别代表通道拼接及卷积操作;BatchNorm与Non-linear分别代表批量归一化及Sigmoid非线性激活操作;Split代表对空间维度分别使用不同大小卷积核的卷积操作;chwrffhfwghgw分别代表相应的输入、中间转换操作、输出特征图的通道数、高度、宽度、特征维度降低倍率及所得到的相应中间特征图、高宽维度分离特征图、高宽维度上的两个注意力权重

    Figure 2.  Structure diagram of CA module

    图 3  改进的YOLOv7网络结构图

    Position 1,3,5,7为PConv模块替换的位置;Position 2,4,6为引入CA注意力机制的位置;Position 8,9,10为NWD度量方式主要作用的位置。其中,CBS:Convolution + Batch Normalization + SiLU,代表卷积 + 批量归一化 + SiLU激活函数非线性激活的结合操作;SPPCSPC:Spatial Pyramid Pooling + Cross Stage Partial Channel,代表融合空间金字塔池化及跨阶段部分通道的特殊卷积操作;MPConv:MaxPooling Convolution,代表最大池化卷积操作;CBM:Convolution + Batch Normalization + Sigmoid,代表卷积 + 批量归一化 + Sigmoid激活函数非线性激活的结合操作;RepConv:Re-parameterized Convolution,代表重新参数化的卷积操作。Input为网络输入部分;640×640×3为输入图像的尺寸大小;Output为网络输出部分;Concat为相应特征图通道拼接操作;Conv为卷积操作;BN为批量归一化操作;Maxpool为最大池化操作;UP为结合卷积、批量归一化及非线性激活的上采样(UpSample)操作;ADD为特征图相加,通道数不变的操作;c及各倍率c分别为各模块相应的输入及输出通道数,同时也通过箭头对通道数的相应变化进行表示

    Figure 3.  Improved YOLOv7 network structure diagram

    图 4  标注示例图片

    Figure 4.  Example for labelled images

    图 5  数据增强

    Figure 5.  Data augmentation

    图 6  不同训练数据量精确率曲线

    Figure 6.  Accuracy curves based ob different training datasets

    图 7  不同训练数据样本量类别拟合图

    Figure 7.  Fitting diagram of different training data samples

    图 8  消融实验(mAP@.5)结果对比图

    Figure 8.  Result comparison chart of the ablation experiment (mAP@.5)

    图 9  不同模型损失曲线对比图

    Figure 9.  Loss curve comparison chart for different models

    图 10  改进前(a)、后(b)的前混淆矩阵

    Figure 10.  Confusion matrix before (a) and after (b) improvement

    图 11  4种主要检测算法模型对比图

    Figure 11.  Comparison chart for four primary detection algorithms

    图 12  加入注意力机制效果对比

    Figure 12.  Comparison for the impact of adding attention mechanism

    表  1  YOLO格式标注文件内容

    Table  1.   The annotation file content based on YOLO format

    class center_x center_y width height
    0 0.222656 0.082031 0.109375 0.156250
    0 0.326172 0.242188 0.121094 0.156250
    0 0.421875 0.402344 0.109375 0.156250
    0 0.554688 0.537109 0.148438 0.113281
    0 0.693359 0.527344 0.105469 0.148438
    0 0.750000 0.408203 0.117188 0.089844
    0 0.902344 0.326172 0.195312 0.105469
    0 0.644531 0.693359 0.109375 0.175781
    0 0.628906 0.892578 0.078125 0.214844
    0 0.162109 0.484375 0.152344 0.171875
    下载: 导出CSV

    表  2  实验环境配置

    Table  2.   Experimental environment deployment

    参数 配置
    操作系统 Ubuntu 20.04.2 LTS
    CPU Intel(R)Core(TM) i5-10400F CPU @2.90 GHz
    GPU NVIDIA GeForce RTX 2060(6G)
    编程语言 Python 3.9.12
    深度学习框架 Pytorch 1.11.0+CUDA 11.3+cudnn 8.2.0
    下载: 导出CSV

    表  3  消融实验设计

    Table  3.   Design of ablation experiment

    序号 模型 PConv CA NWD
    YOLOv7 $\times $ $\times $ $\times $
    YOLOv7-P $\times $ $\times $
    YOLOv7-C $\times $ $\times $
    YOLOv7-N $\times $ $\times $
    YOLOv7-PC $\times $
    YOLOv7-PN $\times $
    YOLOv7-PCN
    “√”代表使用该策略;“$\times $”代表未使用该策略。①代表原YOLOv7算法网络;②代表了将YOLOv7部分主干特征提取卷积模块替换为PConv模块;③代表嵌入CA注意力机制;④代表将边界框回归损失函数的IoU度量方式替换为NWD的Wasserstein距离度量;⑤与⑥分别代表主要的不同改进策略组合网络;⑦代表本研究提出的YOLOv7-PCN改进算法网络;下同
    下载: 导出CSV

    表  4  消融实验结果对比

    Table  4.   Comparison of ablation experimental results

    序号 模型 Precision/
    %
    Recall/
    %
    mAP@.5/
    %
    Params/
    M
    GFLOPs/
    G
    FPS
    YOLOv7 82.9 72.6 74.8 37.21 51.60 56
    YOLOv7-P 83.5 73.3 75.6 25.98 35.46 85
    YOLOv7-C 84.7 74.8 77.8 37.52 51.71 54
    YOLOv7-N 85.7 75.5 78.6 37.21 51.60 62
    YOLOv7-PC 85.8 76 79.2 26.22 35.51 78
    YOLOv7-PN 86.2 77.6 80.8 25.98 35.46 88
    YOLOv7-PCN 86.8 78.5 82.5 26.21 35.50 78
    下载: 导出CSV

    表  5  不同检测算法效果对比

    Table  5.   Comparison for different detection algorithms

    模型 mAP@.5/% Params/M GFLOPs/G FPS
    Faster-RCNN 73.4 174.38 74.23 16
    SSD 71.6 24.32 78.52 22
    YOLOv4 73.6 52.53 63.26 45
    YOLOv5l 72.5 46.56 53.63 58
    YOLOv7 74.8 37.21 51.60 56
    YOLOv7-GhostNet 75.3 20.85 32.75 86
    YOLOv7-ShuffleNetV2 74.6 21.36 31.63 90
    YOLOv7-PCN 82.5 26.21 35.50 78
    下载: 导出CSV

    表  6  不同注意力机制对比结果

    Table  6.   Comparative results for different attention mechanisms

    模型 mAP@.5/% Params/M FPS
    YOLOv7-PCN-CA 82.5 26.21 78
    YOLOv7-PCN-CBAM 81.4 26.28 76
    YOLOv7-PCN-SE 82.2 26.17 71
    YOLOv7-PCN-ECA 81.8 26.15 73
    下载: 导出CSV
  • [1] 高翔,冯建伟,渠继航,等. 基于数字露头的多尺度裂缝模型建立及其对地下裂缝预测指导[J]. 地质科技通报,2024,43(2):143-155.

    GAO X,FENG J W,QU J H,et al. Establishment of multi-scale fracture model based on digital outcrop and its guidance for subsurface fracture prediction[J]. Bulletin of Geological Science and Technology,2024,43(2):143-155. (in Chinese with English abstract
    [2] 梁晓伟,王庆鹏,尤源,等. 非常规油气储层天然裂缝研究方法及其适用性[J]. 中国矿业,2021,30(4):206-211.

    LIANG X W,WANG Q P,YOU Y,et al. Study method of natural fractures in unconventional oil and gas reservoirs and its applicability[J]. China Mining Magazine,2021,30(4):206-211. (in Chinese with English abstract
    [3] 黄彦庆,肖开华,金武军,等. 川东北元坝西部须家河组致密砂岩裂缝发育特征及控制因素[J]. 地质科技通报,2023,42(2):105-114.

    HUANG Y Q,XIAO K H,JIN W J,et al. Characteristics and controlling factors of tight sandstone reservoir fractures in the Xujiahe Formation of the western Yuanba area,northeastern Sichuan Basin[J]. Bulletin of Geological Science and Technology,2023,42(2):105-114. (in Chinese with English abstract
    [4] 张冠杰,张滨鑫,徐珂,等. 塔里木盆地库车坳陷博孜区块超深层致密砂岩储层裂缝特征及其对油气产能的影响[J]. 地质科技通报,2024,43(2):75-86.

    ZHANG G J,ZHANG B X,XU K,et al. Fracture characteristics of ultra-deep tight sandstone reservoirs in Bozi Block,Kuqa Depression of Tarim Basin,and effects on oil gas production[J]. Bulletin of Geological Science and Technology,2024,43(2):75-86. (in Chinese with English abstract
    [5] 陈俊杰. 油气储层裂缝预测方法及发展趋势[J]. 石化技术,2017,24(4):151.

    CHEN J J. Fracture prediction method and development trend of oil and gas reservoirs[J]. Petrochemical Industry Technology,2017,24(4):151. (in Chinese with English abstract
    [6] 曹家乐,李亚利,孙汉卿,等. 基于深度学习的视觉目标检测技术综述[J]. 中国图象图形学报,2022,27(6):1697-1722. doi: 10.11834/jig.220069

    CAO J L,LI Y L,SUN H Q,et al. A survey on deep learning based visual object detection[J]. Journal of Image and Graphics,2022,27(6):1697-1722. (in Chinese with English abstract doi: 10.11834/jig.220069
    [7] 包晓敏,王思琪. 基于深度学习的目标检测算法综述[J]. 传感器与微系统,2022,41(4):5-9.

    BAO X M,WANG S Q. Survey of object detection algorithm based on deep learning[J]. Transducer and Microsystem Technologies,2022,41(4):5-9. (in Chinese with English abstract
    [8] LIU W,ANGUELOV D,ERHAN D,et al. SSD:Single shot MultiBox detector[C]//Anon. Proceedings of the European Conference on Computer Vision,Netherlands. Berlin,Heidelberg:Springer-Verlag,2016:21-37.
    [9] XIE X,CHENG G,WANG J,et al. Oriented R-CNN for object detection[C]//Anon. Proceedings of the IEEE/CVF International Conference on Computer Vision. [S. 1. ]:[S. n. ],2021:3520-3529.
    [10] GIRSHICK R. Fast R-CNN[C]//Anon. 2015 IEEE International Conference on Computer Vision. New York:IEEE Press,2015:1440-1448.
    [11] REN S Q,HE K M,GIRSHICK R,et al. Faster R-CNN:Towards real-time object detection with region proposal networks[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence,2017,39(6):1137-1149. doi: 10.1109/TPAMI.2016.2577031
    [12] HE K,GKIOXARI G,DOLLÁR P,et al. Mask R-CNN[C]//Anon. Proceedings of the IEEE International Conference on Computer Vision. [S. 1. ]:[s. n. ],2017:2961-2969.
    [13] 李良福,马卫飞,李丽,等. 基于深度学习的桥梁裂缝检测算法研究[J]. 自动化学报,2019,45(9):1727-1742.

    LI L F,MA W F,LI L,et al. Research on bridge fracture detection algorithm based on depth learning[J]. Acta Automatica Sinica,2019,45(9):1727-1742. (in Chinese with English abstract
    [14] ZHU J Q,ZHONG J T,MA T,et al. Pavement distress detection using convolutional neural networks with images captured via UAV[J]. Automation in Construction,2022,133:103991. doi: 10.1016/j.autcon.2021.103991
    [15] 廖祥灿,李彩林,姚玉凯,等. 基于改进YOLO V5的公路桥梁裂缝检测方法[J]. 山东理工大学学报(自然科学版),2023,37(4):1-7.

    LIAO X C,LI C L,YAO Y K,et al. Fracture detection method of highway bridge based on improved YOLO V5[J]. Journal of Shandong University of Technology (Natural Science Edition),2023,37(4):1-7. (in Chinese with English abstract
    [16] 余加勇,刘宝麟,尹东,等. 基于YOLOv5和U-Net3+的桥梁裂缝智能识别与测量[J]. 湖南大学学报(自然科学版),2023,50(5):65-73.

    YU J Y,LIU B L,YIN D,et al. Intelligent identification and measurement of bridge fractures based on YOLOv5 and U-Net3+[J]. Journal of Hunan University(Natural Sciences),2023,50(5):65-73. (in Chinese with English abstract
    [17] 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]//Anon. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. [S. 1. ]:[S. n. ],2023:7464-7475.
    [18] CHEN J,KAO S,HE H,et al. Run,Don't walk:Chasing Higher FLOPS for Faster Neural Networks[C]//Anon. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. [S. l. ]:[S. n. ],2023:12021-12031.
    [19] HOU Q,ZHOU D,FENG J. Coordinate attention for efficient mobile network design[C]//Anon. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. [S. 1. ]:[S. n. ],2021:13713-13722.
    [20] ZHENG Z H,WANG P,REN D W,et al. Enhancing geometric factors in model learning and inference for object detection and instance segmentation[J]. IEEE Transactions on Cybernetics,2022,52(8):8574-8586. doi: 10.1109/TCYB.2021.3095305
    [21] WANG J,XU C,YANG W,et al. A normalized Gaussian Wasserstein distance for tiny object detection[J]. arXiv preprint arXiv,2021,2110:13389.
  • 加载中
图(12) / 表(6)
计量
  • 文章访问数:  345
  • PDF下载量:  45
  • 被引次数: 0
出版历程
  • 收稿日期:  2023-07-21
  • 录用日期:  2023-09-15
  • 修回日期:  2023-09-10
  • 网络出版日期:  2023-12-17

目录

    /

    返回文章
    返回