arXiv:2610.28856cs.CVOct 2026

Manuscript Offprint

arXiv:2610.28856

Depth-guided Geometric Adaptation for Few-shot Image Classification

Zhiqi Miao, Estefanía Talavera, Weichuan Zhang, Jiapan Guo

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. Code is available at DAFIC.

1. Introduction

Few-Shot Learning (FSL) aims to achieve human-like generalization from limited examples. Within this paradigm, Few-Shot Image Classification (FSIC) needs to recognize novel classes during inference that are disjoint from those seen during training, given only one or a few labeled samples per class [34, 60]. A critical challenge in this setting is that images in real-world scenarios and common benchmarks (e.g., ImageNet [51]) often contain multiple entities but are assigned a single image-level label. Conventional large-scale models mitigate this by relying on abundant training data to implicitly learn to isolate class-relevant entities [20, 23]. However, this strategy often fails in FSIC, where extreme data scarcity prevents the model from inherently suppressing background clutter and ambiguity.

Figure

Figure 1. Patch-to-class similarity maps on a MiniImageNet [57] example. In comparison, DAFIC leverages estimated depth priors to produce more target-focused similarities and suppress responses to background distractors (e.g., leaves/branch/fence).

Motivated by this challenge, many recent metric-based FSIC approaches [10, 11, 13, 20, 23, 25] have shifted from image-level to patch-level representations. This transition facilitates fine-grained local comparisons across images. While pioneering works refine patch embeddings to highlight class-discriminative regions via online optimization [23], global context adaptation [10, 20, 25], or masked knowledge distillation [36], they share a common limitation: they primarily rely on RGB appearances (e.g., texture, color, and illumination), without explicit geometric cues (see Fig. 1). This reliance leads to three major issues in cluttered scenes: (1) appearance shifts create false similarities between target entities and background distractors; (2) lacking geometric constraints, feature aggregation becomes noisy as it mixes salient object regions with surrounding clutter; and (3) the model struggles to align local patch features with global semantic context. Crucially, these effects are further amplified in episodic FSIC, resulting in class-inconsistent matching.

Furthermore, even with well-refined patch embeddings, establishing reliable image-to-class matching remains challenging. Existing methods typically employ either global spatial aggregation [20, 23, 36], which discards critical patch-to-patch local correspondence, or flattening dense similarity matrices into fixed parametric heads (e.g., linear layers or MLPs) [10, 20, 25], which destroys the 2D layout. While non-parametric dense matching offers an in-tuitive alternative, it faces practical challenges in cluttered scenes. Relying solely on unidirectional matching (e.g., query-to-support) [33] can lead to redundant assignments, where multiple query patches repeatedly match to the most salient support patch, ignoring the overall object structure. In contrast, symmetric bidirectional matching encourages better coverage and structural consistency, but it can be sensitive to unaligned background clutter; when background patches fail to find meaningful matches, they often suppress the overall image similarity score.

In this paper, we present DAFIC, a framework that addresses these challenges by systematically incorporating monocular geometry into few-shot image classification. Our core insight is that monocular depth can be exploited as a geometric prior through learnable adaptation, reducing patch-level semantic ambiguity and improving support-query correspondence under background clutter. Specifically, DAFIC first employs an RGB-D self-supervised pre-training scheme to learn geometry-aware token embeddings. We then introduce the Depth-guided Geometric Adaptation (DGA) module, which transforms depth maps into geometry-salient patch attention and further aligns patch representations with a geometry-enriched class embedding. Importantly, DGA encourages geometry-salient patches to preserve fine-grained local cues while injecting geometry-enriched class-level context, and steers low-attention (often background) regions toward more consistent global descriptors. Building on these refined embeddings, we adopt a non-parametric Spatial Bidirectional Patch Matching (SBiM) classifier to perform bidirectional dense patch matching, improving correspondence coverage and reducing sensitivity to spurious matches. Extensive experiments on four benchmarks demonstrate that DAFIC achieves strong performance against existing methods, with ablations and robustness analyses validating the designs.

References (74)