计算机工程与应用 ›› 2024, Vol. 60 ›› Issue (6): 89-99.DOI: 10.3778/j.issn.1002-8331.2309-0072

• 目标检测专题 • 上一篇    下一篇

改进YOLOv7的水下目标检测算法

梁秀满,李然,于海峰,刘振东   

  1. 华北理工大学 电气工程学院,河北 唐山 063210
  • 出版日期:2024-03-15 发布日期:2024-03-15

Improved Underwater Object Detection Algorithm of YOLOv7

LIANG Xiuman, LI Ran, YU Haifeng, LIU Zhendong   

  1. School of Electrical Engineering, North China University of Science and Technology, Tangshan, Hebei 063210, China
  • Online:2024-03-15 Published:2024-03-15

摘要: 水下目标检测是海洋探测开发过程中一项具有挑战性的任务。针对现有的水下目标检测算法由于水下图像的低可见度和颜色失真等问题导致水下目标检测效果不佳的问题,提出了一种改进YOLOv7的水下目标检测算法,旨在提升水下目标检测性能。设计了一种多信息流融合注意力机制(spatial group-wise coordinated competitive attention, SGCA),解决卷积过程中由于图像全局上下文信息丢失而导致特征丢失的问题,提高了模型在图像模糊情况下的检测精度;并利用switchable atrous convolution(SAConv)模块替换ELAN结构中的3×3卷积模块,以增强骨干网络的特征提取能力。在预测部分采用Wise-IoU作为损失函数,Wise-IoU通过平衡不同质量图像上的模型训练结果,获得更准确的检测结果。采用基于暗通道先验(dark channel prior,DCP)和深度传输图的水下图像增强方法对水下数据集图像进行增强。实验结果表明,改进后的算法在自建的水下目标检测数据集上mAP取得了87.3%,与原始的YOLOv7算法相比较,mAP提高了3.4个百分点;在增强后的水下图像数据集上的mAP为87.1%,提升了2.1个百分点。因此,提出的策略在水下目标检测任务中具有优越的性能。

关键词: YOLOv7, 注意力机制, 水下图像增强, 损失函数

Abstract: Underwater object detection is a challenging task in the process of marine exploration and development. Addressing the issue of poor underwater target detection performance in existing algorithms due to problems such as low visibility and color distortion in underwater images, an improved YOLOv7 underwater target detection algorithm is proposed with the aim of improving underwater object detection performance. Firstly, a multi-information flow fusion attention mechanism (spatial group-wise coordinated competitive attention, SGCA) is designed to solve the problem of feature loss caused by the loss of global context information of the image in the convolution process. It improves the detection accuracy of the model in the case of image blur. Additionally, the switchable atrous convolution (SAConv) module is used to replace the 3×3 convolution module in the ELAN structure to enhance the feature extraction capability of the backbone network. Secondly, Wise-IoU is used as the loss function in the prediction part, which obtains more accurate detection results by balancing model training outcomes on images of varying quality. Finally, an underwater image enhancement method based on dark channel prior (DCP) and depth transmission maps is employed to enhance the images in the underwater dataset. Experimental results show that the improved algorithm achieves a mAP of 87.3% on the self-built underwater object detection dataset, which is 3.4 percengtage points higher than that of the original YOLOv7 algorithm. On the enhanced underwater image dataset, mAP is 87.1%, increases 2.1 percentage points. Therefore, the proposed approach exhibits superior performance in underwater object detection tasks.

Key words: YOLOv7, attention mechanism, underwater image enhancement, loss function