Abstract
Domain adversarial training has been ubiquitous for achieving invariant representations and is used widely for various domain adaptation tasks. In recent times, methods converging to smooth optima have shown improved generalization for supervised learning tasks like classification. In this work, we analyze the effect of smoothness enhancing formulations on domain adversarial training, the objective of which is a combination of task loss (eg. classification, regression, etc.) and adversarial terms. We find that converging to a smooth minima with respect to (w.r.t.) task loss stabilizes the adversarial training leading to better performance on target domain. In contrast to task loss, our analysis shows that converging to smooth minima w.r.t. adversarial loss leads to sub-optimal generalization on the target domain. Based on the analysis, we introduce the Smooth Domain Adversarial Training (SDAT) procedure, which effectively enhances the performance of existing domain adversarial methods for both classification and object detection tasks. Our analysis also provides insight into the extensive usage of SGD over Adam in the community for domain adversarial training.
Introduction
In machine learning, "domain shift" remains a significant hurdle: a model trained on clean studio photos (the source domain) often fails when deployed on grainy CCTV footage (the target domain). Unsupervised Domain Adaptation (UDA) seeks to bridge this gap by leveraging labeled source data and unlabeled target data.
The standard approach, Domain Adversarial Training (DAT), treats the problem as a game where a feature extractor attempts to fool a discriminator. If the discriminator cannot distinguish between domains, the features are considered domain-invariant. Despite its popularity, DAT is notoriously unstable and sensitive to optimization choices. This paper investigates whether the concept of "smoothness"—seeking flat minima in the loss landscape—can stabilize this adversarial process and improve generalization.
The SDAT Methodology: Selective Smoothing
The authors propose Smooth Domain Adversarial Training (SDAT), built upon the Sharpness-Aware Minimization (SAM) framework. SAM explicitly seeks parameters in low-curvature regions of the loss landscape, which has been shown to improve generalization in standard supervised learning.
The core innovation of SDAT is the principle of selective smoothing. The researchers discovered that the min-max nature of DAT requires a nuanced application of smoothness:
- Smoothing the Task Loss: Applying SAM to the source classification loss pushes the model toward a flat optimum for the primary task. This improves the robustness of the features being learned.
- Maintaining Adversarial Sharpness: Crucially, the authors found that smoothing the adversarial (discriminator) loss is detrimental. A "smooth" discriminator becomes less precise, leading to poor estimates of domain discrepancy and failing to drive the feature extractor toward true invariance.
By analyzing the Hessian matrix—specifically the maximum eigenvalue ($\lambda_{max}$)—the authors demonstrate that SDAT maintains lower curvature throughout the training process compared to standard DAT, providing a theoretical basis for its increased stability.
Key Insights
The SGD vs. Adam Debate
A long-standing observation in the domain adaptation community is that Stochastic Gradient Descent (SGD) typically outperforms Adam. This paper provides a compelling explanation: SGD naturally converges to smoother minima than Adam. By explicitly enforcing smoothness through SDAT, the performance gap between these optimizers can be bridged, though SGD remains a strong default for these tasks.
Synergy with Vision Transformers (ViTs)
Vision Transformers are known to reach sharper minima than traditional ResNets, which often limits their performance in adversarial settings. SDAT provides a significant boost to ViT-based models (up to 3.1% on average), suggesting that smoothness is a critical missing ingredient for deploying Transformers in domain adaptation.
Experimental Results
SDAT was evaluated across several rigorous benchmarks, consistently achieving state-of-the-art (SOTA) results:
- Office-Home: Using a ViT backbone, SDAT reached a SOTA accuracy of 84.3%.
- VisDA-2017: On this large-scale synthetic-to-real dataset, SDAT achieved 89.8% accuracy, outperforming more complex and computationally expensive methods.
- DomainNet: In one of the most difficult UDA benchmarks, SDAT showed consistent gains across 20 different domain-pair shifts.
- Object Detection: Beyond classification, SDAT improved mean Average Precision (mAP) by 2.8% on the Pascal-to-Clipart shift using a DA-Faster R-CNN baseline.
Conclusion and Future Work
SDAT demonstrates that while smoothness is beneficial for the task-specific components of domain adaptation, the adversarial components require sharpness to remain effective. This selective approach eliminates the common "late-training collapse" seen in standard DAT and provides a more stable path to generalization.
Future research may focus on automating the selection of the neighborhood size hyperparameter ($\rho$), which currently requires manual tuning per dataset. Additionally, exploring the interaction between smoothness constraints and source-free or test-time adaptation presents a promising avenue for further improving model robustness.
Summary updated