Source-linked AI summary

Rethinking Semantic Segmentation: A Prototype View

Tianfei Zhou, Wenguan Wang, Ender Konukoglu, Luc Van Gool

arXiv:2203.15102v2cs.CV

TL;DR

Existing segmentation methods can be viewed as parametric learners of class prototypes, but single learned prototypes limit intra-class representation and scale with vocabulary size. The paper replaces them with sets of non-learnable, data-derived prototypes and prototype-anchored metric learning, achieving strong results across architectures and datasets, including large-vocabulary settings.

  • Problem

    Existing segmentation methods use fully parametric class representations that often provide one prototype per class and require parameters that grow with the number of classes.

  • Method

    The framework builds each class from non-learnable prototypes formed from mean embedded training pixels and predicts each pixel by nearest-prototype retrieval while optimizing the embedding space.

  • Results

    The method yields compelling results across ADE20K, Cityscapes, and COCO-Stuff with FCN-based and attention-based models, including an mIoU score of 43.3% on COCO-Stuff with MiT-B4.

  • Takeaways & Limitations

    Non-learnable prototypes provide explicit class-level statistics, support nonparametric pixel-category prediction, and directly optimize the feature embedding space.

  • Takeaways & Limitations

    Training requires clustering, which increases time complexity, although clustering 10K pixels into 10 prototypes takes about 2.5 ms in practice.

Abstract

from arXiv · show

Prevalent semantic segmentation solutions, despite their different network designs (FCN based or attention based) and mask decoding strategies (parametric softmax based or pixel-query based), can be placed in one category, by considering the softmax weights or query vectors as learnable class prototypes. In light of this prototype view, this study uncovers several limitations of such parametric segmentation regime, and proposes a nonparametric alternative based on non-learnable prototypes. Instead of prior methods learning a single weight/query vector for each class in a fully parametric manner, our model represents each class as a set of non-learnable prototypes, relying solely on the mean features of several training pixels within that class. The dense prediction is thus achieved by nonparametric nearest prototype retrieving. This allows our model to directly shape the pixel embedding space, by optimizing the arrangement between embedded pixels and anchored prototypes. It is able to handle arbitrary number of classes with a constant amount of learnable parameters. We empirically show that, with FCN based and attention based segmentation models (i.e., HRNet, Swin, SegFormer) and backbones (i.e., ResNet, HRNet, Swin, MiT), our nonparametric framework yields compelling results over several datasets (i.e., ADE20K, Cityscapes, COCO-Stuff), and performs well in the large-vocabulary situation. We expect this work will provoke a rethink of the current de facto semantic segmentation model design.

1. Introduction

Modern semantic segmentation methods can be unified as parametric learners of class prototypes, whether they use softmax weights or query vectors. The paper proposes non-learnable prototypes to address representation, scalability, and embedding-space limitations.

  • Existing paradigms: FCN-based and attention-based segmentation methods use either parametric softmax or pixel-query decoding, but both learn class-wise prototypes.Softmax weights and query vectors serve as learnable prototype representations.
  • Limitations: Existing methods typically learn one fully parametric prototype per class, which cannot capture rich intra-class variation or prototype representativeness.The paper identifies this as a central limitation of the prevailing regime.
  • Limitations: At least D×C prototype parameters are required to map H×W×D features to H×W×C masks, limiting scalability for large vocabularies.For 800 classes and D=512, prototype learning alone requires 0.4M parameters.
  • Proposed approach: The proposed framework represents each class with non-learnable sub-cluster centers selected from embedded training pixels and predicts pixels by nearest-prototype retrieval.This replaces directly learned class weights or query vectors with data-derived prototypes.
  • Proposed approach: Prototype-anchored metric learning directly shapes the pixel embedding space using inductive biases such as intra-class compactness and inter-class separation.The method optimizes embedding structure rather than prediction accuracy alone.
  • Empirical scope: Across ADE20K, Cityscapes, and COCO-Stuff, the method performs strongly with FCN-based and attention-based models and remains effective as classes increase from 150 to 847.It also reduces learnable parameters without adding testing computational overhead.

2. Existing Semantic Segmentation Models as Parametric Prototype Learning

