Underwater Target Detection Based on Improved YOLOv7

Kaiyue Liu, Qi Sun, Sun Daming, Peng Lin, Mengduo Yang, Nizhuan Wang

TL;DR

Researchers have developed YOLOv7-AC, an optimized version of the YOLOv7 object detection architecture specifically tailored for the harsh conditions of underwater environments. By integrating a hybrid "ACmix" module that combines the strengths of self-attention and convolution, along with a Global Attention Mechanism (GAM), the model achieves significantly higher accuracy (up to 89.6% mAP on the URPC dataset) and faster inference speeds than the original YOLOv7.

What Problem Does This Paper Address?

Detecting objects underwater is a nightmare for standard computer vision. Unlike clear-air environments, water causes light to scatter and absorb, leading to severe color distortion, low contrast, and "murky" visibility.

Conventional deep learning models often struggle in these conditions because their feature extraction isn't robust enough to distinguish a target from a noisy, blue-green background. Furthermore, many high-accuracy models are too computationally heavy for the real-time requirements of underwater robots (AUVs/ROVs). The authors sought to bridge this gap by creating a model that is both more "perceptive" of subtle features and efficient enough for practical deployment.

Methods

The authors introduced several structural innovations to the standard YOLOv7 framework to create YOLOv7-AC:

  • The ACmixBlock: This is the core innovation. The authors replaced standard 3x3 convolutions in the E-ELAN (Extended Efficient Layer Aggregation Network) structure with an ACmix module. ACmix is a hybrid approach that recognizes that both self-attention and convolution rely heavily on 1x1 convolutions. It performs the 1x1 projection once and then branches into both paths, combining the local learning of convolutions with the global context of self-attention.
  • ResNet-ACmix: A new bottleneck module was designed for the backbone to prevent information loss during deep feature extraction while simultaneously reducing the total parameter count.
  • Global Attention Mechanism (GAM): To help the model focus on what matters, GAM modules were inserted into the backbone and head. GAM captures both channel and spatial dependencies, helping the network ignore irrelevant background noise.
  • AC-E-ELAN Structure: The authors optimized the E-ELAN module by incorporating skip connections and 1x1 convolutional branches (inspired by RepVGG), which speeds up inference without sacrificing the richness of the learned features.
  • K-means++ for Anchors: Instead of using standard K-means to determine initial bounding box sizes (anchors), they used K-means++, which is less sensitive to initial outliers and leads to better-fitting boxes for the specific dimensions of underwater targets.

Datasets

The model was evaluated on two primary benchmarks:

  1. URPC (2021 National Underwater Robot Professional Competition): Contains 7,600 images of seafood (holothurian, echinus, scallop, and starfish). The authors filtered this down to 6,575 valid images.
  2. Brackish Dataset: The first publicly available European underwater dataset, featuring 2,465 images of fish, crabs, shrimp, and jellyfish in more temperate, murky waters.

Key Insights and Ideas

  • The "Best of Both Worlds" Strategy: The most significant insight is that you don't have to choose between the local efficiency of convolutions and the global reach of self-attention. By exploiting their shared reliance on 1x1 convolutions, the ACmix module provides the benefits of both with minimal computational overhead.
  • Attention is Essential for Murky Water: The inclusion of GAM suggests that in low-visibility environments, "where" and "what" the model looks at is just as important as the raw features it extracts.
  • Efficiency Gains: Surprisingly, adding these sophisticated modules didn't slow the model down. By optimizing the E-ELAN structure with skip connections, the researchers actually increased the frames-per-second (FPS) compared to the baseline YOLOv7.

Key Results

The YOLOv7-AC model outperformed the baseline and several other state-of-the-art models (like YOLOv5s, YOLOv6, and SSD) across the board:

  • Accuracy (URPC): Achieved a mean Average Precision (mAP) of 89.6%, a 3.4% improvement over the original YOLOv7.
  • Accuracy (Brackish): Achieved a staggering 97.4% mAP, outperforming the baseline by 1.1%.
  • Speed: On the URPC dataset, the model reached 74 FPS, and on the Brackish dataset, it hit 92 FPS. This is faster than the original YOLOv7 (73 and 90 FPS, respectively), making it highly suitable for real-time robot navigation.
  • Robustness: Qualitative results (images) showed that YOLOv7-AC was much better at detecting small or overlapping targets in highly distorted, low-light scenes where the original model often missed them.

Limitations and Future Work

Despite the improvements, the authors acknowledge that the model still experiences false detections and missed targets in extremely complex or "harsh" underwater environments where visibility is near zero.

The paper concludes that the primary bottleneck for future progress is the availability of high-quality, diverse underwater datasets. Future research will likely focus on collecting more varied data and exploring image enhancement techniques (like de-hazing or color correction) as a pre-processing step to further boost detection reliability in the murkiest conditions.

Summary updated

Abstract

Underwater target detection is a crucial aspect of ocean exploration. However, conventional underwater target detection methods face several challenges such as inaccurate feature extraction, slow detection speed, and lack of robustness in complex underwater environments. To address these limitations, this study proposes an improved YOLOv7 network (YOLOv7-AC) for underwater target detection. The proposed network utilizes an ACmixBlock module to replace the 3 × 3 convolution block in the E-ELAN structure, and incorporates jump connections and 1 × 1 convolution architecture between ACmixBlock modules to improve feature extraction and network reasoning speed. Additionally, a ResNet-ACmix module is designed to avoid feature information loss and reduce computation, while a Global Attention Mechanism (GAM) is inserted in the backbone and head parts of the model to improve feature extraction. Furthermore, the K-means++ algorithm is used instead of K-means to obtain anchor boxes and enhance model accuracy. Experimental results show that the improved YOLOv7 network outperforms the original YOLOv7 model and other popular underwater target detection methods. The proposed network achieved a mean average precision (mAP) value of 89.6% and 97.4% on the URPC dataset and Brackish dataset, respectively, and demonstrated a higher frame per second (FPS) compared to the original YOLOv7 model. In conclusion, the improved YOLOv7 network proposed in this study represents a promising solution for underwater target detection and holds great potential for practical applications in various underwater tasks.
BibTeX
@article{liu2023underwater,
  author = {Kaiyue Liu and Qi Sun and Sun Daming and Peng Lin and Mengduo Yang and Nizhuan Wang},
  title = {{Underwater Target Detection Based on Improved YOLOv7}},
  journal = {Journal of Marine Science and Engineering},
  year = {2023},
  doi = {10.3390/jmse11030677},
}

Loading related content...

Figure