Skip to main content
QUICK REVIEW

[Paper Review] ZegCLIP: Towards Adapting CLIP for Zero-shot Semantic Segmentation

Ziqin Zhou, Bowen Zhang|arXiv (Cornell University)|Dec 7, 2022
Domain Adaptation and Few-Shot LearningComputer Science9 citations
TL;DR

ZegCLIP proposes a one-stage, efficient method for zero-shot semantic segmentation by directly extending CLIP's image-level zero-shot classification to pixel-level prediction using a lightweight decoder. It achieves state-of-the-art performance on VOC, COCO, and Context datasets, outperforming prior methods by large margins and offering ~5x faster inference than two-stage baselines while maintaining strong generalization to unseen classes through three key designs: Deep Prompt Tuning, Non-mutually Exclusive Loss, and Relationship Descriptor.

ABSTRACT

Recently, CLIP has been applied to pixel-level zero-shot learning tasks via a two-stage scheme. The general idea is to first generate class-agnostic region proposals and then feed the cropped proposal regions to CLIP to utilize its image-level zero-shot classification capability. While effective, such a scheme requires two image encoders, one for proposal generation and one for CLIP, leading to a complicated pipeline and high computational cost. In this work, we pursue a simpler-and-efficient one-stage solution that directly extends CLIP's zero-shot prediction capability from image to pixel level. Our investigation starts with a straightforward extension as our baseline that generates semantic masks by comparing the similarity between text and patch embeddings extracted from CLIP. However, such a paradigm could heavily overfit the seen classes and fail to generalize to unseen classes. To handle this issue, we propose three simple-but-effective designs and figure out that they can significantly retain the inherent zero-shot capacity of CLIP and improve pixel-level generalization ability. Incorporating those modifications leads to an efficient zero-shot semantic segmentation system called ZegCLIP. Through extensive experiments on three public benchmarks, ZegCLIP demonstrates superior performance, outperforming the state-of-the-art methods by a large margin under both "inductive" and "transductive" zero-shot settings. In addition, compared with the two-stage method, our one-stage ZegCLIP achieves a speedup of about 5 times faster during inference. We release the code at https://github.com/ZiqinZhou66/ZegCLIP.git.

Motivation & Objective

  • To simplify the two-stage pipeline of existing CLIP-based zero-shot semantic segmentation methods, which require separate image encoders for region proposal and CLIP inference.
  • To directly transfer CLIP's image-level zero-shot classification capability to pixel-level segmentation without fine-tuning the vision encoder.
  • To improve generalization to unseen classes while maintaining strong performance on seen classes in both inductive and transductive zero-shot settings.
  • To develop a lightweight, efficient, and end-to-end one-stage framework that avoids overfitting to seen classes while preserving CLIP's inherent zero-shot capacity.

Proposed method

  • Proposes a one-stage framework that uses CLIP's patch embeddings and a learnable decoder to match text prompts directly with local image features at the pixel level.
  • Applies Deep Prompt Tuning (DPT) to fine-tune the CLIP text encoder instead of updating the vision encoder, preserving CLIP's zero-shot generalization ability.
  • Introduces a Non-mutually Exclusive Loss (NEL) that uses sigmoid cross-entropy to allow independent prediction of multiple classes, improving performance on long-tail and novel classes.
  • Incorporates a Relationship Descriptor (RD) that injects image-level semantic priors into text embeddings before matching, reducing overfitting to seen classes.
  • Uses a lightweight decoder with self-attention to perform pixel-wise classification by comparing text embeddings with CLIP patch features.
  • Employs a hybrid training strategy where the vision encoder is either fixed or tuned via DPT, and the decoder is trained end-to-end on a subset of seen classes.

Experimental results

Research questions

  • RQ1Can CLIP's image-level zero-shot classification capability be directly extended to pixel-level segmentation in a one-stage manner without requiring two separate image encoders?
  • RQ2Why does a naive one-stage extension of CLIP for semantic segmentation fail to generalize to unseen classes, and what causes overfitting to seen classes?
  • RQ3How can the inherent zero-shot generalization capacity of CLIP be preserved during fine-tuning or adaptation for dense prediction tasks?
  • RQ4What specific architectural or training modifications can significantly improve zero-shot generalization to novel classes while maintaining performance on seen classes?
  • RQ5Can a single, unified framework handle both inductive and transductive zero-shot semantic segmentation without requiring prior knowledge of unseen class names during training?

Key findings

  • ZegCLIP achieves a mean IoU of 91.9% on seen classes and 77.8% on unseen classes on the VOC dataset under the inductive setting, outperforming prior SOTA methods.
  • On the COCO dataset, ZegCLIP achieves 41.4% mIoU on unseen classes, a significant improvement over the 39.0% of the baseline and 40.2% of the previous SOTA.
  • The Relationship Descriptor (RD) alone boosts unseen mIoU by nearly 10 percentage points on VOC and COCO, demonstrating its critical role in preventing overfitting.
  • ZegCLIP achieves ~5x faster inference than two-stage methods like zsseg and ZegFormer, due to eliminating the need for region proposal generation and separate CLIP encoding.
  • When transferring from COCO to Context, ZegCLIP achieves 41.2% mIoU and 68.4% mAcc, outperforming ZegFormer’s 36.1% mIoU and 64.0% mAcc, showing strong cross-domain generalization.
  • The combination of Deep Prompt Tuning, NEL, and RD leads to a 94.6% pixel accuracy and 91.9% mIoU on seen classes, with a 77.8% mIoU on unseen classes, confirming the effectiveness of the full design.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.