The paper recasts softmax projection and pixel-query decoding as the same learnable-prototype framework. This view exposes weaknesses in prototype coverage, parameter scalability, and feature-space supervision.

  • Prototype-based classification: Prototype-based classification assigns a sample to the class of the prototype with the strongest proximity according to a feature-space distance measure.The framework typically uses ℓ2 distance, although other proximity measures are possible.
  • Unified prototype view: Parametric softmax and pixel-query methods can be written in a unified form where each class has one learnable prototype.The prototype is a softmax weight or query vector, with M=C prototypes for C classes.
  • Limitations: Learning only one prototype per class fails to represent intra-class variation, while fully parametric learning ignores whether prototypes are representative.The paper identifies prototype selection as vital for prototype-based learning.
  • Limitations: Prototype parameters grow with the number of classes, requiring at least 0.4M parameters for 800 classes with 512-dimensional features.Representing each class with ten prototypes would increase this requirement to 4M parameters.
  • Limitations: Dense prediction losses such as cross-entropy often overlook inductive biases including intra-class compactness, reducing the discrimination potential of segmentation features.The critique concerns direct optimization of pixel-wise prediction without explicitly structuring feature distributions.

3. Non-Learnable Prototype based Nonparametric Semantic Segmentation

The framework represents each class with multiple non-learnable prototypes derived from embedded training pixels, then predicts labels by nearest-prototype retrieval. Online clustering and prototype-anchored metric objectives shape compact, discriminative pixel embeddings without adding class-specific learnable parameters.

  • Prototype-based classification: Each class is represented by K non-learnable prototypes, each defined as a sub-cluster center of its embedded training pixels.The prototypes capture within-class characteristic properties without extra learnable parameters outside the feature extractor.
  • Prototype-based classification: Pixel categories are predicted by winner-take-all retrieval using the closest prototype across classes and negative cosine similarity.The pixel embedding and prototypes are ℓ2-normalized, and class distance is determined by the closest prototype.
  • Online prototype assignment: Online clustering assigns same-class pixels to prototypes while enforcing unique assignments and average equipartition, preventing collapse onto one prototype.Sinkhorn-Knopp relaxation solves the constrained assignment efficiently on GPU; clustering 10K pixels into 10 prototypes takes 2.5 ms in practice.
  • Prototype-anchored training: Pixel-prototype contrastive learning pulls each embedding toward its assigned positive prototype and away from irrelevant prototypes.Unlike pixel-pair metric learning, the contrastive computation uses only CK prototypes, avoiding large memory costs and heavy pairwise comparisons.
  • Prototype-anchored training: Distance optimization directly minimizes each pixel's distance to its assigned prototype, reducing intra-cluster variation while preserving separation between different assignments.The objective is applied to ℓ2-normalized embeddings and prototypes, improving robustness against outliers according to the authors.
  • Prototype updates and retrieval: Prototype updates use momentum-based centers of online-clustered embedded pixels, while segmentation retrieves the most similar subclass centers.For person and car classes with K = 3 prototypes each, visualization shows prototypes corresponding to meaningful within-class patterns.

4. Related Work

Related work spans semantic segmentation, prototype learning, and metric learning, while positioning this method among nonparametric and embedding-based approaches. The paper distinguishes its sample-cluster prototypes and online assignments from prior methods using learnable or region-level prototypes.

  • Semantic segmentation: Semantic segmentation has progressed across CNN and Transformer-like backbones and from FCNs to attention-based networks.The review identifies VGG and ResNet as CNN examples, ViT and Swin as Transformer-like backbones, and SegFormer as an attention network.
  • Prototype learning: Most current segmentation approaches are framed as learnable-prototype methods, whereas earlier non-deep systems often used nonparametric reasoning.The paper treats softmax weights and query vectors as learnable class prototypes in modern methods.
  • Metric learning: Prior metric-learning segmentation methods regularize representations but still infer pixel classes through parametric softmax, while fully trainable class embeddings remain parametric.The paper therefore distinguishes embedding regularization from nonparametric classification.
  • Nonparametric segmentation: The proposed approach derives prototypes from sample clusters and obtains online assignments, scaling to any dataset size while directly optimizing the embedding space.It contrasts with a prior non-learnable deep segmentation model that uses image regions as prototypes and incurs substantial memory and computational demand.

