Enhancing Few-Shot Classification without Forgetting through Multi-Level Contrastive Constraints

Bingzhi Chen, Haoming Zhou, Yishu Liu, Biqing Zeng, Jiahui Pan, Guangming Lu · DOI

Abstract

Few-shot classification (FSC) aims to recognize novel categories from a limited number of labeled examples. However, existing meta-learning approaches often suffer from two critical issues: inductive bias, where models overfit to small sample sizes, and catastrophic forgetting, where knowledge from previous training episodes is lost. We propose the Multi-Level Contrastive Constraints (MLCC) framework to address these challenges. By integrating a multi-view episodic augmentation scheme, space-aware interaction modeling, and cross-stage distribution alignment, MLCC structures the embedding space more effectively and preserves historical knowledge. Experimental results across general, fine-grained, and cross-domain benchmarks demonstrate that MLCC achieves state-of-the-art performance, offering superior generalization and robustness.

The Challenges of Few-Shot Classification

Few-shot classification typically employs meta-learning, where a model is trained on a series of "episodes" to learn generalizable features. Despite its success, two persistent hurdles remain:

  1. Inductive Bias: When presented with only 1–5 samples, a model may latch onto irrelevant or highly correlated features that do not represent the class broadly. For instance, distinguishing between wolves and dogs based on a tiny sample might lead the model to over-associate specific background textures rather than semantic differences.
  2. Catastrophic Forgetting: Over thousands of training episodes, models tend to prioritize information from the most recent tasks. This leads to a gradual loss of broader semantic knowledge gained from earlier episodes, degrading the model's ability to generalize to truly novel classes.

The MLCC Framework

The MLCC framework operates on three distinct levels to refine how the model perceives and remembers data, ensuring a more balanced and robust feature representation.

Multi-view Episode Scheme

To combat inductive bias, MLCC utilizes data augmentation to create two different "views" for every training episode. It generates class prototypes for each view and a "hybrid" prototype that blends them. This process forces the model to identify consistent, invariant features across different versions of the same data, reducing the risk of overfitting to specific image quirks.

Space-aware Interaction Modeling

This module employs two types of contrastive losses to structure the latent embedding space:

  • Inter-class Constraints: These encourage the model to push prototypes of different classes further apart, making them more distinct.
  • Intra-class Constraints: These pull individual image samples closer to their respective class prototypes, ensuring tight and well-defined clusters.

Cross-stage Distribution Adaptation

To mitigate catastrophic forgetting, MLCC maintains a "History Memory." It introduces an against-forgetting loss ($L_{Forget}$) that aligns the current prediction distribution with historical distributions from previous training stages. This alignment reduces the "semantic gap" between past and present knowledge without the high computational cost of re-playing old data.

Experimental Results and Evaluation

MLCC was evaluated on a comprehensive suite of benchmarks, consistently outperforming existing state-of-the-art (SOTA) methods such as DeepBDC and SetFeat.

  • General Performance: On the miniImageNet dataset (5-way 5-shot), MLCC achieved an accuracy of 85.61%, representing a significant improvement over previous benchmarks.
  • Fine-grained Mastery: On the CUB (birds) dataset, the model reached 94.34% in the 5-shot setting. This demonstrates a superior ability to distinguish between very similar categories, such as different species of birds, where subtle feature differences are critical.
  • Cross-domain Robustness: In scenarios involving domain shift (e.g., training on miniImageNet and testing on Stanford Cars or FGVC-Aircraft), MLCC showed substantial gains. This suggests that the features learned through multi-level constraints are more "universal" and less prone to domain-specific overfitting.

Conclusion and Future Directions

The MLCC framework effectively addresses the dual challenges of inductive bias and catastrophic forgetting in few-shot classification. By leveraging contrastive learning as a powerful regularizer and aligning historical distributions, it creates a more structured and resilient embedding space.

While highly effective, future work may address the computational overhead associated with generating multiple views and calculating complex constraints. Additionally, exploring how this framework scales to "large-way" tasks (e.g., 20-way or 50-way classification) could further validate its utility in increasingly complex real-world environments.

Summary updated

BibTeX
@inproceedings{chen2024enhancing,
  author = {Bingzhi Chen and Haoming Zhou and Yishu Liu and Biqing Zeng and Jiahui Pan and Guangming Lu},
  title = {{Enhancing Few-Shot Classification without Forgetting through Multi-Level Contrastive Constraints}},
  booktitle = {ICME},
  year = {2024},
  doi = {10.1109/icme57554.2024.10688320},
}
Figure