Consistent Assistant Domains Transformer for Source-free Domain Adaptation

Renrong Shao, Wei Zhang, Kangyang Luo, Qin Li, Jun Wang

Introduction

Source-Free Domain Adaptation (SFDA) has emerged as a critical task in machine learning, driven by the need to adapt pre-trained models to new target environments without accessing the original source data. This constraint often arises from privacy regulations like GDPR or the logistical challenges of transferring massive datasets. The primary obstacle in SFDA is the "domain shift"—the discrepancy between source and target data distributions. Without source data as a reference, models struggle to classify "hard samples" in the target domain that differ significantly from the training distribution, often leading to noisy pseudo-labels and degraded performance.

Conceptual overview of CADTrans, showing how an assistant domain bridges the gap between source and target domains by identifying easy and hard samples.

To address this, the CADTrans (Consistent Assistant Domains Transformer) framework leverages Vision Transformers (ViT) to create a "source-like" assistant domain. By distinguishing between "easy" (source-similar) and "hard" (target-specific) samples through multi-domain consistency, CADTrans effectively aligns challenging target data without ever needing to revisit the original source dataset.

Methodology: The CADTrans Framework

The CADTrans architecture is designed to exploit the unique properties of Vision Transformers, specifically their consistent internal dimensions across layers, to build a robust adaptation pipeline consisting of three main components.

1. Assistant Domain Module (ADM)

The ADM is a plug-and-play CNN-based module integrated into the ViT backbone. During the initial source training phase, the ADM aggregates multi-level global attention features from various Transformer layers. Through distillation, it is trained to mimic the source classifier, essentially acting as a portable proxy for the source domain. This module allows the model to retain "source-like" knowledge even after the original data is no longer available.

2. Consistency-Based Sample Partitioning

During the adaptation phase, CADTrans employs a dual-domain consistency strategy. The model compares predictions from the main classifier and the ADM to partition the target data:

  • Easy Samples: If both domains agree on a label, the sample is classified as "easy," indicating it shares significant features with the source domain.
  • Hard Samples: Disagreement between the domains identifies "hard" samples. These are then reassessed using a "consistent neighbor" strategy, where their labels are refined based on the most similar easy samples.
The CADTrans workflow for domain adaptation, illustrating the interaction between the ViT backbone, the Assistant Domain Module, and the consistency strategies.

3. Category-Aware Alignment

To finalize adaptation, the framework utilizes CMK-MMD (Conditional Multi-Kernel Maximum Mean Discrepancy). This strategy pulls the feature representations of hard samples toward those of easy samples within the same category. By treating easy target samples as a bridge, the model learns domain-invariant features that generalize well to the entire target domain.

Experimental Evaluation

CADTrans was rigorously evaluated across four major benchmarks, consistently achieving state-of-the-art (SOTA) performance:

  • Office-31: Achieved an average accuracy of 93.2% (using DeiT-B), surpassing established methods like DSiT and SHOT++.
  • Office-Home: Reached 82.9% accuracy, a substantial improvement over the 73.6% baseline of a standard ViT-B model.
  • VisDA-C: In this large-scale synthetic-to-real challenge, the model achieved 88.2% accuracy.
  • DomainNet-126: Demonstrated robustness on this massive, diverse dataset featuring multiple artistic and realistic styles.

Qualitative analysis using Grad-CAM visualizations further supports these results. While source-only models often focus on irrelevant background features when presented with target data, CADTrans-adapted models accurately localize and identify primary objects, such as office equipment or furniture.

Discussion and Conclusion

The success of CADTrans highlights several key insights. First, the global self-attention maps in Vision Transformers are highly effective at capturing discriminative, domain-invariant features. Second, the "easy-to-hard" pipeline provides a more stable adaptation path than attempting to align the entire target domain to a missing source distribution simultaneously.

However, certain limitations remain. The ADM must be integrated during the initial source training, meaning it cannot be easily retrofitted to existing "black-box" pre-trained models. Additionally, extreme environmental variations in the target domain can still lead to negative transfer. Future research will explore extending the assistant domain concept to more lightweight architectures and applying similar consistency-based strategies to Large Language Models (LLMs) to mitigate domain shifts in natural language processing.

Summary updated

BibTeX
@article{shao2025consistent,
  author = {Renrong Shao and Wei Zhang and Kangyang Luo and Qin Li and Jun Wang},
  title = {{Consistent Assistant Domains Transformer for Source-free Domain Adaptation}},
  journal = {IEEE Trans. Image Process.},
  year = {2025},
}
Figure