Mining Latent Classes for Few-shot Segmentation

Lihe Yang, Wei Zhuo, Lei Qi, Yinghuan Shi, Yang Gao · DOI

Introduction

Few-shot segmentation (FSS) is a challenging computer vision task that requires a model to segment novel object classes in a query image given only a few labeled examples, known as the "support set." While traditional deep learning models require thousands of examples to learn a new category, FSS aims for rapid generalization. However, current state-of-the-art FSS models often struggle with two fundamental issues: the treatment of the background as a monolithic, uninformative void and the statistical bias inherent in small support samples.

This paper introduces a novel framework that re-evaluates the role of the background during training. By mining "latent" novel classes within the background and rectifying biased prototypes with global statistics, the authors achieve superior performance while maintaining a highly efficient architecture.

The Problem: Feature Undermining and Prototype Bias

Most existing FSS models suffer from Feature Undermining. During the training phase, models are typically taught to segment "base" classes (e.g., dogs) while treating everything else as "background." This is problematic because the background often contains objects that belong to "novel" classes (e.g., cats or people) which the model will be expected to segment during the testing phase. By labeling these potential novel classes as background, the training process inadvertently "smooths out" their features, making them harder to distinguish later.

Furthermore, models face Prototype Bias. A "prototype" is a representative feature vector derived from the support images. Because the support set is extremely small (often just one image), these prototypes rarely capture the full statistical variety of a class, leading to poor generalization when the query image features a different viewpoint or lighting condition.

Methodology

The proposed framework addresses these issues through a joint-training approach that combines offline annotation with an efficient online training phase.

The overall framework consisting of offline annotation and joint training phases.

1. Mining Latent Classes

Instead of ignoring the background, the authors use K-Means clustering on foreground features from the base classes to identify "transferable sub-clusters." These sub-clusters represent general visual primitives—such as "four legs," "furry texture," or "metallic surface"—that are shared across many categories.

In the Offline Annotation phase, these clusters are used to "pseudo-label" the background in training images. This transforms the standard binary segmentation task (base class vs. background) into a multi-class task where the model must also recognize these latent classes. This prevents the model from suppressing the features of unseen objects.

2. Global Background Prototype

Standard FSS models calculate a background prototype based solely on the current support image. This paper introduces a Global Background Prototype maintained via an Exponential Moving Average (EMA) across the entire training set. This provides a stable, "universal" representation of what constitutes "not-the-object," helping the model better distinguish the target class from complex backgrounds.

3. Foreground Prototype Rectification

To mitigate the bias of small support samples, the model searches the training set for regions most similar to the current support class. These retrieved features are used to "rectify" or boost the support prototype during inference, ensuring it is more representative of the class's global distribution.

Key Insights and Results

The core "aha moment" of this research is that the background is a goldmine of training data. By giving the model a proxy task to categorize the background, it learns more discriminative features that transfer better to unseen objects. This is achieved without architectural bloat; the method uses a plain ResNet backbone and a lightweight segmentation head.

Qualitative results showing the identification of latent classes (e.g., persons) alongside base classes.

Performance and Efficiency

The model was evaluated on the standard PASCAL-5ⁱ and COCO-20ⁱ benchmarks, yielding significant improvements:

  • Accuracy: The method outperformed previous state-of-the-art models by 3.7% mIoU on PASCAL-5ⁱ and a massive 7.0% mIoU on COCO-20ⁱ.
  • Efficiency: Despite the higher accuracy, the model uses 74% fewer parameters (8.7M vs. ~34M for competitors) and achieves 2.5x faster inference speeds.
  • Semi-Supervised Potential: The authors demonstrated that their latent mining branch can leverage extra unlabeled data to further boost performance, proving the robustness of the pseudo-labeling approach.

Conclusion

By shifting the perspective on background data from "noise" to "latent knowledge," this paper provides a more effective and efficient path for few-shot segmentation. The combination of latent class mining and statistical prototype rectification allows for high-performance segmentation with a fraction of the computational cost of previous methods. Future work may involve integrating the offline clustering step into an end-to-end online process to further streamline the pipeline.

Summary updated

BibTeX
@inproceedings{yang2021mining,
  author = {Lihe Yang and Wei Zhuo and Lei Qi and Yinghuan Shi and Yang Gao},
  title = {{Mining Latent Classes for Few-shot Segmentation}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2021},
  doi = {10.1109/iccv48922.2021.00860},
}
Figure