Agile Domain Adaptation

Jingjing Li, Mengmeng Jing, Yue Xie, Ke Lu, Zi Huang

Abstract

Traditional domain adaptation (DA) methods often employ a "one-size-fits-all" approach, processing every target sample through the same deep neural network regardless of its complexity. This leads to significant computational waste, especially for samples that are visually similar to the source domain. We present Agile Domain Adaptation Networks (ADAN), a framework that introduces multiple "early exits" into deep architectures. By classifying easy target samples at shallower layers and reserving compute-intensive deep layers for difficult cases, ADAN achieves state-of-the-art accuracy while providing up to a 3x speedup, making robust domain adaptation viable for real-time and mobile applications.

Introduction

Domain Adaptation (DA) is a critical technique in machine learning that enables a model trained on a labeled source domain to generalize to a related but unlabeled target domain. The primary challenge in this field is "distribution shift"—the discrepancy in data distributions between domains. For instance, a model trained on high-quality product images from an e-commerce site (e.g., Amazon) often struggles when applied to low-resolution, poorly lit webcam photos of the same items.

Existing deep DA methods typically pass every image through an entire deep backbone, such as a ResNet-50. However, target datasets are non-uniform; some samples are "easy" because they closely resemble the source data, while others are "hard" due to extreme variations in lighting, occlusion, or perspective. Forcing an easy sample through 50 layers is computationally inefficient, while a shallow network alone might lack the representational power to handle hard samples. ADAN addresses this accuracy-vs-speed contradiction by introducing an agile inference mechanism.

The ADAN architecture compared to traditional deep domain adaptation. The model identifies 'easy' samples that can exit at shallower layers, while 'hard' samples proceed to deeper adaptation layers.

Methodology

The Agile Domain Adaptation Network (ADAN) framework consists of three core components designed to optimize both transferability and computational efficiency.

1. Multi-Exit Architecture

ADAN augments a standard backbone network with several auxiliary classifiers (early exits) attached at different depths. This allows the network to produce predictions at multiple stages of feature extraction.

2. Joint Training and Distribution Alignment

During the training phase, the model optimizes a weighted loss function across all exits simultaneously. This loss includes:

  • Supervised Loss: Standard cross-entropy calculated on the labeled source data at each exit.
  • Transfer Loss: To ensure early layers are domain-aware, the authors utilize Multi-kernel Maximum Mean Discrepancy (MMD). This aligns the feature distributions of the source and target domains at every exit point, ensuring that even shallow features are adapted for the target task.

3. Adaptive Inference

During deployment, ADAN employs an "agile" inference strategy. As a target sample passes through the network, the model calculates the Shannon Entropy of the prediction at each exit. Entropy serves as a confidence metric:

  • If the entropy is below a predefined threshold (indicating high confidence), the sample "exits" immediately.
  • If the entropy is high, the sample continues to the next, deeper layer for further processing.

Experimental Results

The researchers evaluated ADAN on two prominent domain adaptation benchmarks: MNIST → USPS (digit recognition) and Office-31 (object recognition across Amazon, DSLR, and Webcam domains).

Accuracy and Efficiency

ADAN consistently outperformed existing state-of-the-art methods, including JAN and DANN. On the Office-31 benchmark, ADAN achieved an average accuracy of 85.3%, surpassing the previous best of 84.3%. More impressively, these gains were accompanied by significant reductions in latency. On the MNIST → USPS task, ADAN achieved a 2.92x speedup while maintaining higher accuracy than the baseline. By adjusting confidence thresholds, the speedup could be pushed to 5.52x with only a minor impact on performance.

Performance comparison of ADAN against state-of-the-art methods on the Office-31 benchmark, alongside heatmaps showing confidence levels across different object categories.

Qualitative Analysis

Qualitative assessments confirmed the intuition behind the multi-exit strategy. Samples that exited at the earliest stages (Exit 1) were typically well-centered, clear, and visually similar to source images. In contrast, samples requiring the Final Exit often featured significant occlusions, blurriness, or unusual camera angles. This confirms that ADAN successfully identifies and fast-tracks "low-hanging fruit" while dedicating resources to complex cases.

Conclusion and Future Work

ADAN demonstrates that computational efficiency and domain adaptation accuracy are not mutually exclusive. By exploiting the non-uniform difficulty of target samples, ADAN provides a practical path for deploying sophisticated DA models on resource-constrained devices.

Currently, the placement of exits and the selection of confidence thresholds require manual tuning. Future research will focus on developing a "self-adapted ADAN" that can dynamically determine optimal exit points and thresholds during the learning process, further automating the path toward efficient, agile domain adaptation.

Summary updated

Abstract

Domain adaptation investigates the problem of leveraging knowledge from a well-labeled source domain to an unlabeled target domain, where the two domains are drawn from different data distributions. Because of the distribution shifts, different target samples have distinct degrees of difficulty in adaptation. However, existing domain adaptation approaches overwhelmingly neglect the degrees of difficulty and deploy exactly the same framework for all of the target samples. Generally, a simple or shadow framework is fast but rough. A sophisticated or deep framework, on the contrary, is accurate but slow. In this paper, we aim to challenge the fundamental contradiction between the accuracy and speed in domain adaptation tasks. We propose a novel approach, named agile domain adaptation, which agilely applies optimal frameworks to different target samples and classifies the target samples according to their adaptation difficulties. Specifically, we propose a paradigm which performs several early detections before the final classification. If a sample can be classified at one of the early stage with enough confidence, the sample would exit without the subsequent processes. Notably, the proposed method can significantly reduce the running cost of domain adaptation approaches, which can extend the application scenarios of domain adaptation to even mobile devices and real-time systems. Extensive experiments on two open benchmarks verify the effectiveness and efficiency of the proposed method.
BibTeX
@inproceedings{li2019agile,
  author = {Jingjing Li and Mengmeng Jing and Yue Xie and Ke Lu and Zi Huang},
  title = {{Agile Domain Adaptation}},
  booktitle = {IJCNN},
  year = {2019},
  url = {https://openreview.net/forum?id=noBoVLXsVbV},
}
Figure