AquaSAM: Underwater Image Foreground Segmentation

Muduo Xu, Jianhao Su, Yutao LiuarXiv 2023

TL;DR

This paper introduces AquaSAM, a fine-tuned version of the powerful Segment Anything Model (SAM) specifically adapted for underwater image segmentation. By fine-tuning SAM on underwater datasets, AquaSAM significantly improves the accuracy and robustness of segmenting various underwater objects, addressing a key limitation of the original SAM.

What Problem Does This Paper Address?

The advent of foundation models like SAM has revolutionized image segmentation, enabling remarkable performance on natural images with minimal user input. However, these models often struggle when applied directly to underwater imagery. The unique challenges of underwater environments, such as low visibility, color distortion, and complex scene geometry, lead to a significant performance drop. This paper aims to bridge this gap by adapting SAM to effectively segment foreground objects in diverse underwater scenarios, which is crucial for applications in marine biology, robotics, and underwater exploration.

Methods

The core of AquaSAM lies in adapting the pre-trained Segment Anything Model (SAM) for underwater image segmentation. The authors identified that while SAM's "segment-everything" mode can be too general and "point-based" modes can be ambiguous for underwater tasks, the "bounding box" mode offers a good balance of specificity and ease of use.

Their approach involves a straightforward fine-tuning strategy:

  • Freezing the Image Encoder: To reduce computational costs, the powerful vision transformer-based image encoder of SAM is kept frozen. This leverages the extensive pre-training of SAM on natural images.
  • Fine-tuning the Mask Decoder: The primary focus of fine-tuning is on the mask decoder. This component is responsible for generating the final segmentation masks based on the image features and prompt embeddings.
  • Bounding Box Prompting: The authors advocate for using bounding box prompts as the preferred input for underwater segmentation with SAM. This allows for precise specification of the region of interest.
  • Data Preprocessing and Classification: The SUIM dataset, containing eight distinct underwater segmentation tasks, is used. The images and their corresponding ground truths are classified and preprocessed to prepare them for training.
  • Loss Function: A combination of Dice loss and cross-entropy loss is employed, a standard practice for segmentation tasks that has shown robustness.
  • Optimizer: The Adam optimizer is used for training.

Datasets

The primary dataset used in this work is the SUIM dataset. This dataset comprises eight different foreground and background segmentation tasks, including:

  • Background (waterbody)
  • Human divers
  • Aquatic plants and sea-grass
  • Wrecks and ruins
  • Robots
  • Reefs and invertebrates
  • Fish and vertebrates
  • Sea-floor and rocks

The paper notes that segmentation targets with fewer than 100 pixels were excluded from the analysis.

Key Insights and Ideas

  • SAM's limitations in underwater domains are significant: Despite SAM's impressive generalization capabilities, its performance degrades considerably in underwater environments due to inherent differences in image characteristics.
  • Bounding box prompts are key for underwater segmentation: The authors found that the bounding box mode in SAM is the most practical for underwater tasks, offering a good balance between specifying the target and achieving reasonable segmentation without excessive user interaction.
  • Fine-tuning the mask decoder is sufficient for adaptation: By freezing the image encoder and focusing on fine-tuning the mask decoder, the authors achieve substantial performance gains without the prohibitive computational cost of retraining the entire SAM model.
  • Underwater segmentation requires specialized adaptation: The results clearly show that a general-purpose model like SAM, even with bounding box prompts, is outperformed by a fine-tuned model like AquaSAM on challenging underwater tasks.

Key Results

AquaSAM demonstrates significant improvements over the pre-trained SAM model across eight underwater segmentation tasks.

  • Average Improvement:
    • Dice Similarity Coefficient (DSC): 7.13% improvement
    • mean Intersection over Union (mIoU): 8.27% improvement
  • Performance on Difficult Tasks: AquaSAM shows particularly strong gains on challenging tasks like "Wrecks and ruins" (24.37% DSC improvement) and "Fish and vertebrates" (32.19% DSC improvement).
  • Qualitative Improvements: Visual examples show AquaSAM producing more accurate and complete segmentations, especially for objects with weak boundaries or in complex scenes where SAM struggled.

Limitations and Future Work

The authors acknowledge several limitations and suggest future directions:

  • Performance relative to specialized models: While AquaSAM significantly outperforms SAM, its performance still falls short of models specifically designed for underwater image segmentation.
  • Aquatic plants segmentation: There is noted potential for further improvement in the segmentation of aquatic plants.
  • Dataset size: The authors believe that leveraging larger models and increasing the size of the underwater dataset would be beneficial. They utilized the smallest image encoder (ViT-base) to manage computational burden and suggest that fine-tuning the image encoder with larger models could further enhance performance.
  • Handling multiple similar instances: When multiple similar instances are present, a large bounding box can sometimes lead to incorrect segmentation results.
  • Future plans: The authors plan to expand their training set and explore larger backbone models to further enhance AquaSAM's performance. They also offer their code and a tutorial for fine-tuning SAM on custom datasets.

Summary updated

Abstract

The Segment Anything Model (SAM) has revolutionized natural image segmentation, nevertheless, its performance on underwater images is still restricted. This work presents AquaSAM, the first attempt to extend the success of SAM on underwater images with the purpose of creating a versatile method for the segmentation of various underwater targets. To achieve this, we begin by classifying and extracting various labels automatically in SUIM dataset. Subsequently, we develop a straightforward fine-tuning method to adapt SAM to general foreground underwater image segmentation. Through extensive experiments involving eight segmentation tasks like human divers, we demonstrate that AquaSAM outperforms the default SAM model especially at hard tasks like coral reefs. AquaSAM achieves an average Dice Similarity Coefficient (DSC) of 7.13 (%) improvement and an average of 8.27 (%) on mIoU improvement in underwater segmentation tasks.
BibTeX
@misc{xu2023aquasam,
  author = {Muduo Xu and Jianhao Su and Yutao Liu},
  title = {{AquaSAM: Underwater Image Foreground Segmentation}},
  year = {2023},
  eprint = {2308.04218},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2308.04218},
}
Figure