Abstract
As acquiring pixel-wise annotations of real-world images for semantic segmentation is a costly process, a model can instead be trained with more accessible synthetic data and adapted to real images without requiring their annotations. This process is studied in unsupervised domain adaptation (UDA). Even though a large number of methods propose new adaptation strategies, they are mostly based on outdated network architectures. As the influence of recent network architectures has not been systematically studied, we first benchmark different network architectures for UDA and newly reveal the potential of Transformers for UDA semantic segmentation. Based on the findings, we propose a novel UDA method, DAFormer. The network architecture of DAFormer consists of a Transformer encoder and a multi-level context-aware feature fusion decoder. It is enabled by three simple but crucial training strategies to stabilize the training and to avoid overfitting to the source domain: While (1) Rare Class Sampling on the source domain improves the quality of the pseudo-labels by mitigating the confirmation bias of self-training toward common classes, (2) a Thing-Class ImageNet Feature Distance and (3) a learning rate warmup promote feature transfer from ImageNet pretraining. DAFormer represents a major advance in UDA. It improves the state of the art by 10.8 mIoU for GTA→Cityscapes and 5.4 mIoU for Synthia→Cityscapes and enables learning even difficult classes such as train, bus, and truck well.
Introduction
Unsupervised Domain Adaptation (UDA) is a critical field in computer vision, aiming to bridge the gap between synthetic training data (e.g., GTA5) and real-world application domains (e.g., Cityscapes). Despite rapid algorithmic progress, the field has largely relied on aging architectures like DeepLabV2 with ResNet-101 backbones. This research identifies an "architecture gap" and explores whether modern Transformer-based designs can inherently handle domain shifts better than traditional CNNs. Transformers, which tend to focus more on object shape than local texture, may be naturally suited for UDA since synthetic data often features textures that do not perfectly match reality.
The DAFormer Framework
The proposed DAFormer framework introduces a specialized architecture paired with three training stabilizers designed to mitigate overfitting to synthetic source data and promote robust feature transfer.
Architecture
DAFormer utilizes a hierarchical Mix Transformer (MiT-B5) encoder. This backbone provides a larger receptive field and more robust features than standard CNNs. The decoder is a multi-level context-aware feature fusion block. Unlike standard decoders that only look at the bottleneck, DAFormer fuses features from multiple encoder levels and employs parallel depthwise separable convolutions with varying dilation rates to capture a broad multi-scale context, helping resolve ambiguities in complex scenes (e.g., distinguishing a bus from a truck).
Training Strategies
To stabilize the training of these powerful models and prevent the "self-training trap"—where a model's bias toward common classes creates a feedback loop of error—three strategies are employed:
- Rare Class Sampling (RCS): To counter the dominance of common classes (like "road") in synthetic data, RCS identifies rare classes and samples images containing them more frequently. This prevents the model from developing a permanent bias toward common classes early in training.
- Thing-Class ImageNet Feature Distance (FD): This strategy uses knowledge distillation to keep the model's features close to ImageNet-pretrained features for "thing" classes (objects with distinct shapes). This prevents the model from overfitting to the specific visual style of synthetic data.
- Learning Rate Warmup: A simple but crucial addition that stabilizes the initial training phase, protecting pre-trained weights from noisy early gradients.
Experimental Results
DAFormer was evaluated on the GTA5 → Cityscapes and Synthia → Cityscapes benchmarks, demonstrating a significant performance leap over previous state-of-the-art methods like ProDA.
On the GTA5 → Cityscapes benchmark, DAFormer achieved 68.3 mIoU, representing a staggering 10.8-point increase over previous records. Similar gains were seen on Synthia → Cityscapes (+5.4 mIoU). Notably, the model excelled at difficult, rare classes; for instance, on GTA → Cityscapes, the IoU for "Train" jumped from 16.0 to 65.1, and "Truck" jumped from 45.5 to 74.5.
Beyond accuracy, DAFormer is remarkably efficient, requiring only 16 hours of training on a single consumer-grade RTX 2080 Ti GPU. This accessibility contrasts with previous multi-stage methods that required significantly more compute.
Conclusion
DAFormer demonstrates that modernizing network architectures is as vital as developing new adaptation algorithms in UDA. By leveraging the shape-bias of Transformers and implementing targeted training strategies like Rare Class Sampling and Feature Distance, DAFormer significantly closes the domain gap, providing a robust and efficient path for adapting synthetic data to real-world semantic segmentation tasks.
Summary updated