Consistency Regularization for Domain Adaptation

Kian Boon Koh, Basura Fernando

Introduction

Semantic segmentation—the task of assigning a semantic label to every pixel in an image—is a cornerstone of computer vision, particularly for autonomous driving. However, the manual annotation required to train these models is prohibitively expensive. To mitigate this, researchers often utilize synthetic data from photorealistic video games like Grand Theft Auto V (GTA5), where labels are generated automatically.

The primary challenge lies in the "domain shift": models trained on synthetic textures and lighting often struggle when deployed in the real world. Unsupervised Domain Adaptation (UDA) aims to bridge this gap by adapting models to unlabeled real-world data. This paper proposes a novel consistency regularization method to improve the robustness of this adaptation process.

The Challenge of Self-Training

Modern UDA frameworks, such as the Transformer-based DAFormer, typically employ a "Mean Teacher" approach. In this setup, a "Student" network learns from pseudo-labels generated by a "Teacher" network (a moving average of the Student’s weights).

A significant risk in self-training is the propagation of errors. If the Teacher incorrectly labels a section of the sidewalk as "road," the Student will treat that error as ground truth, leading to a feedback loop of incorrect classifications. Current methods often struggle to maintain the structural integrity of a scene when individual pixel labels are noisy.

Proposed Method: Inter-Pixel Consistency

The authors introduce a Consistency Regularization term ($L_C$) that shifts the focus from individual pixel labels to the relationships between pixels. The core idea is that even if a model is uncertain about a specific label, the underlying relationship between neighboring or related pixels should remain consistent across the Student and Teacher networks.

1. Similarity Matrix and Structural Alignment

The method calculates a similarity matrix based on the predictions of the networks. By using metrics like KL Divergence or Cosine Similarity, the model evaluates how similar the prediction for one pixel is to another within the same image. The Student is then penalized if its "similarity structure" deviates from the Teacher’s. For example, if the Teacher identifies two pixels as being part of the same object, the Student is encouraged to maintain that same relational bond.

2. Efficient Sparse Sampling

Computing a full similarity matrix for high-resolution images is computationally expensive. To solve this, the authors implemented a sparse sampling strategy. They found that randomly sampling a very small number of pixel pairs ($N_{pair}$) per iteration is sufficient. Because the model trains over tens of thousands of iterations, these sparse snapshots eventually cover a significant portion of the image—approximately 46% over 40,000 iterations—keeping the computational overhead low while maintaining high performance.

Experimental Results

The proposed method was evaluated on standard UDA benchmarks, transitioning from synthetic sources to the real-world Cityscapes dataset:

  • GTA5 to Cityscapes: The model achieved a mean Intersection over Union (mIoU) of 68.2, marking a 0.8-point improvement over the DAFormer baseline.
  • SYNTHIA to Cityscapes: The model reached an mIoU of 61.6, a 1.2-point improvement.

Beyond numerical gains, the model showed qualitative improvements in challenging areas. Specifically, it became much more adept at distinguishing between "Road" and "Sidewalk," two classes that are frequently confused in UDA due to their similar textures and spatial proximity.

Key Insights

  • Contextual Robustness: By regularizing the relationships between pixels rather than just the labels themselves, the model becomes less sensitive to the noise inherent in pseudo-labels.
  • Sampling Efficiency: One of the most notable findings was that sampling as few as 4 pixels per image yielded results comparable to sampling 1,024 pixels, proving that global consistency can be learned through sparse, iterative observations.
  • Metric Selection: While Cosine Similarity is a standard choice for vector comparison, the authors found that KL Divergence provided a more effective signal for aligning the probability distributions of the two networks.

Conclusion

This research demonstrates that enforcing structural consistency is a powerful tool for Unsupervised Domain Adaptation. By ensuring that the Student network respects the inter-pixel relationships established by the Teacher, the model develops a more coherent understanding of real-world scenes. Future work may explore "informed sampling" strategies to focus on complex areas like object boundaries, potentially further refining the accuracy of synthetic-to-real world model transfers.

Summary updated

BibTeX
@inproceedings{koh2022consistency,
  author = {Kian Boon Koh and Basura Fernando},
  title = {{Consistency Regularization for Domain Adaptation}},
  booktitle = {Workshops @ ECCV},
  year = {2022},
  doi = {10.1007/978-3-031-25085-9\_20},
}
Figure