Simpler is Better: Few-shot Semantic Segmentation with Classifier Weight Transformer

Zhihe Lu, Sen He, Xiatian Zhu, Li Zhang, Yi-Zhe Song, Tao Xiang

Introduction

Few-shot Semantic Segmentation (FSS) aims to enable models to segment novel object classes using only a minimal number of labeled examples, known as the support set. Traditional approaches in FSS typically involve "meta-learning" the entire deep neural network—including the encoder, decoder, and classifier—to adapt to these new objects. However, this paper argues that such complexity is often counterproductive. Adapting a model with millions of parameters using a single image is inherently prone to overfitting and struggles with intra-class variation.

The authors propose a "simpler is better" philosophy: by freezing a robust, pre-trained encoder-decoder and focusing meta-learning exclusively on a lightweight "Classifier Weight Transformer" (CWT), the model achieves state-of-the-art performance with significantly reduced complexity and faster inference.

Methodology: The Shift to Classifier Meta-Learning

The proposed framework operates in two distinct stages, moving away from the paradigm of full-model adaptation.

  1. Stage 1: Standard Pre-training. A standard segmentation model (e.g., PSPNet) is trained on a diverse set of base classes. Following this, the encoder and decoder are frozen. These components are assumed to have learned "class-agnostic" features—shapes, textures, and spatial relationships—that are sufficiently rich for segmenting unseen classes.
  2. Stage 2: Classifier Meta-learning. Instead of fine-tuning the entire network, the authors introduce the Classifier Weight Transformer (CWT). This module uses a self-attention mechanism to dynamically adjust the weights of a simple linear classifier based on the specific features of the query image.
Comparison between existing meta-learning methods and the proposed CWT approach.

The CWT allows the model to handle intra-class variation by "nudging" the classifier's base identity (derived from the support image) to better match the specific lighting, pose, or style of the query image. This inductive adaptation ensures that the final decision-maker is tailored to the current test instance without the risk of catastrophic forgetting or overfitting associated with full-model updates.

Experimental Results

The researchers evaluated CWT on the PASCAL-5$^i$ and COCO-20$^i$ benchmarks, as well as in challenging cross-domain settings.

Performance on COCO-20$^i$

On the large-scale COCO-20$^i$ dataset, the CWT approach consistently outperformed complex state-of-the-art models. In the 1-shot setting, it achieved a mean Intersection over Union (mIoU) of 32.9%, representing a 2.3% improvement over previous methods. This gap widened to nearly 5% in the 5-shot setting.

Quantitative comparison of CWT against state-of-the-art methods on the COCO-20i dataset.

Robustness and Efficiency

The model's simplicity translates directly into robustness and speed. In cross-domain tests (training on COCO and testing on PASCAL), CWT outperformed competitors by a significant 9.9% in the 1-shot setting, suggesting that focusing on the classifier makes the model much more resilient to domain shifts. Furthermore, the model achieves an inference speed of 21.7 FPS, making it practical for real-time applications.

Conclusion and Future Work

The success of the Classifier Weight Transformer demonstrates that feature reuse is a powerful tool in few-shot learning. By treating the feature extractor as a universal tool and focusing adaptation on the final classification layer, the authors achieved superior results with less computational overhead.

While CWT effectively manages common variations, it still faces challenges with extreme appearance changes, such as severe occlusions or drastic viewpoint shifts. Future research may explore incorporating geometric or structural priors into the transformer architecture to better model these extreme variations.

Summary updated

BibTeX
@inproceedings{lu2021simpler,
  author = {Zhihe Lu and Sen He and Xiatian Zhu and Li Zhang and Yi-Zhe Song and Tao Xiang},
  title = {{Simpler is Better: Few-shot Semantic Segmentation with Classifier Weight Transformer}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2021},
  doi = {10.1109/iccv48922.2021.00862},
}
Figure