A Simple Baseline for Open-Vocabulary Semantic Segmentation with Pre-trained Vision-Language Model

Mengde Xu, Zheng Zhang, Fangyun Wei, Yutong Lin, Yue Cao, Han Hu, Xiang Bai

Abstract

This paper introduces a simple yet powerful two-stage framework for open-vocabulary semantic segmentation by leveraging the pre-trained CLIP model. By decoupling the task into class-agnostic mask generation and mask-based region classification, the authors bridge the granularity gap between image-level vision-language models and pixel-level segmentation, achieving state-of-the-art zero-shot performance across multiple benchmarks.

1. Introduction

Traditional semantic segmentation models are typically "closed-world," meaning they are restricted to recognizing only the specific categories present in their training data. Scaling these models to a broader vocabulary is challenging because pixel-level annotation is prohibitively expensive.

In contrast, vision-language models like CLIP have mastered open-vocabulary recognition at the image level, identifying thousands of concepts without task-specific training. However, a significant granularity mismatch exists: CLIP is designed for global image analysis, while segmentation requires fine-grained, pixel-level precision. Previous attempts to integrate CLIP into segmentation using standard Fully Convolutional Networks (FCNs) often failed because pixel-level features do not align well with CLIP’s image-level training objectives.

2. Methodology

The proposed framework moves away from the standard one-stage FCN approach in favor of a decoupled two-stage process:

  1. Stage 1: Mask Proposal Generation: The model first generates a set of binary mask proposals to identify potential objects or regions (class-agnostic). While various methods were tested, the authors found that a MaskFormer model trained on a subset of "seen" classes generalizes remarkably well to "unseen" objects.
  2. Stage 2: Region Classification via CLIP: Each mask proposal is used to crop the original image. These crops are then fed into the pre-trained CLIP model. By presenting CLIP with a cropped image of a specific object rather than a single pixel or a full scene, the input granularity matches the model's original training distribution.
Overview of the two-stage open-vocabulary semantic segmentation framework, illustrating the mask proposal generation and the subsequent region classification using CLIP.

To further optimize performance, the authors employed an ensemble of strategies:

  • Direct CLIP: Utilizing the frozen CLIP image encoder on masked crops.
  • Retrained Encoder: Training a new image encoder where the final classifier weights are fixed to CLIP’s text embeddings.
  • Prompt Learning: Replacing static prompts like "a photo of a [CLASS]" with learnable prompt tokens to better adapt CLIP to the segmentation task.

3. Experiments and Datasets

The model was primarily trained on COCO Stuff, using a subset of classes to evaluate zero-shot performance on the remaining categories. Generalization was tested across several challenging benchmarks without additional fine-tuning:

  • Pascal VOC 2012 and Pascal Context
  • COCO Stuff (unseen classes)
  • Cityscapes
  • ADE20K (including both 150-class and 847-class versions)

4. Results and Key Insights

This "simple baseline" achieved significant improvements over previous specialized zero-shot segmentation methods:

  • Zero-Shot Performance: On Pascal VOC 2012, the model surpassed the previous state-of-the-art by +29.5 hIoU (harmonic mean IoU). On COCO Stuff, it improved by +8.9 hIoU.
  • Cross-Dataset Generalization: When trained on COCO and tested on entirely different datasets, it outperformed standard FCNs by massive margins, including +13.1 mIoU on Cityscapes and +19.6 mIoU on Pascal Context.
  • Scalability: The model successfully handled the ADE20K dataset with 847 classes, a scale where traditional supervised models often struggle.

Key Insights: * The Cropping Breakthrough: Cropping images based on mask proposals effectively transforms a segmentation problem into an image classification problem, aligning the task with CLIP's strengths. * Class-Agnostic Generalization: A mask generator does not need to know an object's identity to find its boundaries; the concept of "objectness" generalizes from seen to unseen categories.

5. Limitations and Future Work

Despite its success, the authors noted a performance gap between "thing" classes (discrete objects) and "stuff" classes (amorphous regions like sky or grass), as CLIP’s classification ability is stronger for distinct objects. Additionally, processing over 100 mask proposals through CLIP for every image introduces higher computational overhead than one-stage models. Future work may focus on more sophisticated prompt designs specifically tailored for spatial tasks to further unlock the potential of vision-language models in dense prediction.

Summary updated

BibTeX
@inproceedings{xu2022simple,
  author = {Mengde Xu and Zheng Zhang and Fangyun Wei and Yutong Lin and Yue Cao and Han Hu and Xiang Bai},
  title = {{A Simple Baseline for Open-Vocabulary Semantic Segmentation with Pre-trained Vision-Language Model}},
  booktitle = {European Conference on Computer Vision},
  year = {2022},
  doi = {10.1007/978-3-031-19818-2\_42},
}
Figure