ULGF: A Diffusion Model-Based Image Generation Framework for Underwater Object Detection

Yaoming Zhuang, Longyu Ma, Jiaming Liu, Yujie Xian, Baoquan Chen, Li Li, Chengdong Wu, Wei Cui, Zhanlin LiuResearch Square 2025

Abstract

Underwater object detection plays a crucial role in applications such as marine ecological monitoring and underwater rescue operations. However, challenges such as limited underwater data availability and low scene diversity hinder detection accuracy. In this paper, we propose the Underwater Layout-Guided Diffusion Framework (ULGF), a novel diffusion model-based framework designed to augment underwater detection datasets. Unlike conventional methods that generate underwater images by integrating in-air information, ULGF operates exclusively on a small set of underwater images and their corresponding labels, requiring no external data. Our approach enables the generation of high-fidelity, diverse, and theoretically infinite underwater images, significantly enhancing object detection performance in real-world underwater scenarios. Furthermore, we evaluate the quality of the generated underwater images, demonstrating that ULGF produces images with a smaller domain gap. We have publicly released the ULGF source code and the generated dataset for further research.

Introduction

Underwater object detection is a fundamental challenge for marine robotics and ecological monitoring. The environment is characterized by complex optical phenomena, including light scattering, absorption, and significant color distortion—often resulting in a pervasive blue-green tint. Beyond these physical hurdles, the primary bottleneck for developing robust detection models is the scarcity of high-quality, labeled underwater data.

Traditional data augmentation techniques often rely on "air-to-water" translation, where land-based images are stylistically altered to appear submerged. However, these methods frequently fail to capture the nuanced physics of underwater environments, leading to a "domain gap" where models trained on synthetic data fail in real-world conditions. The Underwater Layout-Guided Diffusion Framework (ULGF) addresses this by generating high-fidelity underwater images using only a limited set of real underwater data, effectively bridging the domain gap without needing external reference images.

Methodology

ULGF is built upon the Latent Diffusion Model (LDM) architecture, optimized for the specific requirements of underwater object detection. The framework integrates several key components to ensure the generated data is both realistic and structurally accurate for training.

Layout-Guided Generation and Geo Encoding

To provide precise control over object placement, ULGF utilizes Geo encoding. This process converts bounding box coordinates into spatial masks, ensuring that objects like fish, divers, or coral are generated at specific locations. This allows researchers to intentionally create challenging training scenarios, such as overlapping objects or targets positioned at image boundaries, which are often underrepresented in natural datasets.

Prior Knowledge Extraction (PKE)

A significant innovation in ULGF is the Prior Knowledge Extraction (PKE) module. By encoding features from a small sample of real underwater images, the model learns the underlying distributions of textures and lighting conditions. During the generation process, the model samples from these distributions to ensure that the synthetic images maintain the physical consistency of real underwater scenes.

The ULGF framework utilizes Prior Knowledge Extraction (PKE) and layout labels to guide the generation of underwater features.

Denoising and Text Integration

The core of the generation process is a Denoising U-Net, which iteratively removes noise from a latent representation. This process is conditioned on both the spatial layout masks and semantic text prompts. To enhance the semantic understanding of the model, ChatGPT was employed to generate descriptive narratives of underwater scenes, which are then processed by a CLIP-based text encoder to guide the diffusion process.

The Denoising U-Net architecture iteratively refines latent representations based on text and layout conditions.

Experimental Setup

The framework was trained and evaluated using the Realistic Underwater Object Detection (RUOD) dataset, which contains 14,000 images across 10 categories, including holothurians, corals, fish, divers, and jellyfish. The standard YOLO-format labels were converted into a format compatible with the diffusion framework, consisting of image-description-mask triplets.

Results and Discussion

ULGF demonstrates superior performance in both image quality and its impact on object detection accuracy.

Detection Performance

Augmenting training sets with ULGF-generated data led to consistent improvements in mean Average Precision (mAP50) across various models. Notably, YOLOv5 and YOLOv11 saw increases of 1.2% and 1.5%, respectively. The framework was particularly effective for rare categories; for instance, "diver" detection accuracy improved by 3.6% AP, demonstrating the model's ability to synthesize high-quality examples of infrequent objects.

Image Realism and Domain Gap

In terms of image authenticity, ULGF significantly outperformed existing methods. It achieved a Fréchet Inception Distance (FID) score of 23, representing a massive improvement over competing models like UWGAN and UWCNN, which scored between 168 and 229. While structural similarity metrics (SSIM) were comparable to other models, the low FID score indicates that ULGF-generated images are much closer to the distribution of real underwater data, effectively minimizing the domain gap.

Conclusion

ULGF provides a robust solution to the data scarcity problem in underwater computer vision. By leveraging layout-guided diffusion and prior knowledge extraction, it generates diverse, high-fidelity training data without the need for in-air reference images. While the model currently faces challenges with extremely small training sets and fine texture details, future work will focus on integrating more complex physical variables, such as turbidity and light scattering models, to further enhance the realism of the generated environments.

Summary updated

BibTeX
@inproceedings{zhuang2025ulgf,
  author = {Yaoming Zhuang and Longyu Ma and Jiaming Liu and Yujie Xian and Baoquan Chen and Li Li and Chengdong Wu and Wei Cui and Zhanlin Liu},
  title = {{ULGF: A Diffusion Model-Based Image Generation Framework for Underwater Object Detection}},
  booktitle = {Research Square},
  year = {2025},
  doi = {10.21203/rs.3.rs-6203542/v1},
}
Figure