LarvSeg: Exploring Image Classification Data for Large Vocabulary Semantic Segmentation via Category-Wise Attentive Classifier

Haojun Yu, Di Dai, Ziwei Zhao, Di He, Han Hu, Liwei Wang

TL;DR

LarvSeg is a new framework that scales semantic segmentation to massive vocabularies by leveraging widely available image classification data. By discovering that models naturally cluster pixels of unseen categories, the authors designed a "Category-wise Attentive Classifier" that provides precise pixel-level supervision using only image-level labels, culminating in the first-ever 21,000-category segmentation model.

What Problem Does This Paper Address?

Semantic segmentation—the task of assigning a label to every single pixel in an image—is notoriously difficult to scale. While we have image classification datasets with tens of thousands of categories, segmentation datasets are usually limited to a few hundred because drawing precise masks is labor-intensive (taking up to 80 seconds per object).

Recent "language-guided" models (like those based on CLIP) try to solve this by aligning images with text. However, these models often fail on "out-of-distribution" (OOD) categories—objects they haven't seen during fine-tuning. The authors identify a "supervision gap": vision encoders haven't actually seen the visual features of these novel categories during training, so they can't accurately map them to text prompts.

Methods

The authors introduce LarvSeg, which bridges the gap between image-level classification labels and pixel-level segmentation masks through two main components:

  1. A Simple Baseline for Joint Training: They start by training a shared backbone (ViT-B/16) on two tasks simultaneously. For segmentation data, they use standard pixel-wise loss. For classification data, they use an image-level loss by averaging the feature maps. This allows the model to "see" novel categories even without masks.
  2. Category-wise Attentive Classifier (CA-Classifier): The authors observed that even when a model is only trained on "base" classes (e.g., person, sky), its internal features already tend to group pixels of "novel" classes (e.g., sofa, radiator) together. To exploit this, they created a Memory Bank that stores representative features for novel categories.
  3. Attentive Pooling: Instead of averaging the whole image for classification (which includes background noise), the CA-Classifier uses the memory bank to generate an attention map. This map highlights the specific regions where a novel object likely exists, ensuring the image-level label provides supervision to the correct pixels.

Datasets

The researchers utilized a variety of datasets to prove the scalability of LarvSeg:

  • COCO-Stuff (C171): Used as the primary source of pixel-level "base" labels (171 categories).
  • ADE20K (A150) & ADEFull (A847): Used both for evaluation and as sources of weakly-supervised classification data.
  • ImageNet21K (I21K): The massive classification dataset used to scale the model to 21,841 categories.
  • ITPair: Web-scale image-text pairs used by baseline models for comparison.

Key Insights and Ideas

  • The "Free" Grouping Phenomenon: Perhaps the most striking insight is that a model trained on a limited set of masks already knows how to group pixels of categories it hasn't been trained on. If it knows what a "wall" and "floor" look like, it implicitly learns that the "sofa" sitting between them is a distinct, coherent cluster of pixels.
  • Classification as Coarse Supervision: Rather than needing perfect masks, the model can learn significantly from just knowing "this image contains a radiator." The CA-Classifier simply helps the model point that label at the right cluster of pixels.
  • Data Quality > Architecture: The authors argue that for large-vocabulary tasks, collecting high-quality, balanced classification data (like ImageNet21K) is more effective than designing increasingly complex model architectures.

Key Results

LarvSeg demonstrates a major leap over existing open-vocabulary methods:

  • Novel Category Performance: On the ADE20K dataset, LarvSeg outperformed the baseline on novel categories by 6.0 mIoU.
  • Superiority over Language-Only Models: It significantly beat state-of-the-art language-guided models like OpenSeg and DenseCLIP, which rely more heavily on text alignment rather than direct visual supervision from classification data.
  • The 21K Milestone: The authors produced a model capable of segmenting 21,000 categories by training on ImageNet21K. Qualitative results show the model successfully segmenting highly specific categories like "mako shark," "golden eagle," and "polyphemus moth."

Limitations and Future Work

While LarvSeg is a breakthrough in vocabulary size, some limitations remain:

  • Memory Bank Overhead: Maintaining a memory bank for 21,000 categories requires careful management of computational resources.
  • Classification Bias: The model's performance is inherently tied to the quality of the classification data. If a classification dataset is biased or has noisy labels, the segmentation performance will suffer.
  • Future Directions: The authors suggest that this framework is complementary to language-guided methods. Future work could involve combining LarvSeg's visual supervision with the flexible prompting of language-based models.

Summary updated

BibTeX
@inproceedings{yu2024larvseg,
  author = {Haojun Yu and Di Dai and Ziwei Zhao and Di He and Han Hu and Liwei Wang},
  title = {{LarvSeg: Exploring Image Classification Data for Large Vocabulary Semantic Segmentation via Category-Wise Attentive Classifier}},
  booktitle = {PRCV},
  year = {2024},
  url = {https://openreview.net/forum?id=XxOLBWrjWr},
}
Figure