Class-Conditional Domain Adaptation on Semantic Segmentation

Yue Wang, Yuke Li, James H. Elder, Runmin Wu, Huchuan LuarXiv 2019

TL;DR

This paper introduces Class-Conditional Domain Adaptation (CCDA), a novel method for semantic segmentation that addresses the common issue of poor performance on less frequent classes. By incorporating class-specific information into both the discriminator and the loss functions, CCDA effectively equalizes performance across all classes, leading to improved overall accuracy and robustness.

What Problem Does This Paper Address?

Semantic segmentation, a crucial task for understanding images at a pixel level, often suffers from a significant challenge: the need for extensive, pixel-annotated training data. Acquiring this data is costly and time-consuming. Unsupervised Domain Adaptation (UDA) offers a solution by allowing models trained on labeled "source" domains (like synthetic data) to generalize to unlabeled "target" domains (like real-world images). However, existing UDA methods for semantic segmentation often struggle with imbalanced class frequencies. They tend to perform well on dominant classes but poorly on rare ones, as the adaptation process inadvertently favors the more frequent classes. This paper aims to bridge this gap by developing an adaptation method that treats all classes more equitably.

Methods

The core of the proposed Class-Conditional Domain Adaptation (CCDA) method lies in its novel class-conditional multi-scale discriminator and class-conditional loss functions.

  • Basic Architecture: The foundation is a standard UDA setup involving a feature encoder (E), a segmentation decoder (S), and a discriminator (D). The encoder and decoder are trained to produce accurate segmentation masks for the source domain, while the discriminator tries to distinguish between source and target domain features.
  • Class-Conditional Multi-Scale Discriminator: This is the key innovation. Instead of a single discriminator that treats all features equally, CCDA employs:
  • Fine-Scale Branch: Operates at the pixel level, similar to standard methods, to capture detailed domain shifts.
  • Coarse-Scale Branch: Operates on larger image patches. Crucially, it uses coarse-scale class labels (indicating the presence or absence of a class within a patch, not just pixel counts) derived from either ground truth (source) or predicted segmentation (target). This branch outputs class-specific domain estimates, allowing for class-aware alignment.
  • Class-Conditional Loss Functions:
    • Segmentation Loss: A blend of Dice loss and cross-entropy loss is used to ensure that less frequent classes contribute more equally to the segmentation prediction loss, preventing them from being neglected during training.
  • Discriminator Losses: Both the fine-scale and coarse-scale discriminator branches incorporate class-conditional losses. This ensures that the adaptation process considers each class individually, preventing the bias towards frequent classes. The coarse-scale branch, in particular, uses a novel formulation that leverages class-specific patch labels to guide domain alignment.

Datasets

The paper evaluates its method on two adaptation tasks:

  • GTA5 → Cityscapes:
    • Source: GTA5 (synthetic, 24,966 images, pixel-level ground truth)
    • Target: Cityscapes (real-world, 2,975 training images, 500 validation images)
  • SYNTHIA → Cityscapes:
    • Source: SYNTHIA (synthetic, 9,400 images, pixel-level ground truth)
    • Target: Cityscapes (real-world, same as above)

The Cityscapes dataset is used for evaluation, with adaptation performed for 19 classes in the GTA5 task and 13/16 classes in the SYNTHIA task.

Key Insights and Ideas

  • Class Imbalance is a Major UDA Hurdle: The paper clearly articulates that standard UDA methods, while effective for dominant classes, fail to adequately adapt for rare classes, significantly limiting their real-world applicability.
  • Class-Conditioning is Key to Equitable Adaptation: By explicitly incorporating class information into the discriminator and loss functions, the model can learn to align representations in a way that benefits all classes, not just the most frequent ones.
  • Multi-Scale Approach Captures Different Domain Shifts: Using both fine-scale (pixel-level) and coarse-scale (patch-level) discriminators allows the model to capture domain shifts at various granularities, leading to more comprehensive adaptation.
  • Patch-Level Class Labels for Target Domains: The ingenious use of predicted pixel-level segmentation to derive coarse-scale patch labels for target domains is a clever way to inject class information without ground truth.
  • Dice Loss for Balanced Segmentation: Combining Dice loss with cross-entropy for the segmentation task is a practical way to give more weight to under-represented classes during training.

Key Results

The proposed CCDA method demonstrates strong performance on the evaluated adaptation tasks:

  • GTA5 → Cityscapes: CCDA achieves comparable or superior performance to state-of-the-art methods, particularly showing significant improvements for lower-frequency classes. The mean IoU is reported as 37.7% for the full CCDA model.
  • SYNTHIA → Cityscapes: CCDA also performs favorably against other algorithms, achieving a mean IoU of 40.6% for the full model.
  • Ablation Studies: The study confirms the effectiveness of each component:
  • The basic architecture with class-conditional segmentation and fine-scale discriminator yields a 2.1% improvement.
  • Adding the class-conditional coarse-scale discriminator further boosts performance by an additional 0.7%.
  • Qualitative Results: Visual examples show that CCDA produces cleaner and more accurate predictions, especially for less frequent classes like "light" and "sign," compared to baseline methods.

Limitations and Future Work

  • Computational Cost: While not explicitly detailed as a limitation, the introduction of multi-scale discriminators and class-conditional losses likely increases computational complexity compared to simpler UDA methods.
  • Hyperparameter Tuning: The effectiveness of the method relies on careful tuning of hyperparameters (e.g., weights for different loss terms, confidence thresholds).
  • Future Work: The paper implicitly suggests that further exploration of class-conditional adaptation techniques could lead to even greater improvements. The success on these specific datasets also opens avenues for testing CCDA on a wider range of domain shift scenarios and segmentation tasks.

Summary updated

BibTeX
@misc{wang2019class,
  author = {Yue Wang and Yuke Li and James H. Elder and Runmin Wu and Huchuan Lu},
  title = {{Class-Conditional Domain Adaptation on Semantic Segmentation}},
  year = {2019},
  eprint = {1911.11981},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1911.11981},
}
Figure