Adaptive Semantic Consistency for Cross-domain Few-shot Classification
Hengchu Lu, Yuanjie Shao, Xiang Wang, Changxin Gao
TL;DR
This work addresses cross-domain few-shot classification (CD-FSC), where domain shift and scarce target data lead to overfitting when finetuning pre-trained models. It introduces Adaptive Semantic Consistency (ASC), a plug-and-play framework that preserves source-domain knowledge by reweighting source samples according to their similarity to the target domain and by enforcing semantic consistency between a fixed source model and a tunable target model through an auxiliary copy during finetuning. ASC is designed to be compatible with multiple CD-FSC baselines (Finetune, ConFT, SupCon) and adds a semantic-consistency loss $L_{con}$ to the standard task loss, yielding $L_{ASC} = L_{cls-F} + \lambda L_{con}$. Empirical results on eight target datasets show that ASC consistently improves cross-domain performance, demonstrating its effectiveness in mitigating overfitting and preserving transferable knowledge, with code released for reproducibility.
Abstract
Cross-domain few-shot classification (CD-FSC) aims to identify novel target classes with a few samples, assuming that there exists a domain shift between source and target domains. Existing state-of-the-art practices typically pre-train on source domain and then finetune on the few-shot target data to yield task-adaptive representations. Despite promising progress, these methods are prone to overfitting the limited target distribution since data-scarcity and ignore the transferable knowledge learned in the source domain. To alleviate this problem, we propose a simple plug-and-play Adaptive Semantic Consistency (ASC) framework, which improves cross-domain robustness by preserving source transfer capability during the finetuning stage. Concretely, we reuse the source images in the pretraining phase and design an adaptive weight assignment strategy to highlight the samples similar to target domain, aiming to aggregate informative target-related knowledge from source domain. Subsequently, a semantic consistency regularization is applied to constrain the consistency between the semantic features of the source images output by the source model and target model. In this way, the proposed ASC enables explicit transfer of source domain knowledge to prevent the model from overfitting the target domain. Extensive experiments on multiple benchmarks demonstrate the effectiveness of the proposed ASC, and ASC provides consistent improvements over the baselines. The source code is released at https://github.com/luhc666/ASC-CDFSL.
