Self-Supervised Domain Adaptation for Computer Vision Tasks

Jiaolong Xu, Liang Xiao, Antonio M. López

Abstract

Deep learning models often struggle with domain shift, where performance degrades when moving from a labeled source domain to an unlabeled target domain. This paper explores a multi-task learning framework that leverages self-supervised "pretext" tasks—specifically image rotation prediction—to bridge this gap. By jointly training on a primary task using source data and a pretext task using target data, the model learns domain-invariant features. Experimental results on object recognition and semantic segmentation benchmarks demonstrate that this approach is competitive with complex adversarial methods while remaining significantly simpler to implement and stabilize.

Introduction

The "brittleness" of deep neural networks is a major hurdle in deploying computer vision systems. A model trained on synthetic data, such as images from video games, frequently fails when applied to real-world street scenes due to differences in lighting, texture, and perspective. While Unsupervised Domain Adaptation (UDA) seeks to mitigate this without requiring target-domain labels, many current solutions rely on complex adversarial training (GANs) that are notoriously difficult to tune.

This research investigates whether self-supervised learning (SSL) can serve as a robust alternative. The authors propose using pretext tasks—tasks where labels are automatically generated from the data itself—to force the network to learn the underlying semantic structure of the target domain, thereby aligning it with the source domain.

Methodology

The proposed framework utilizes a multi-task learning architecture consisting of a shared feature extractor (encoder) and two distinct heads. The Main Task Head is trained using labeled data from the source domain to perform the primary objective, such as classification or segmentation. Simultaneously, the Pretext Task Head is trained using unlabeled data from the target domain.

The multi-task framework for self-supervised domain adaptation, showing the shared feature extractor and dual task heads.

Self-Supervised Pretext Tasks

The primary pretext task employed is Image Rotation Prediction (Rot). Target images are randomly rotated by 0°, 90°, 180°, or 270°, and the model must predict the specific angle. To succeed, the encoder must learn to recognize the canonical orientation of objects, effectively capturing their semantic structure. The authors also tested a Spatial-aware Rotation (SPRot) variant, where images are divided into quadrants and rotated independently, though this proved less effective due to excessive task complexity.

Additional Refinements

Beyond the pretext task, the authors incorporate two complementary techniques:

  1. Batch Normalization (BN) Calibration: A post-training step where target images are passed through the network solely to update the mean and variance statistics in the BN layers, reducing internal covariate shift.
  2. Prediction Layer Alignment (Adv): An optional adversarial component where a discriminator ensures that the final output distributions are similar across both domains.

Experimental Results

The method was evaluated on standard benchmarks including the Office and PACS datasets for object recognition, and GTA5/SYNTHIA to Cityscapes for semantic segmentation.

Performance Gains

On the Office dataset, the rotation-based adaptation achieved an average accuracy of 84.5%, a substantial improvement over the 76.1% source-only baseline. In semantic segmentation, the rotation task boosted the mean Intersection over Union (mIoU) from 35.0 to 41.2 on the GTA5-to-Cityscapes transition. When combined with BN calibration and adversarial alignment, the performance reached 43.3 mIoU, surpassing established methods like AdaptSegNet.

Visualizing Domain Invariance

The effectiveness of the rotation task in aligning domains is clearly visible in t-SNE visualizations of the feature space. As shown below, the self-supervised task helps the model cluster classes more effectively and reduces the separation between source and target domain features.

t-SNE visualizations comparing standard ResNet-50 features with those learned using the rotation pretext task (Rot). Panels (c) and (d) specifically highlight the improved alignment between source (red) and target (blue) domains.

Discussion and Conclusion

A key insight from this work is that the difficulty of the pretext task must be carefully balanced. While simple rotation prediction provides a strong signal for domain invariance, overly complex tasks like SPRot can hinder convergence. Furthermore, the "free" performance gain from Batch Normalization calibration highlights the importance of addressing low-level statistical shifts alongside high-level semantic alignment.

While a gap remains between these adapted models and those trained on fully labeled target data, this research demonstrates that self-supervision is a powerful, stable, and computationally efficient tool for bridging the domain gap in computer vision.

Summary updated

BibTeX
@article{xu2019self,
  author = {Jiaolong Xu and Liang Xiao and Antonio M. López},
  title = {{Self-Supervised Domain Adaptation for Computer Vision Tasks}},
  journal = {IEEE Access},
  year = {2019},
  doi = {10.1109/access.2019.2949697},
}
Figure