Direct Distillation between Different Domains

Jialiang Tang, Shuo Chen, Gang Niu, Hongyuan Zhu, Joey Tianyi Zhou, Chen Gong, Masashi Sugiyama

Abstract

Knowledge Distillation (KD) aims to learn a compact student network using knowledge from a large pre-trained teacher network, where both networks are trained on data from the same distribution. However, in practical applications, the student network may be required to perform in a new scenario (i.e., the target domain), which usually exhibits significant differences from the known scenario of the teacher network (i.e., the source domain). The traditional domain adaptation techniques can be integrated with KD in a two-stage process to bridge the domain gap, but the ultimate reliability of two-stage approaches tends to be limited due to the high computational consumption and the additional errors accumulated from both stages. To solve this problem, we propose a new one-stage method dubbed ``Direct Distillation between Different Domains" (4Ds). We first design a learnable adapter based on the Fourier transform to separate the domain-invariant knowledge from the domain-specific knowledge. Then, we build a fusion-activation mechanism to transfer the valuable domain-invariant knowledge to the student network, while simultaneously encouraging the adapter within the teacher network to learn the domain-specific knowledge of the target data. As a result, the teacher network can effectively transfer categorical knowledge that aligns with the target domain of the student network. Intensive experiments on various benchmark datasets demonstrate that our proposed 4Ds method successfully produces reliable student networks and outperforms state-of-the-art approaches.

Introduction

Knowledge Distillation (KD) has become a cornerstone technique for deploying high-performance models on resource-constrained devices. By transferring knowledge from a large "teacher" model to a smaller "student" model, we can maintain significant accuracy while reducing computational costs. However, a major hurdle arises when the teacher and student operate in different data distributions—for example, a teacher trained on synthetic data (source domain) and a student intended for real-world deployment (target domain).

Traditional approaches to this "cross-domain" distillation typically rely on two-stage processes: either adapting the teacher to the target domain before distillation or distilling first and then adapting the student. These methods are often inefficient, prone to error accumulation across stages, and frequently require access to the original source data, which may be restricted due to privacy or storage concerns.

Comparison of knowledge distillation paradigms. 4Ds offers a streamlined one-stage alternative to traditional two-stage adaptation and distillation methods.

The 4Ds Framework: Direct Distillation between Different Domains

To overcome the limitations of multi-stage pipelines, we introduce 4Ds (Direct Distillation between Different Domains). This framework enables end-to-end distillation directly on the target domain without requiring source data. The core innovation lies in bridging the domain gap during the distillation process itself through three primary mechanisms.

Fourier-based Knowledge Adapters

The 4Ds method leverages the Fourier Transform's ability to decouple image information. In the frequency domain, the phase component typically captures semantic content (the "what"), while the amplitude component captures domain-specific style and appearance (the "how"). We introduce lightweight, learnable adapters into the teacher network. These adapters are designed to "refurbish" the amplitude of the teacher's features to align with the target domain's style while preserving the critical semantic phase information.

Fusion-Activation and Interactive Training

Beyond final outputs, 4Ds facilitates knowledge transfer at the intermediate feature level. A fusion-activation mechanism aggregates multi-layer features and uses attention to highlight domain-invariant information most beneficial to the student. Crucially, the training is interactive: while the student learns from the teacher, the teacher's adapters simultaneously update to become more "student-friendly" within the target domain. This co-evolution ensures the teacher provides knowledge that is both accurate and digestible for a smaller network in a new environment.

The detailed 4Ds architecture, illustrating the Fourier-based adapter and the interactive knowledge transfer between teacher and student networks.

Experimental Evaluation

We evaluated 4Ds across four major domain adaptation benchmarks: Office-Caltech, Office-Home, PACS, and DomainNet. These datasets cover a wide range of domain shifts, from subtle lighting changes to drastic stylistic differences like sketches versus photos.

Our results demonstrate that 4Ds consistently outperforms both standard KD and complex two-stage baselines. For instance, on the Office-Home dataset, 4Ds achieved a 5.03% accuracy improvement over standard training. By avoiding the pitfalls of two-stage error accumulation and the need for source data, 4Ds establishes a new state-of-the-art for cross-domain knowledge transfer.

Conclusion

The 4Ds framework represents a significant step forward in making knowledge distillation practical for real-world, multi-domain applications. By utilizing Fourier-based decoupling and a one-stage interactive training strategy, it provides a robust, efficient, and source-free solution for transferring knowledge across domain boundaries. Future research will explore extending these principles to more complex vision tasks like object detection and addressing scenarios with mismatched category sets between domains.

Summary updated

BibTeX
@inproceedings{tang2024direct,
  author = {Jialiang Tang and Shuo Chen and Gang Niu and Hongyuan Zhu and Joey Tianyi Zhou and Chen Gong and Masashi Sugiyama},
  title = {{Direct Distillation between Different Domains}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  doi = {10.1007/978-3-031-72989-8\_9},
}
Figure