Introduction
Unsupervised Domain Adaptation (UDA) is a critical task in computer vision, aiming to transfer knowledge from a labeled source domain (often synthetic data like GTA5) to an unlabeled target domain (real-world data like Cityscapes). While self-training—where a teacher model generates pseudo-labels to guide a student model—has become the standard approach, it is plagued by a persistent "class bias" problem. Models naturally gravitate toward "head" classes (e.g., roads, buildings) while neglecting "tail" or "hard-to-transfer" classes (e.g., bicycles, traffic signs).
This paper introduces Balanced Learning for Domain Adaptation (BLDA), a framework designed to mitigate this bias by directly aligning the distributions of predicted logits, ensuring that the model learns rare and difficult classes as effectively as common ones.
The Problem: Beyond Simple Imbalance
In UDA, class bias is not merely a result of pixel-count imbalance. It is exacerbated by the domain shift itself; some classes are inherently harder to adapt across domains than others. Standard techniques like re-weighting or re-sampling often fail in UDA because they require prior knowledge of the target domain's class distribution—information that is typically unavailable.
Existing self-training methods often create a feedback loop where the model becomes increasingly confident in its over-predictions of common classes, further suppressing the performance on rare classes. BLDA addresses this by shifting the focus from pixel counts to the internal behavior of the model's logits (the raw scores before the final softmax layer).
The BLDA Framework
1. Logit Distribution Analysis
The authors observed a direct correlation between logit values and prediction bias. Over-predicted classes consistently exhibit higher logit values, while under-predicted ones exhibit lower values. This suggests that the model's internal confidence scores are the "smoking gun" of class bias.
2. Online Logit Adjustment (OLA)
To correct this bias during training, BLDA employs Gaussian Mixture Models (GMMs) to estimate the logit distributions for every class in real-time. By modeling these distributions online, the framework can apply a dynamic correction term to the loss function. This acts as an adaptive margin, penalizing the model more heavily for misclassifying under-predicted classes and forcing the decision boundaries to become more balanced.
3. Post-hoc Alignment and CDE
Beyond online adjustment, the framework introduces a post-hoc alignment strategy. It calculates "anchor distributions" (global averages of positive and negative logits) and uses Cumulative Distribution Function (CDF) mapping to align every class's logit distribution to these anchors.
From this, the authors derive Cumulative Density Estimation (CDE). They treat the resulting cumulative density as a measure of "discrimination difficulty." Because this difficulty is based on the context of the pixel rather than its visual style, it serves as a domain-invariant bridge. An auxiliary regression head is added to the network to predict this difficulty value, helping the model learn features that are robust across both source and target domains.
Experimental Evaluation
BLDA was evaluated on several rigorous UDA benchmarks, including GTA5 → Cityscapes and SYNTHIA → Cityscapes, as well as video segmentation tasks (VIPER → Cityscapes-Seq).
Key Results:
- Performance Gains: On the GTA5 → Cityscapes benchmark, BLDA improved existing state-of-the-art methods (such as DAFormer and HRDA) by 1.2% to 3.1% mIoU.
- Balanced Accuracy: The improvements in mean Accuracy (mAcc) were even more significant, reaching up to 5.6%. This confirms that the model became substantially better at recognizing difficult "tail" classes like poles and traffic lights.
- Stability: The standard deviation of IoU across classes decreased, indicating a more stable and equitable learning process across the entire dataset.
- Computational Efficiency: Despite the use of GMMs, the implementation uses parallel tensor operations, adding only a negligible overhead (~0.3s per iteration) to the training time.
Conclusion
BLDA represents a shift in how we approach balance in domain adaptation. By moving away from heuristic re-sampling and focusing on the alignment of logit distributions, it provides a more direct and effective way to handle class bias. The insight that "difficulty" can serve as a domain-invariant structural property allows the model to bridge the gap between synthetic and real-world data more effectively. As a plug-and-play strategy, BLDA can be integrated into various existing UDA frameworks to provide immediate boosts in both accuracy and class-level fairness.
Summary updated