Few-shot learning (FSL) enables deep learning models to generalize to unseen categories with minimal labeled data, making it crucial for data-constrained domains such as healthcare. However, existing FSL models often lack explainability, obscuring the reasoning behind their predictions and limiting trust in their deployment. In this work, we introduce contrastive cross-class attribution (C3A) to enhance explainability in FSL. Specifically, we present C3A for explaining query predictions and its variant (C3A-E) for episodic learning. Unlike prior explainability methods designed for specific architectures, our approach is classifier-agnostic, leveraging the backbone network to ensure broad applicability across diverse FSL paradigms. In addition, we propose contrastive local descriptors that integrate naive-Bayes nearest-neighbor (NBNN) and Fisher score-based attribution to preserve fine-grained details and enhance interclass discrimination. Finally, we comprehensively evaluate our methods across four FSL benchmarks, demonstrating consistent improvements over state-of-the-art approaches, with absolute gains of 19.72% in insertion-area-under-curve (iAUC) and 25.88% in deletion-area-above-curve (dAAC). Our posthoc design ensures seamless integration with various architectures, including Conv64F, ResNet12, ResNet18, and ViT. The experimental results confirm that C3A and its variant (C3A-E) provide more stable and interpretable explanations compared to existing FSL explainability methods, offering deeper insights into the episodic learning process. We have made our code publicly available at https://github.com/MountainChenCad/C3A.
Chen et al. (Thu,) studied this question.