NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

A Closer Look at Smoothness in Domain Adversarial Training

Harsh Rangwani, Sumukh K. Aithal, Mayank Mishra, Arihant Jain, Venkatesh Babu Radhakrishnan

TL;DR

Smooth Domain Adversarial Training (SDAT) is a simple yet powerful modification to domain adaptation that stabilizes training by specifically seeking "flat" minima for the classification task. By selectively smoothing the task loss while keeping the adversarial component sharp, SDAT achieves state-of-the-art performance across major benchmarks like DomainNet and VisDA-2017, particularly when paired with Vision Transformers.

What Problem Does This Paper Address?

In the world of machine learning, we often face the "domain shift" problem: a model trained on clean studio photos (Source) might fail miserably when deployed on hand-drawn sketches or low-light CCTV footage (Target). Domain Adversarial Training (DAT) is the standard tool for fixing this. It uses a "min-max" game where a feature extractor tries to fool a discriminator into thinking source and target features are identical.

However, DAT is notoriously finicky and unstable. While recent research in supervised learning shows that models converging to "smooth" or "flat" minima (where the loss doesn't change much if you slightly wiggle the weights) generalize better, applying this concept to DAT isn't straightforward. Naively smoothing everything—a technique called Sharpness Aware Minimization (SAM)—actually fails to improve domain adaptation. This paper investigates why that happens and how to fix it.

Methods

The authors introduce SDAT, a procedure that applies selective smoothing. Their key innovation is recognizing that in a min-max objective, not all losses should be treated the same:

  1. Task Loss Smoothing: They apply a SAM-like objective to the classification loss on the source data. This forces the model toward a region of the weight space where the classifier is robust to small perturbations.
  2. Adversarial Sharpness: Crucially, they do not smooth the adversarial loss.

Standard DAT can be seen in the architecture overview below:

Overview of the SDAT architecture. It shows how the model seeks smooth minima for the task loss to improve generalization while maintaining a standard adversarial loss.

The authors use the Hessian's maximum eigenvalue ($\lambda_{max}$) as a proxy for sharpness. A high $\lambda_{max}$ means a "sharp" peak in the loss landscape, while a low value indicates a "flat" valley. They found that SDAT consistently maintains a lower $\lambda_{max}$ compared to standard methods, leading to much more stable training curves.

Datasets

The authors evaluated SDAT on several rigorous benchmarks:

  • Office-Home: A medium-scale dataset with 65 classes across four domains (Art, Clipart, Product, Real World).
  • VisDA-2017: A large-scale challenge focusing on the shift from synthetic (3D renders) to real-world images.
  • DomainNet: A massive dataset with 0.6 million images across 345 classes and 6 diverse domains.
  • Object Detection: They also tested on Pascal VOC $\to$ Clipart and Cityscapes $\to$ Foggy Cityscapes to prove the method's versatility beyond simple classification.

Key Insights and Ideas

  • The "Lazy Discriminator" Trap: The most important finding is that smoothing the adversarial loss is counterproductive. If you force the discriminator to be "smooth," it becomes less effective at distinguishing between domains. This leads to poor feature alignment and, ultimately, worse performance on the target domain.
  • Why SGD beats Adam in DAT: The paper provides a theoretical and empirical explanation for a common community "trick": using SGD instead of Adam for domain adaptation. Empirical evidence shows SGD naturally converges to smoother minima (lower $\lambda_{max}$) than Adam, which tends to get stuck in sharp, poorly generalizing optima.
Eigen Spectral Density plot showing that SDAT reaches a smooth loss surface with low maximum eigenvalues, correlating with better target accuracy.
  • Stability is King: By smoothing the task loss, the entire adversarial optimization becomes more stable. This allows the model to maintain high accuracy even late in the training process, whereas standard DAT often suffers from performance drops as the loss landscape becomes jagged.

Key Results

SDAT provides a significant "free" boost to existing algorithms:

  • State-of-the-Art: When combined with the CDAN+MCC baseline, SDAT achieved SOTA results on Office-Home and VisDA-2017.
  • Vision Transformer (ViT) Boost: ViTs are known to converge to sharp minima. SDAT helps them tremendously, yielding a 3.1% average gain on Office-Home compared to the baseline.
  • Robustness to Noise: SDAT-trained models are significantly more robust to label noise in the source data compared to standard SGD-trained models.
  • Object Detection: On the Cityscapes to Foggy Cityscapes task, SDAT improved the mean Average Precision (mAP) by 2.8% over the standard DA-Faster R-CNN baseline.

Limitations and Future Work

  • Hyperparameter Tuning: The method introduces a hyperparameter $\rho$ (the neighborhood size for smoothing). While the authors found $\rho=0.02$ to be a good "rule of thumb," the optimal value still varies between datasets. An automatic way to tune this would be a valuable next step.
  • Computational Overhead: Like all SAM-based methods, SDAT requires an additional gradient computation step (one extra forward/backward pass), which increases training time per epoch.
  • Theoretical Bounds: While the authors provide a new generalization bound for SDAT, further theoretical work could explore the explicit coupling between task-loss smoothness and the stability of the min-max game in GAN-like settings.

Summary updated

BibTeX
@inproceedings{rangwani2022closer,
  author = {Harsh Rangwani and Sumukh K. Aithal and Mayank Mishra and Arihant Jain and Venkatesh Babu Radhakrishnan},
  title = {{A Closer Look at Smoothness in Domain Adversarial Training}},
  booktitle = {International Conference on Machine Learning},
  year = {2022},
  url = {https://openreview.net/forum?id=-9MzwKcCwmY},
}
Figure