Depth-guided Geometric Adaptation for Few-shot Image Classification
Organizations: University of Groningen · University of Twente · Shanxi University of Science and Technology
Abstract
Few-shot image classification (FSIC) frequently suffers from visual ambiguity, where background clutter and RGB appearance similarities hinder discriminative feature matching in data-scarce settings. To mitigate this, we propose DAFIC, a geometry-guided framework that incorporates monocular depth into representation learning, episodic adaptation, and dense support-query matching. DAFIC first learns geometry-aware token representations through RGB-D self-supervised pre-training. Subsequently, the Depth-guided Geometric Adaptation (DGA) module uses depth-derived geometry to refine patch representations with geometry-enriched class context while suppressing background interference. Spatial Bidirectional Patch Matching (SBiM) then performs bidirectional dense matching on the refined features, reducing sensitivity to spurious correspondences and background clutter. Extensive experiments on four benchmarks show that DAFIC achieves strong performance against existing methods, with ablation and robustness analyses supporting the effectiveness of coupling geometry-conditioned episodic adaptation with bidirectional matching for few-shot visual recognition.
Figures & tables
| Method | Backbone | Params | MiniImageNet | TieredImageNet | ||
|---|---|---|---|---|---|---|
| 5-way 1-shot | 5-way 5-shot | 5-way 1-shot | 5-way 5-shot | |||
| ProtoNet [ 53 ] | ResNet-12 | 12.4M | 62.29 ±0.33 | 79.46 ±0.48 | 68.25 ±0.23 | 84.01 ±0.56 |
| CAN [ 24 ] | ResNet-12 | 12.4M | 63.85 ±0.48 | 79.44 ±0.34 | 69.89 ±0.51 | 84.23 ±0.37 |
| FEAT [ 68 ] | ResNet-12 | 12.4M | 66.78 ±0.20 | 82.05 ±0.14 | 70.80 ±0.23 | 84.79 ±0.16 |
| RENet [ 26 ] | ResNet-12 | 12.4M | 67.60 ±0.44 | 82.58 ±0.30 | 71.61 ±0.51 | 85.28 ±0.35 |
| SUN [ 14 ] | ViT | 12.5M | 67.80 ±0.45 | 83.25 ±0.30 | 72.99 ±0.50 | 86.74 ±0.33 |
| Method | Backbone | Params | CIFAR-FS | FC100 | ||
|---|---|---|---|---|---|---|
| 5-way 1-shot | 5-way 5-shot | 5-way 1-shot | 5-way 5-shot | |||
| ProtoNet [ 53 ] | ResNet-12 | 12.4M | 72.20 ±0.70 | 83.50 ±0.50 | 41.54 ±0.76 | 57.08 ±0.76 |
| RFS [ 55 ] | ResNet-12 | 12.4M | 71.50 ±0.80 | 86.00 ±0.50 | 42.60 ±0.70 | 59.10 ±0.60 |
| SUN [ 14 ] | ViT | 12.5M | 78.37 ±0.46 | 88.84 ±0.32 | - | - |
| FewTURE [ 23 ] | Swin-T | 29M | 77.76 ±0.81 | 88.90 ±0.59 | 47.68 ±0.78 | 63.81 ±0.75 |
| CPEA [ 20 ] | ViT-S | 22M | 77.82 ±0.66 | 88.98 ±0.45 | 47.24 ±0.58 | 65.02 ±0.60 |
| Dataset | Shot | CPEA | CPEA(DGA) | CPEA(DGA+SBiM) | DAFIC |
|---|---|---|---|---|---|
| MiniImageNet [ 57 ] | 1 | 72.25±0.65 | 73.26±0.60 | 74.02±0.46 | 77.71 ±0.44 |
| 5 | 87.24±0.38 | 87.82±0.33 | 88.12±0.27 | 90.35 ±0.51 | |
| TieredImageNet [ 48 ] | 1 | 77.12±0.70 | 78.30±0.70 | 78.86±0.51 | 80.10 ±0.40 |
| 5 | 90.12±0.45 | 90.65±0.41 | 90.61±0.32 | 91.05 ±0.51 | |
| CIFAR-FS [ 2 ] | 1 | 78.27±0.66 | 78.66±0.60 | 79.05±0.47 | 84.30 ±0.44 |
| 5 | 89.30±0.45 | 89.92±0.41 | 89.99±0.33 | 92.53 ±0.29 |
| Components | 1-shot | 5-shot |
|---|---|---|
| Non-pretrain | 30.49 0.35 | 41.23 0.38 |
| RGB-pretrain | 69.12 0.49 | 84.88 0.31 |
| RGBD-pretrain | 73.85 0.48 | 87.64 0.29 |
| + DA | 74.64 0.47 | 88.38 0.28 |
| + GA | 76.69 0.51 | 89.45 0.35 |
| + SBiM | 77.42 0.49 | 90.14 0.41 |
| Model | Params (M) | FLOPs (G) | Time (ms) | 1-shot Acc. | 5-shot Acc. |
|---|---|---|---|---|---|
| SMKD [ 36 ] | 21.67 | 339.87 | 78.40 | 80.08±0.18 | 90.63±0.13 |
| CPEA [ 20 ] | 21.67 | 9.38 | 1.43 | 78.27±0.66 | 89.30±0.45 |
| DAFIC | 21.76 | 9.51 | 1.39 | 84.30±0.44 | 92.53±0.29 |
| Methods | 5-way 1-shot | 5-way 5-shot |
|---|---|---|
| CPEA | 72.25±0.65 | 87.24±0.38 |
| DAFIC | 77.71±0.44 | 90.35±0.51 |
| DAFIC Object-region occlusions | 73.06±0.61 | 87.51±0.43 |
| DAFIC Background occlusions | 77.10±0.64 | 89.81±0.36 |
| DAFIC Low-quality depth map | 74.53±0.65 | 88.10±0.43 |
Appendix figures & tables19 assets
Supplementary material from the paper’s appendix.
Appendix
| Dataset | # Images | Train/Val/Test |
|---|---|---|
| MiniImageNet [ 57 ] | 60,000 | 64/16/20 |
| TieredImageNet [ 48 ] | 779,165 | 351/97/160 |
| CIFAR-FS [ 2 ] | 60,000 | 64/16/20 |
| FC100 [ 44 ] | 60,000 | 60/20/20 |
| Category | Configuration |
|---|---|
| Backbone | ViT-Small with patches; 8192-d projection head shared by class and patch tokens (student/teacher). |
| [1.5pt/2pt] Optimization | AdamW optimizer; cosine LR from to ; weight decay 0.04 0.4; 10-epoch warm-up. |
| [1.5pt/2pt] Teacher EMA | EMA momentum: 0.996; teacher temperature increases from 0.04 to 0.07 during the first 30 epochs. |
| [1.5pt/2pt] Augmentation | RGB-D multi-crop strategy: 2 global crops ( , scale [0.25,1.0]) and 10 local crops ( , scale [0.05,0.25]); RGB-depth synchronized crop/flip; per-channel RGB and depth normalization. |
| [1.5pt/2pt] MIM | Block-wise masking on global crops (student network); masking ratio sampled from [0.0, 0.3] with variance [0.0, 0.2]. |
| [1.5pt/2pt] Computation | Distributed training with DDP; 3 A100 (40GB) GPUs; batch size 384; pre-training for 1,600 epochs (800 for TieredImageNet); checkpoint selected at epoch 1,000 (500 for TieredImageNet). |
| Method | Venue | Backbone | # Params | MiniImageNet | TieredImageNet | ||
|---|---|---|---|---|---|---|---|
| 5-way 1-shot | 5-way 5-shot | 5-way 1-shot | 5-way 5-shot | ||||
| MatchNet [ 57 ] | NeurIPS’16 | ResNet-12 | 12.4M | 65.64 ± 0.20 | 78.72 ± 0.15 | 68.50 ± 0.92 | 80.60 ± 0.71 |
| ProtoNet [ 53 ] | NeurIPS’17 | ResNet-12 | 12.4M | 62.29 ± 0.33 | 79.46 ± 0.48 | 68.25 ± 0.23 | 84.01 ± 0.56 |
| MAML [ 17 ] | ICML’17 | ResNet-12 | 12.4M | 49.24 ± 0.21 | 58.05 ± 0.10 | 67.92 ± 0.17 | 72.41 ± 0.20 |
| TADAM [ 44 ] | NeurIPS’18 | ResNet-12 | 12.4M | 58.50 ± 0.30 | 76.70 ± 0.30 | 62.13 ± 0.31 | 81.92 ± 0.30 |
| LEO [ 52 ] | ICLR’19 | WRN-28-10 | 36.5M | 61.76 ± 0.08 | 77.59 ± 0.12 | 66.33 ± 0.05 | 81.44 ± 0.09 |
| Method | Venue | Backbone | # Params | CIFAR-FS | FC100 | ||
|---|---|---|---|---|---|---|---|
| 5-way 1-shot | 5-way 5-shot | 5-way 1-shot | 5-way 5-shot | ||||
| ProtoNet [ 53 ] | NeurIPS’17 | ResNet-12 | 12.4M | 72.20 ± 0.70 | 83.50 ± 0.50 | 41.54 ± 0.76 | 57.08 ± 0.76 |
| TADAM [ 44 ] | NeurIPS’18 | ResNet-12 | 12.4M | - | - | 40.10 ± 0.40 | 56.10 ± 0.40 |
| MetaOptNet [ 31 ] | CVPR’19 | ResNet-12 | 12.4M | 72.80 ± 0.70 | 84.30 ± 0.50 | 47.20 ± 0.60 | 55.50 ± 0.60 |
| RFS [ 55 ] | ECCV’20 | ResNet-12 | 12.4M | 71.50 ± 0.80 | 86.00 ± 0.50 | 42.60 ± 0.70 | 59.10 ± 0.60 |
| DeepEMD [ 70 ] | CVPR’20 | ResNet-12 | 12.4M | - | - | 46.47 ± 0.78 | 63.22 ± 0.71 |
| DA Design | Initialization | |
|---|---|---|
| RGB | RGB-D | |
| Patch-average | 77.89 0.47 | 79.15 0.41 |
| MLP-based | 78.21 0.49 | 79.43 0.52 |
| CNN-based | 78.86 0.51 | 80.10 0.40 |
| Matching Strategy | MiniImageNet | FC100 | ||
|---|---|---|---|---|
| 1-shot | 5-shot | 1-shot | 5-shot | |
| SBiM | 77.71 0.44 | 90.35 0.51 | 50.52 0.46 | 69.42 0.44 |
| SBiM (top 50% patches) | 77.02 0.42 | 89.92 0.40 | 50.15 0.47 | 68.15 0.43 |
| SBiM (one-way) | 66.05 0.47 | 80.17 0.36 | 44.61 0.44 | 59.41 0.43 |
| Mutual-NN (MNN) | 76.38 0.40 | 89.18 0.29 | 49.21 0.55 | 67.75 0.40 |
| MLP (CPEA) | 76.20 0.41 | 88.79 0.38 | 48.56 0.60 | 67.05 0.59 |
| Setting | Learnable | 1-shot | 5-shot |
|---|---|---|---|
| Fixed | No | 76.62 0.44 | 89.59 0.51 |
| Fixed | No | 77.02 0.42 | 89.92 0.40 |
| Init | Yes | 76.68 0.51 | 89.66 0.36 |
| Init | Yes | 77.71 0.44 | 90.35 0.51 |
| Init | Yes | 77.34 0.40 | 90.22 0.38 |
| 1-shot | 5-shot | |
|---|---|---|
| 76.97 0.46 | 89.50 0.44 | |
| 77.71 0.44 | 90.35 0.51 | |
| 77.18 0.44 | 89.77 0.43 | |
| 76.99 0.60 | 89.61 0.59 |
| 1-shot | 5-shot | ||
|---|---|---|---|
| 1.0 | 0 | 77.42 0.49 | 90.14 0.41 |
| 1.0 | 0.5 | 77.71 0.41 | 90.35 0.51 |
| 1.0 | 1.0 | 77.60 0.44 | 90.24 0.46 |
| FSL Adaptation | MLP | SBiM |
|---|---|---|
| None | 30.49 / 41.23 | 32.93 / 48.10 |
| CPEA-style | 31.01 / 46.66 | 29.73 / 44.78 |
| DGA | 32.61 / 49.67 | 34.36 / 52.81 |
| Dataset | 1-shot | 5-shot |
|---|---|---|
| MiniImageNet | 77.42 0.26 | 90.29 0.15 |
| TieredImageNet | 80.09 0.17 | 90.94 0.15 |
| CIFAR-FS | 84.45 0.16 | 92.40 0.16 |
| FC100 | 50.36 0.21 | 69.37 0.32 |
| Method | FSIC Latency | Depth Latency | Total Latency |
|---|---|---|---|
| CPEA | 1.43 | – | 1.43 |
| DAFIC (cached) | 1.39 | – | 1.39 |
| DAFIC (on-the-fly) | 1.39 | 72.63 | 74.02 |
| SMKD | 78.40 | – | 78.40 |
| Method | Depth Source | 1-shot | 5-shot |
|---|---|---|---|
| CPEA | – | 72.25 0.65 | 87.24 0.38 |
| DAFIC | Depth Anything V2 | 77.71 0.44 | 90.35 0.51 |
| DAFIC | DINOv2-S + DPT | 76.16 0.40 | 89.05 0.22 |
| Method | Backbone | # Params | MiniImageNet | TieredImageNet | ||
|---|---|---|---|---|---|---|
| 5-way 1-shot | 5-way 5-shot | 5-way 1-shot | 5-way 5-shot | |||
| ProtoNet [ 53 ] | ResNet-12 | 12.4M | 62.29 ± 0.33 | 79.46 ± 0.48 | 68.25 ± 0.23 | 84.01 ± 0.56 |
| ProtoNet+Depth | ResNet-12 | 12.4M | 67.56 ± 0.21 | 84.11 ± 0.14 | 72.62 ± 0.42 | 86.88 ± 0.16 |
| DN4 [ 33 ] | ResNet-12 | 12.4M | 56.93 ± 0.62 | 73.97 ± 0.49 | 66.25 ± 0.75 | 82.62 ± 0.51 |
| DN4+Depth | ResNet-12 | 12.4M | 65.27 ± 0.64 | 82.33 ± 0.40 | 70.83 ± 0.73 | 86.67 ± 0.47 |
| CAN [ 24 ] | ResNet-12 | 12.4M | 63.85 ± 0.48 | 79.44 ± 0.34 | 69.89 ± 0.51 | 84.23 ± 0.37 |
| Method | Backbone | # Params | CIFAR-FS | FC100 | ||
|---|---|---|---|---|---|---|
| 5-way 1-shot | 5-way 5-shot | 5-way 1-shot | 5-way 5-shot | |||
| ProtoNet [ 53 ] | ResNet-12 | 12.4M | 72.20 ± 0.70 | 83.50 ± 0.50 | 41.54 ± 0.76 | 57.08 ± 0.76 |
| ProtoNet+Depth | ResNet-12 | 12.4M | 76.17 ± 0.66 | 86.92 ± 0.44 | 43.77 ± 0.62 | 60.22 ± 0.74 |
| DN4 [ 33 ] | ResNet-12 | 12.4M | 71.88 ± 0.68 | 85.16 ± 0.49 | 39.56 ± 0.56 | 56.50 ± 0.54 |
| DN4+Depth | ResNet-12 | 12.4M | 76.23 ± 0.68 | 88.68 ± 0.41 | 41.47 ± 0.57 | 59.21 ± 0.55 |
| RFS [ 55 ] | ResNet-12 | 12.4M | 71.50 ± 0.80 | 86.00 ± 0.50 | 42.60 ± 0.70 | 59.10 ± 0.60 |
| Method | Backbone | # Params | CUB | StanfordCars | ||
|---|---|---|---|---|---|---|
| 5-way 1-shot | 5-way 5-shot | 5-way 1-shot | 5-way 5-shot | |||
| ProtoNet [ 53 ] | ResNet-12 | 12.4M | 66.29 ± 0.92 | 82.58 ± 0.58 | 70.07 ± 0.18 | 84.21 ± 0.35 |
| ProtoNet+Depth | ResNet-12 | 12.4M | 68.50 ± 0.52 | 83.40 ± 0.22 | 73.21 ± 0.11 | 85.54 ± 0.20 |
| DN4 [ 33 ] | ResNet-12 | 12.4M | 79.01 ± 0.64 | 90.03 ± 0.35 | 86.08 ± 0.59 | 95.35 ± 0.59 |
| DN4+Depth | ResNet-12 | 12.4M | 81.67 ± 0.64 | 92.18 ± 0.33 | 87.21 ± 0.59 | 96.26 ± 0.59 |
| FEAT [ 68 ] | ResNet-12 | 12.4M | 82.14 ± 0.19 | 92.05 ± 0.38 | 86.58 ± 0.65 | 95.13 ± 0.28 |
Few-Shot Image Classification
Few-shot image classification learns to recognize visual categories from only a small number of labeled examples.
See all 71 papers