5. Experiment

Experiments across ADE20K, Cityscapes, and COCO-Stuff show consistent gains over parametric and baseline models, including large-vocabulary settings. The method also reduces prototype parameters and retains competitive computational properties.

  • The nonparametric scheme consistently improves over baselines with fewer learnable parameters across ADE20K, Cityscapes, and COCO-Stuff.
  • Quantitative Results: 43.3% mIoU on COCO-Stuff test with MiT-B4 establishes a new state-of-the-art.
  • Qualitative Results: The method produces more accurate qualitative predictions than SegFormer across ADE20K, Cityscapes, and COCO-Stuff.
  • Large-Vocabulary Semantic Segmentation: For 847 classes, the parametric scheme uses 6.5 M prototype parameters, whereas the nonparametric scheme uses none.
  • Diagnostic Experiment: Cosine distance performs much better than unnormalized Euclidean measurements in the diagnostic study.

6. Conclusion and Discussion

The paper frames semantic segmentation as predominantly parametric class representation learning and explores an exemplar-based nonparametric alternative. It reports broad performance and generalization benefits while identifying interpretability-oriented prototype optimization as future work.

  • The framework represents classes with several typical embedding-space points, assigning pixels by distance to class prototypes.
  • Its advantages include explicit class-statistics modeling, nonparametric pixel-category prediction, and direct feature-embedding optimization.
  • The authors suggest optimizing prototypes to resemble pixel- or region-level observations for better interpretability.

A. Large-Vocabulary Dataset Description

The large-vocabulary study uses ADE20K-Full and selects shared train-validation concepts by frequency to construct several vocabulary sizes.

  • ADE20K-Full contains 25K training images and 2K validation images with more than 3,000 annotated semantic concepts.
  • The study retains 847 concepts appearing in both train and validation sets.
  • ADE20K-x variants use the top 300, 500, 700, or 847 classes ranked by appearing frequency.
  • The online clustering algorithm uses a small number of matrix-matrix products and runs efficiently on a GPU card.

C.1. Quantitative Result on Cityscapes test

On Cityscapes test, the proposed approach outperforms SegFormer and several other segmentation models under the stated training and inference setup.

  • 83.0% mIoU is achieved on Cityscapes test, 0.8% higher than SegFormer.Models are trained on train+val without coarsely labeled data, using 1024×1024 crops and sliding-window inference.
  • The approach greatly outperforms HANet, HRNetV2, and SETR on Cityscapes test.

C.2. Quantitative Result with Lightweight Backbones

With lightweight backbones on ADE20K val, the proposed approach achieves the strongest reported performance while using the fewest parameters.

  • 38.5% mIoU is achieved with MiT-B0, alongside the smallest model size of 3.7 M parameters.

C.3. Hyper-parameter Analysis of λ1 and λ2

The model is robust to the two analyzed coefficients, with its best ADE20K val performance obtained at λ1 =0.01 and λ2 =0.01.

  • The model is robust to hyper-parameters λ1 and λ2 on ADE20K val.
  • Best performance is obtained at λ1 =0.01, λ2 =0.01.
  • The learned embedding separates pixel embeddings assigned to the same prototypes.The paper attributes this to distance-based point-wise classification and metric-learning losses that reshape the feature space.
  • Qualitative comparisons are reported on ADE20K, Cityscapes, and COCO-Stuff against SegFormer.

D. Discussion

The discussion highlights training-time clustering as a computational limitation, while identifying broader opportunities for unsupervised representation learning, interpretability, and unified classification.

  • Training requires clustering, increasing time complexity, although clustering 10K pixels into 10 prototypes takes about 2.5 ms.
  • The nonparametric model may make fuller use of unsupervised representations because it directly compares embeddings.
  • Interpretability could improve if prototypes directly resembled actual pixels or region-level observations.
  • Prototype learning could transfer a nonparametric classifier’s knowledge intactly to a nonparametric segmenter.
Loading 2203.15102v2…