CIM: Class-Irrelevant Mapping for Few-Shot Classification

Shuai Shao, Lei Xing, Yixin Chen, Yanjiang Wang, Bao-Di Liu, Yicong ZhouarXiv 2021

Introduction

Few-shot classification (FSC) models are often evaluated solely on final accuracy, leaving their internal decision-making processes as "black boxes." This lack of interpretability makes it difficult to determine if a model is learning generalizable features or simply overfitting to noise in novel classes. This paper introduces Class-Irrelevant Mapping (CIM), a label-agnostic visualization tool that identifies model focus using dictionary learning, bypassing the need for class labels or backpropagation.

The Interpretability Gap in Few-Shot Learning

In FSC, models are pre-trained on base datasets and then tasked with recognizing novel categories from very few examples. A critical challenge is evaluating the Feature Extraction Model (FEM): does it focus on relevant semantic parts of a novel object (e.g., the beak of a bird it has never seen before)?

Existing tools like Class Activation Mapping (CAM) require class labels and backpropagation. However, in the meta-test phase of FSC, classifiers are often simple (e.g., SVMs) and applied to frozen features, precluding backpropagation. Moreover, the scarcity of labels for novel classes makes them unreliable for activating feature maps. CIM addresses this by providing a label-agnostic way to visualize model attention.

Methodology: Class-Irrelevant Mapping (CIM)

CIM treats visualization as a dictionary learning task. The channels of a convolutional feature map are viewed as "bases" in a dictionary, representing various visual patterns the model has learned to recognize.

The CIM architecture using dictionary learning to generate heatmaps.

The process involves several key components:

  1. SDFC Layer: A "Specific Dictionary Fully Connected" layer is introduced, with dimensions matching the spatial size of the feature map (Height × Width).
  2. Optimization: The importance of each channel for a specific image is determined by solving an optimization problem using the Alternating Direction Method of Multipliers (ADMM). This finds a sparse set of weights that best reconstruct the image's feature vector using the feature map channels as building blocks.
  3. Heatmap Generation: By overlaying these weighted feature maps, CIM produces a heatmap showing where the model is focusing.

Quantifying Interpretability: FLA Metric

To move beyond subjective "eye-balling" of heatmaps, the authors propose Feature Localization Accuracy (FLA), which utilizes ground-truth bounding boxes to quantify model focus.

Visualization of Feature Localization Accuracy (FLA) metrics.
  • FLA-1: Measures how much of the model's focus is contained inside the object's bounding box.
  • FLA-2: Measures what proportion of the model's total focus is concentrated within that box.

Experimental Results and Insights

The researchers evaluated CIM on standard benchmarks, including mini-ImageNet and tiered-ImageNet. Key findings include:

  • Generalizability: CIM performs comparably to CAM on base data, establishing it as a reliable, label-free alternative.
  • Architecture Sensitivity: ResNet-12 was found to be a "sweet spot" for FSC. CIM visualizations suggest that deeper networks like ResNet-34 may actually lose localization precision when dealing with novel data.
  • Self-Supervision Benefits: Models trained with auxiliary self-supervised tasks (e.g., rotation prediction) showed higher FLA scores, confirming that self-supervision helps the FEM learn more robust, localized features that generalize better.
  • Minimal Performance Impact: Integrating the SDFC layer for CIM resulted in negligible changes to classification accuracy (usually <1%), allowing for interpretability without sacrificing performance.

Conclusion

CIM provides a powerful tool for peering into the "black box" of few-shot classifiers. By decoupling visualization from labels and backpropagation, it enables a more rigorous evaluation of feature extraction. Future work may involve incorporating graph regularization to further refine heatmap accuracy in complex scenes.

Summary updated

BibTeX
@misc{shao2021cim,
  author = {Shuai Shao and Lei Xing and Yixin Chen and Yanjiang Wang and Bao-Di Liu and Yicong Zhou},
  title = {{CIM: Class-Irrelevant Mapping for Few-Shot Classification}},
  year = {2021},
  eprint = {2109.02840},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2109.02840},
}
Figure