Few-shot Classification as Multi-instance Verification: Effective Backbone-agnostic Transfer across Domains
Organizations: Department of Computer Science University of Waikato Hamilton, New Zealand
Abstract
We investigate cross-domain few-shot learning under the constraint that fine-tuning of backbones (i.e., feature extractors) is impossible or infeasible---a scenario that is increasingly common in practical use cases---and show how representing few-shot classification as a series of multiple instance verification (MIV) tasks enables competitive classification performance using the static embeddings produced by frozen, "black-box" backbones. More specifically, based on this novel representation, we introduce a new approach to few-shot domain adaptation named the "MIV-head": a classification head that is backbone-agnostic and computationally efficient. We show that the core components of the MIV-head, when trained on few-shot data from a target domain, collectively yield strong performance on test data from that domain. Importantly, they do so without fine-tuning the backbone, requiring only the "meta-testing" phase. In experiments under various settings on an extension of the Meta-Dataset benchmark for cross-domain few-shot image classification, using representative off-the-shelf convolutional neural network and vision transformer backbones pretrained on ImageNet1K, we demonstrate that the MIV-head achieves highly competitive accuracy when compared to state-of-the-art "adapter" (or "partial fine-tuning") methods applied to the same backbones, while incurring substantially lower adaptation cost. Moreover, compared to our approach, well-known "classification head" approaches achieve a substantially lower level of accuracy. We share our code at: https://github.com/xxweka/MIV-head.
Figures & tables
| Regarding … | Previous literature | Novelty of our work |
|---|---|---|
| Backbone | Fine-tuning backbone to | NEW: No modification of backbone model |
| models | achieve SOTA accuracy | weights or architecture, while being competitive |
| 1) Classification problem | 1) “Verification with noise” (MIV) problem | |
| Representations | 2) Support samples are | 2) Same-class support samples are treated as bag |
| and solution | treated as “noise-free” | of “noisy” instances with unknown relevance |
| design | & with equal relevance | 3) NEW: Introduction of competitions to |
| \Block [c]2-1Test | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| dataset | Support size | Class count | Mean shot | |||||||||
| min | mean | max | min | mean | max | min | mean | max | ||||
| Omniglot | 5 | 89.06 | 319 | 5 | 19.04 | 45 | 1 | 4.70 | 9.00 | |||
| Aircraft | 5 | 341.91 | 497 | 5 | 9.92 | 15 | 1 | 36.20 | 79.80 | |||
| Birds | 5 | 316.73 | 494 | 5 | 17.40 | 30 | 1 | 19.80 | 44.00 | |||
| Textures | 5 | 282.42 | 498 | 5 | 6.02 | 7 | 1 | 46.88 | 96.80 | |||
| Characteristics | MIV-head (Ours) | TSA | eTT |
|---|---|---|---|
| Image | i) Resize to | ||
| pre-processing | ii) Normalize data using “ImageNet | Identical to Ours | Identical to Ours |
| mean & standard deviation” | |||
| Backbones | ResNet-50 (supervised & self-supervised) | Identical to Ours | Identical to Ours |
| ViT-S/16(/8) (supervised & self-supervised) | (ResNet-50) | (ViT-S/16) | |
| Modification | No | Yes (add | Yes (add |
| \Block [c]3-1Test | |||||||
|---|---|---|---|---|---|---|---|
| dataset | Off-the-shelf pretrained backbone models for input resolution | ||||||
| Supervised ResNet-50 | Self-supervised(DINO) ResNet-50 | ||||||
| NCC | TSA | Ours | NCC | TSA | Ours | ||
| Omniglot | 50.4 1.4 | 66.7 1.4 | 76.5 1.2 | 55.9 1.3 | 68.5 1.4 | 74.4 1.2 | |
| Aircraft | 54.7 0.9 | 78.9 1.1 | 84.4 1.0 | 55.3 0.9 | 80.2 1.1 | 84.4 1.0 | |
| Birds | 81.0 0.7 | 84.9 0.7 | 87.2 0.8 | 60.6 0.9 | 78.5 1.0 | 81.8 1.1 | |
| \Block [c]4-1Test | ||||||||
|---|---|---|---|---|---|---|---|---|
| dataset | Off-the-shelf pretrained backbone models for input resolution | |||||||
| Supervised(DeiT) ViT-small | Self-supervised(DINO) ViT-small | |||||||
| NCC | eTT | Ours | NCC | eTT \tabularnote Due to the “OOM” issue caused by eTT when it was applied to the backbone taking input patch-size (patch 8), the closest alternative is eTT based on the “patch 16” backbone. | Ours | |||
| (Patch 16) | (Patch 16) | (Patch 8) | (Patch 16) | |||||
| Omniglot | 54.1 1.3 | 69.4 1.3 | 74.5 1.2 | 61.8 1.3 | 77.0 1.3 | 78.6 1.1 | 77.0 1.2 | |
| Aircraft | 54.9 0.9 | 78.4 1.0 | 79.4 1.0 | 62.4 1.0 | 84.1 1.0 | 86.0 0.9 | 83.4 1.0 | |
| \Block [c]5-1Test | ||||||||||||
| dataset | Off-the-shelf pretrained backbone models for input resolution | |||||||||||
| Supervised | Self-supervised (DINO) | |||||||||||
| ResNet-50 | DeiT-small | ResNet-50 | ViT-small | |||||||||
| TSA | Ours | eTT | Ours | TSA | Ours | eTT | Ours | |||||
| Patch-16 | Patch-16 | Patch-8 | Patch-16 | |||||||||
| Average (MD) | 58.5 | 60.6 | 59.9 | 61.4 | 57.3 | 56.1 | 64.0 | 64.1 | 62.1 | |||
| \Block [l]2-1Backbone | ||||||
|---|---|---|---|---|---|---|
| architecture | \Block [c]2-1Pretraining | |||||
| data | \Block [c]2-1Pretraining | |||||
| algorithm | Average (MD) | |||||
| Ours | Baseline++ | |||||
| DenseNet-161 | ILSVRC | supervised | 77.2 | 68.8 | ||
| RegNetY-1.6GF | ILSVRC | supervised | 77.4 | 64.3 | ||
Appendix figures & tables11 assets
Supplementary material from the paper’s appendix.
Appendix
| MIV-head | TSA | eTT | “FiT Head” / Baseline++ | |
| SGD, | Adadelta, | AdamW, | Adam, | |
| Optimizer | momentum=0.9, | , | , | , |
| no weight-decay | no weight-decay | weight-decay=0.01 | no weight-decay | |
| Learning rate | =0.3, | , | FiT Head: , Baseline++: | |
| Component 2: , | feature adaptation: , | |||
| Component 1: | otherwise: |
| Algorithm | TSA | eTT | CTX | ALFA | ProtoNet | BOHB | Ours |
|---|---|---|---|---|---|---|---|
| Backbone | ResNet-34 | ViT-small/16 | ResNet-34 | 4CONV | ResNet-34 | ResNet-18 | ViT-small/8 |
| Test dataset | |||||||
| Omniglot | 82.6 1.1 | 78.1 1.2 | 82.2 1.0 | 61.9 1.5 | 68.5 1.3 | 67.6 1.2 | 78.6 1.1 |
| Aircraft | 80.1 1.0 | 79.9 1.1 | 79.5 0.9 | 63.4 1.1 | 58.0 1.0 | 54.1 0.9 | 86.0 0.9 |
| CUB | 83.4 0.8 | 85.9 0.9 | 80.6 0.9 | 69.8 1.1 | 74.1 0.9 | 70.7 0.9 | 91.8 0.7 |
| DTD | 79.6 0.7 | 87.6 0.6 | 75.6 0.6 | 70.8 0.9 | 68.8 0.8 | 68.3 0.8 | 89.7 0.6 |
| \Block [c]2-1Test | ||||||||
|---|---|---|---|---|---|---|---|---|
| dataset | ||||||||
| GFLOPs | Accuracy | GFLOPs | Accuracy | GFLOPs | Accuracy | |||
| Omniglot | 20440.9 | 65.4 | 25110.5 | 76.5 | 30683.2 | 75.4 | ||
| Aircraft | 10665.3 | 75.8 | 12693.0 | 84.4 | 26093.2 | 84.6 | ||
| CUB | 21958.6 | 88.1 | 26716.7 | 87.2 | 43511.6 | 82.8 | ||
| DTD | 6152.9 | 87.2 | 7174.0 | 89.0 | 16695.1 | 88.5 | ||
| 1 | 2 | 3 | 4 | |
|---|---|---|---|---|
| \Block [c]3-1Test | ||||
| dataset | Full | Excluding | Excluding | Excluding |
| CAP | cross-attention | “in-attention skip- | co-excitation | |
| module | mechanism | connection”(IASC) | (and IASC) | |
| Omniglot | 78.6 | 77.1 | 77.8 | 77.9 |
| Aircraft | 86.0 | 84.6 | 86.1 | 86.0 |
| Utilizing augmented support samples? | |||||
|---|---|---|---|---|---|
| Test | Self-supervised(DINO) | Supervised | |||
| dataset | ViT-small/8 backbone | ResNet-50 backbone | |||
| Yes | No | Yes | No | ||
| Omniglot | 78.6 | 75.8 | 76.5 | 73.2 | |
| Aircraft | 86.0 | 85.5 | 84.4 | 83.6 | |
| Birds | 91.8 | 92.0 | 87.2 | 86.7 | |
| \Block [c]2-1Test | |||||
|---|---|---|---|---|---|
| dataset | ResNet-18 backbones for input resolution | ||||
| SDL-ResNet-18 | Off-the-shelf ResNet-18 | ||||
| TSA | Ours | TSA | Ours | ||
| Omniglot | 75.8 1.2 | 79.1 1.1 | 72.8 1.3 | 78.5 1.1 | |
| Aircraft | 71.9 1.1 | 71.5 1.0 | 68.3 1.1 | 68.7 1.0 | |
| Birds | 73.2 0.9 | 68.9 1.1 | 62.6 1.1 | 61.1 1.1 | |
Few-Shot Domain Adaptation
Few-shot domain adaptation transfers models to a new data domain using only a small number of labeled target examples.
See all 53 papers