Discriminative Sample-Guided and Parameter-Efficient Feature Space Adaptation for Cross-Domain Few-Shot Learning

Rashindrie Perera, Saman K. HalgamugeCVPR 2024 · DOI

Introduction

Few-shot classification aims to recognize new categories from just a handful of examples, known as the support set. While standard few-shot learning assumes new classes come from the same domain as the training data, Cross-Domain Few-Shot Learning (CD-FSL) presents a much steeper challenge: learning new classes in entirely unseen domains, such as transitioning from natural images of animals to specialized satellite or medical imagery.

Existing methods often struggle with a "Goldilocks" problem. Full fine-tuning of a large backbone on a tiny support set leads to severe overfitting, where the model loses its generalized knowledge. Conversely, using a fixed pre-trained model with a simple Nearest Centroid Classifier (NCC) often results in under-adaptation, as the feature space remains unoptimized for the specific variances of the new domain. To bridge this gap, we present DIPA (Discriminative Sample-Guided and Parameter-Efficient Feature Space Adaptation).

The DIPA Framework

DIPA achieves state-of-the-art results by tuning only 0.5% of a Vision Transformer's (ViT) parameters. The framework relies on three technical pillars:

  1. Parameter-Efficient Linear Transformation: Instead of updating all weights, DIPA attaches a set of scaling ($\gamma$) and shifting ($\beta$) parameters to the layer normalization, MLP, and attention layers of a pre-trained ViT. This drastically reduces the trainable parameters while allowing the model to adjust its internal representations.
  2. Discriminative Sample-Aware Loss: Traditional methods often rely on NCC, which pulls class embeddings toward their mean but ignores inter-class variance. DIPA replaces this with a Proxy Anchor Loss. This loss treats class prototypes as learnable anchors and considers the "hardness" of samples—pushing challenging negative samples further away and pulling dissimilar positive samples closer.
  3. Strategic Tuning and Fusion: The authors found that shallower layers contain more general features. By only tuning the deeper layers (the last 7 to 9 layers), DIPA further mitigates overfitting. Additionally, it concatenates the [cls] tokens from the last four layers to capture a richer hierarchical representation of the image.
Overview of the DIPA framework, illustrating the parameter-efficient adaptation of the Vision Transformer and the fine-tuning process.

Experimental Setup and Results

The model was evaluated on Meta-Dataset, a massive collection of 13 diverse datasets including both in-domain (e.g., ImageNet, Birds) and out-of-domain (e.g., Traffic Signs, MSCOCO, Satellite imagery) examples.

DIPA outperformed existing methods across the board, showing accuracy improvements of up to 7.7% on seen datasets and 5.3% on unseen datasets. Beyond accuracy, DIPA is significantly more efficient, using as few as 0.06M trainable parameters compared to the 21.72M updated by full fine-tuning methods.

UMAP visualizations comparing standard NCC (left) with DIPA (right), demonstrating significantly improved class separation in the feature space.

Key Insights

  • The "Less is More" of Adaptation: The paper demonstrates that minimal changes to a model can be more effective than broad updates. By strictly limiting adaptation to a linear transformation, the model retains its "common sense" from pre-training while adjusting its "perspective" for the new task.
  • Centroids Aren't Enough: In few-shot scenarios, the distribution of available samples is critical. By using a discriminative loss that accounts for sample difficulty, DIPA creates "well-separated clusters" rather than just "tight clusters," which is vital for accurate classification during inference.
  • MIM > DINO for CD-FSL: Masked Image Modelling (MIM) provides a better task-agnostic starting point than the popular DINO method. MIM forces the model to understand the underlying structure of images, which generalizes better to radically different domains.

Conclusion

DIPA provides a robust and efficient solution for cross-domain few-shot learning. By combining parameter-efficient tuning with a discriminative loss, it achieves superior adaptation without the risk of overfitting. Future research could explore more flexible transformation architectures or automated methods for determining optimal tuning depths for specific target domains.

Summary updated

BibTeX
@inproceedings{perera2024discriminative,
  author = {Rashindrie Perera and Saman K. Halgamuge},
  title = {{Discriminative Sample-Guided and Parameter-Efficient Feature Space Adaptation for Cross-Domain Few-Shot Learning}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2024},
  doi = {10.1109/cvpr52733.2024.02246},
}
Figure