Hierarchical Segmentation-guided Diffusion Framework for High-Fidelity Sonar Image Generation

Zhihao Ma, Weiliang Meng, C. J. Tang, L. W. JiangResearch Square 2025

Abstract

The scarcity of high-quality datasets significantly hinders sonar image research. Existing image generation methods often produce low-fidelity, detail-poor results due to uncontrollable randomness. To overcome this, we introduce the Hierarchical Segmentation-guided Diffusion Model (HSD-Sonar), a novel framework for optimized sonar image synthesis. HSD-Sonar employs a hierarchical approach: at the image level, it dynamically adjusts diffusion steps based on input characteristics and precisely controls target regions using masks, enhancing output detail and semantic consistency. At the feature level, it reinforces positional information with mask data and optimizes loss calculation via a region importance-based SG-Loss, effectively reducing background noise and improving perceptual realism. Extensive experiments on multiple public sonar segmentation datasets demonstrate HSD-Sonar's significant superiority in generating high-quality, semantically consistent sonar images.

Introduction

Sonar imaging is a critical technology for underwater exploration, navigation, and debris detection. However, the development of robust deep learning models for sonar analysis is constrained by the lack of large-scale, high-quality datasets. Collecting sonar data is expensive, logistically challenging, and often restricted. While generative models like Generative Adversarial Networks (GANs) and standard Diffusion Models offer a potential solution through synthetic data generation, they frequently struggle with the unique characteristics of sonar imagery—high noise levels, subtle textures, and specific acoustic echo patterns. These models often produce "detail-poor" results or fail to maintain the structural integrity of objects, leading to "hallucinated" randomness rather than physically plausible structures.

Methodology: The HSD-Sonar Framework

To address these challenges, we propose the Hierarchical Segmentation-guided Diffusion Model (HSD-Sonar). This framework utilizes segmentation masks to provide guidance at both the image and feature levels, ensuring structural fidelity and realistic texture generation.

Overview of the HSD-Sonar framework, illustrating the training and sampling pipelines with hierarchical guidance.

Image-Level Guidance

Image-level guidance focuses on the global structure and local refinement of the generated sonar images through three key modules:

  • Dynamic Step Adaptation (DSA): DSA analyzes the edge density of the input mask. It allocates more diffusion steps to regions with complex textures to ensure fine-grained reconstruction, while using fewer steps for smoother regions to optimize computational efficiency.
  • Dynamic Sampling Embedding (DSE): This module progressively blends the segmentation mask into the noise map during the sampling process. By using a dynamic mixing variable, the model transitions from a structure-constrained phase to a free-form refinement phase, preventing the "cut-and-paste" look common in guided generation.
  • Dynamic Mask Enhancement (DME): A post-processing stage that employs edge extraction and Contrast Limited Adaptive Histogram Equalization (CLAHE) to sharpen object boundaries and enhance local contrast.
Detailed view of the Dynamic Step Adaptation (DSA), Dynamic Mask Enhancement (DME), and Dynamic Sampling Embedding (DSE) modules.

Feature-Level Guidance

Feature-level guidance ensures that the internal representations of the neural network are aligned with the desired object structures:

  • Masked Feature Fusion (MFF): This module utilizes attention mechanisms to prioritize the processing of regions defined by the segmentation mask, reinforcing positional information.
  • Segmentation-Guided Loss (SG-Loss): Unlike standard loss functions that treat all pixels equally, SG-Loss weights the loss calculation based on region importance. Errors in the foreground (the target object) are penalized more heavily than background noise, significantly improving perceptual realism.

Experimental Evaluation

The HSD-Sonar model was validated across five diverse public sonar datasets: FLSMDD (marine debris), SSSD (shipwrecks/aircraft), NNSSS (narrow-beam side-scan), WSSSS (waterfall-processed side-scan), and AI4Shipwrecks.

Key Results

HSD-Sonar consistently outperformed state-of-the-art models like ControlNet and SegGuidedDif. On the FLSMDD dataset, the model achieved a Fréchet Inception Distance (FID) of 101.49, representing a 28.4% improvement over previous benchmarks. Additionally, the model showed significant gains in Peak Signal-to-Noise Ratio (PSNR) and Structural Similarity Index (SSIM), particularly on the SSSD dataset where PSNR increased by 6.8%. Qualitative analysis confirms that HSD-Sonar produces sharper boundaries and more realistic internal textures compared to blurry GAN-based outputs.

Conclusion and Future Work

HSD-Sonar provides a robust solution for generating high-fidelity sonar images by leveraging hierarchical segmentation guidance. While the model shows superior performance, limitations remain regarding its sensitivity to mask accuracy and the quality of training data. Future research will explore the integration of temporal data and material properties to further enhance the physical accuracy of synthetic sonar imagery.

The code for HSD-Sonar is available at https://github.com/mzh529/HSD-Sonar.

Summary updated

BibTeX
@inproceedings{ma2025hierarchical,
  author = {Zhihao Ma and Weiliang Meng and C. J. Tang and L. W. Jiang},
  title = {{Hierarchical Segmentation-guided Diffusion Framework for High-Fidelity Sonar Image Generation}},
  booktitle = {Research Square},
  year = {2025},
  doi = {10.21203/rs.3.rs-7493621/v1},
}
Figure