Achieving Domain Generalization in Underwater Object Detection by Image Stylization and Domain Mixup

Pinhao Song, Linhui Dai, Peipei Yuan, Hong Liu, Runwei Ding

TL;DR

This paper tackles the challenge of underwater object detection failing when faced with domain shifts (e.g., varying water clarity, lighting). They introduce a novel framework, DMCL, that uses style transfer to create more diverse training data and a feature-level mixup with contrastive learning to force the model to learn domain-invariant features, significantly improving generalization.

What Problem Does This Paper Address?

Underwater object detection systems often struggle when deployed in environments different from their training data. This "domain shift" is particularly problematic underwater due to factors like changing water turbidity, lighting conditions, and diverse aquatic environments. Existing datasets often lack sufficient diversity, leading detectors to "memorize" specific training domains rather than learning generalizable features. This severely limits their real-world applicability. The authors aim to improve the domain generalization capabilities of underwater object detectors, enabling them to perform reliably across a wider range of underwater conditions.

Methods

The core of the proposed solution, DMCL (Domain Mixup and Contrastive Learning), is built upon two key ideas:

  • Domain Mixup (DMX):
    • Conditional Bilateral Style Transfer (CBST): To increase domain diversity, they propose CBST, a style transfer model that transforms underwater images from one domain to another. Unlike previous methods that generate entire new images, CBST focuses on learning a linear color transformation matrix, which is more aligned with how underwater images are formed. This helps create more realistic and diverse training data.
  • Feature-Level Interpolation: After generating paired images (original and stylized), DMX interpolates their latent features within the backbone network. The intuition is that while semantic content remains the same, domain-specific features can be mixed. This is done across multiple layers to sample new domains on a "domain manifold," effectively expanding the training data's diversity in a more robust way than image-level mixup.
  • Contrastive Learning (Spatial Selective Marginal Contrastive Loss - SSMC): To ensure the learned features are truly domain-invariant and discriminative, they employ a contrastive loss. SSMC selectively penalizes domain-specific features while allowing for some variance. This encourages features from different domains but with the same semantic content to be similar, while still retaining the ability to distinguish between different objects.

Datasets

  • S-UODAC2020: A newly introduced dataset specifically for underwater object detection domain generalization. It's generated from the UODAC2020 dataset and split into 7 domains (type1-type7). The authors train on types 1-6 and test on type7, highlighting a significant domain shift.
  • PACS and VLCS: Standard domain generalization benchmarks for image classification, used to further demonstrate the method's effectiveness on broader domain generalization tasks.

Key Insights and Ideas

  • Underwater Image Formation as Linear Transformation: The paper leverages the insight that underwater images can be modeled as linear transformations of clear latent images. This justifies the use of style transfer for domain augmentation.
  • Feature-Level Mixup is More Effective: Interpolating features within the network (Domain Mixup) is shown to be more effective than interpolating images directly. This is because the feature space is often "flatter" and more amenable to linear interpolation for generating new, diverse domains.
  • Balancing Invariance and Discriminability: The SSMC loss is crucial for striking a balance. Simply forcing features to be identical across domains can harm discriminative power. SSMC allows for controlled variance, ensuring the model can still distinguish objects while being robust to domain shifts.
  • Importance of Domain Diversity: The experiments strongly suggest that increasing the diversity of training domains is key to achieving good generalization, and their proposed methods effectively achieve this.

Key Results

  • State-of-the-Art Performance: DMCL achieves state-of-the-art performance on the proposed S-UODAC2020 dataset, outperforming existing domain generalization methods by a significant margin. For example, with a Faster R-CNN backbone, DMCL achieves 61.36% mAP, compared to 53.87% for DANN.
  • Robustness to Fewer Domains: The method remains competitive even when trained on fewer source domains, demonstrating its robustness.
  • Efficient Style Transfer: CBST provides a faster and more effective style transfer compared to some existing methods, while better preserving semantic content.
  • Improved Feature Representation: t-SNE visualizations and feature statistics analysis confirm that DMCL learns more domain-invariant features, with smaller standard deviations across domains.
  • Qualitative Improvements: Visual comparisons show DMCL detecting more objects with higher precision and fewer missed ground truths in challenging cross-domain scenarios.

Limitations and Future Work

  • Weakness on Small Objects: The paper acknowledges that DMCL struggles with detecting small objects. The authors hypothesize that DMX might dilute the features of small objects with background noise, making them less salient.
  • Reliance on Domain Diversity: The effectiveness of DMCL, particularly the DMX component, relies on the diversity of the source domains. When domain diversity is limited (as seen in the VLCS dataset experiments), the performance improvement is less pronounced.
  • Future Work: The authors suggest that future work could explore methods to better handle small objects and investigate how to further enhance domain diversity when source domains are limited. They also propose their method could be applied to other challenging domains like autonomous driving in adverse weather and re-identification in varying light conditions.

Summary updated

Abstract

The performance of existing underwater object detection methods degrades seriously when facing domain shift caused by complicated underwater environments. Due to the limitation of the number of domains in the dataset, deep detectors easily memorize a few seen domains, which leads to low generalization ability. There are two common ideas to improve the domain generalization performance. First, it can be inferred that the detector trained on as many domains as possible is domain-invariant. Second, for the images with the same semantic content in different domains, their hidden features should be equivalent. This paper further excavates these two ideas and proposes a domain generalization framework (named DMC) that learns how to generalize across domains from Domain Mixup and Contrastive Learning. First, based on the formation of underwater images, an image in an underwater environment is the linear transformation of another underwater environment. Thus, a style transfer model, which outputs a linear transformation matrix instead of the whole image, is proposed to transform images from one source domain to another, enriching the domain diversity of the training data. Second, mixup operation interpolates different domains on the feature level, sampling new domains on the domain manifold. Third, contrastive loss is selectively applied to features from different domains to force the model to learn domain invariant features but retain the discriminative capacity. With our method, detectors will be robust to domain shift. Also, a domain generalization benchmark S-UODAC2020 for detection is set up to measure the performance of our method. Comprehensive experiments on S-UODAC2020 and two object recognition benchmarks (PACS and VLCS) demonstrate that the proposed method is able to learn domain-invariant representations, and outperforms other domain generalization methods.
BibTeX
@article{song2023achieving,
  author = {Pinhao Song and Linhui Dai and Peipei Yuan and Hong Liu and Runwei Ding},
  title = {{Achieving Domain Generalization in Underwater Object Detection by Image Stylization and Domain Mixup}},
  journal = {Neurocomputing},
  year = {2023},
  doi = {10.1016/j.neucom.2023.01.053},
}
Figure