SWAT: Sliding Window Adversarial Training for Gradual Domain Adaptation

Zixi Wang, Xiangxu Zhao, Tonglan Xie, Mengmeng Jing, Lin Zuo · Submission to ICLR 2026 · Withdrawn

TL;DR

Standard domain adaptation struggles when the distribution gap between source and target domains is large, while Gradual Domain Adaptation (GDA) often suffers from error accumulation across discrete intermediate stages. To solve this, the authors introduce Sliding Window Adversarial Training (SWAT), a continuous alignment framework that gradually slides a localized adversarial window along the domain sequence. By replacing abrupt multi-stage jumps with micro-transfers, SWAT achieves state-of-the-art results across several GDA and corruption benchmarks.

What Problem Does This Paper Address?

In Unsupervised Domain Adaptation (UDA), directly aligning distant source and target distributions frequently causes negative transfer, mode collapse, or distorted decision boundaries. Gradual Domain Adaptation (GDA) mitigates this by transferring knowledge incrementally across intermediate domains.

However, existing GDA approaches face critical hurdles:

  1. Discrete Stage Jumps: Most methods adapt through discrete, sequential steps (often via self-training/pseudo-labeling), which compounds classification errors quadratically over long chains.
  2. Adversarial Instability: Applying standard adversarial training (like DANN) globally across continuously shifting domains fails to leverage intermediate structure, while large distribution shifts cause steep gradients and manifold unsmoothness.

Methods

SWAT resolves these challenges by converting domain adaptation into a continuous, local manifold transport process:

  • Sliding Window Mechanism: Rather than adapting across the entire sequence at once, SWAT defines a local window over adjacent intermediate domain feature representations $\{H_l, H_r\}$ (where $r = l + 1$). An interpolation parameter $p \in [0, 1]$ smoothly shifts the representation within the window via $H(l+p) = (1 - p)H_l + p H_r$. Once $p$ reaches 1, the window steps to the right ($l \leftarrow l + 1$) and $p$ resets, walking continuously across the whole domain stream.
  • Bidirectional Adversarial Flow: SWAT constructs bidirectional mapping functions ($G_m: H_s \to H_z$ and $G_s: H_z \to H_s$) trained with a Wasserstein GAN (WGAN-GP) objective to match source features to intermediate target distributions without mode collapse.
  • Cycle-Consistent Regularization & Self-Training: A cycle-consistency loss ($H_0 \to H_l \to H_0$) penalizes semantic distortions and preserves class structure. A standard self-training classification loss is combined with adversarial losses into a single overall objective: $$\mathcal{L} = (1 - p)\mathcal{L}^l + p\mathcal{L}^r$$
  • Confidence-Filtered Self-Training: Samples are filtered during pseudo-labeling using a confidence metric based on the margin between the top two prediction logits.
Source Domain (H_0) ───[ Sliding Window: H_l ──(p)──> H_r ]───> Target Domain (H_n)
                                 │
                     Bidirectional WGAN Flow + Cycle-Consistency

Datasets

The authors evaluate SWAT on six benchmarks:

  • Rotated MNIST: 50,000 source images ($0^\circ$) adapted to target images ($45^\circ$) through intermediate rotation angles.
  • Color-Shift MNIST: Color intensities linearly shifted from $[0, 1]$ to $[1, 2]$.
  • Portraits: 9 chronological domains (1905–2013) tracking yearbook portrait photography shifts over time.
  • Cover Type: Tabular dataset sorted by horizontal distance to water for forest cover type classification.
  • CIFAR-10C & CIFAR-100C: Evaluated under a GDA protocol where severity levels 1–4 serve as intermediate domains and level 5 serves as the target across 15 common corruption types.

Key Insights and Ideas

  • Continuous Interpolation Prevents Negative Transfer: Quantitative $\mathcal{A}$-distance analysis shows that direct source-to-target alignment results in severe distance spikes (up to 1.498), whereas SWAT maintains near-zero distances ($<0.11$) relative to local intermediate windows, reducing average divergence by 63.7%.
  • Geometric Manifold Continuity: Non-adversarial domain transitions exhibit fragmented jumps (Hausdorff distance of 4.72 in feature space), while SWAT's adversarial flow cuts trajectory fragmentation by 75.6% (Hausdorff distance of 1.15).
  • Smooth Annealing Beats Random/Fixed Stepping: Ablation studies show that steadily increasing $p$ outperforms keeping $p$ fixed at $0.5$ or sampling $p$ uniformly at random, demonstrating that strict curriculum-style pacing is vital to avoiding error accumulation.
  • Fewer Domains Benefit Most: The performance advantage of SWAT is most pronounced when intermediate domains are scarce (e.g., only 2 or 3 total domains available), showing that continuous flow synthesis effectively compensates for missing trajectory data.

Key Results

  • Standard GDA Benchmarks:
  • Rotated MNIST: Achieves 96.7% accuracy, outperforming the prior state-of-the-art AST (90.6%) and GOAT (86.4%).
  • Color-Shift MNIST: Achieves 99.6% accuracy (vs. 91.8% GOAT).
  • Portraits: Reaches 87.4% accuracy (vs. 86.2% GGF).
  • Cover Type: Achieves 75.0% accuracy (vs. 73.5% GST).
  • High-Severity Corruptions:
  • On CIFAR-10C (severity 5), SWAT achieves the lowest mean error rate of 15.4%, outperforming TTA methods like CoTTA (16.2%) and GTTA-MIX (15.6%).
  • On CIFAR-100C, SWAT records 24.8% mean error, substantially beating GTTA-MIX (28.9%) and GOAT (46.2%).
  • Computational Efficiency: Despite maintaining auxiliary generators and discriminators, SWAT executes Rotated MNIST adaptation in 4 min 56 s (4488 MB GPU RAM), running faster than GOAT (5 min 38 s).

Limitations and Future Work

  • Sample Rejection Sensitivity: Performance is sensitive to the rejection threshold for low-confidence samples; aggressive filtering reduces available training signals and harms generalization.
  • Domain Sequence Assumption: The method requires an ordered domain sequence or known domain trajectory indices to define the sliding window steps.
  • Tabular Bottlenecks: On tabular data (Cover Type), adding intermediate sliding steps produced minimal gains, suggesting that flow matching provides less benefit when representations are simple or already well-separated.

Summary updated

Abstract

Domain shifts are critical issues that harm the performance of machine learning. Unsupervised Domain Adaptation (UDA) mitigates this issue but suffers when the domain shifts are steep and drastic. Gradual Domain Adaptation (GDA) alleviates this problem in a mild way by gradually adapting from the source to the target domain using multiple intermediate domains. In this paper, we propose Sliding Window Adversarial Training (SWAT) for GDA. SWAT first formulates adversarial streams to connect the feature spaces of the source and target domains. Then, a sliding window paradigm is designed that moves along the adversarial stream to gradually narrow the small gap between adjacent intermediate domains. When the window moves to the end of the stream, i.e., the target domain, the domain shift is explicitly reduced. Extensive experiments on six GDA benchmarks demonstrate the significant effectiveness of SWAT, especially 6.1\% improvement on Rotated MNIST and 4.1\% advantage on CIFAR-100C over the previous methods.
BibTeX
@misc{wang2025swat,
  author = {Zixi Wang and Xiangxu Zhao and Tonglan Xie and Mengmeng Jing and Lin Zuo},
  title = {{SWAT: Sliding Window Adversarial Training for Gradual Domain Adaptation}},
  year = {2025},
  eprint = {2501.19155},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2501.19155},
}
Figure