TL;DR
This paper introduces CLIPer, a novel training-free method that enhances CLIP's ability to perform open-vocabulary semantic segmentation by hierarchically improving its spatial representations. CLIPer achieves state-of-the-art results by leveraging early-layer CLIP features for spatial coherence and incorporating fine-grained details from Stable Diffusion for improved segmentation accuracy.
What Problem Does This Paper Address?
Open-vocabulary semantic segmentation aims to identify and label objects in an image with categories not seen during training. While pre-trained vision-language models like CLIP excel at image-level classification, adapting them for pixel-level segmentation without retraining is challenging. The core issue lies in CLIP's inherent focus on global image features, which often leads to coarse spatial representations unsuitable for precise segmentation. Existing methods primarily focus on modifying the last layer of CLIP, but this paper argues for a hierarchical approach that leverages information from earlier layers and external generative models to capture both global coherence and local details.
Methods
CLIPer is a two-component framework designed to hierarchically improve CLIP's spatial representation for segmentation:
- Early-Layer Fusion: This module exploits the observation that CLIP's early-layer embeddings and attention maps retain valuable spatial structural information. It fuses these early-layer features with the standard CLIP pipeline to generate segmentation maps with better spatial coherence. This is achieved by aggregating early-layer attention maps and then using these to refine the final patch embeddings.
- Fine-Grained Compensation: Recognizing that CLIP's spatial representations can still be coarse in local details, CLIPer incorporates a module that leverages the rich local information from Stable Diffusion (SD). Specifically, it uses the self-attention maps from SD, which are known to capture fine-grained details, to refine the coarse segmentation maps produced by the early-layer fusion. This compensation step helps to improve the accuracy of object contours and local details.
Datasets
The paper evaluates CLIPer on eight standard semantic segmentation datasets:
- PASCAL VOC (VOC)
- PASCAL Context (Context)
- COCO Object (Object)
- PASCAL VOC (VOC20)
- PASCAL Context (Context59)
- COCO-Stuff (Stuff)
- Cityscapes
- ADE20K (ADE)
Key Insights and Ideas
- Hierarchical Improvement is Key: Instead of solely focusing on the last layer of CLIP, CLIPer demonstrates that a hierarchical approach, integrating information from early layers, significantly boosts spatial coherence.
- Early Layers Hold Spatial Secrets: CLIP's early-layer embeddings and attention maps, often overlooked, contain crucial spatial information that can be leveraged for better segmentation.
- Generative Models as Detail Enhancers: Stable Diffusion, a powerful generative model, provides high-quality attention maps that effectively capture local details, proving invaluable for refining coarse segmentations.
- Training-Free Efficacy: The proposed method achieves state-of-the-art performance without requiring any additional training, making it highly practical for zero-shot segmentation tasks.
Key Results
CLIPer achieves state-of-the-art performance on eight segmentation datasets. With the ViT-L backbone and sliding-window inference, it reaches an mIoU of 72.2% on VOC and 44.7% on Object, outperforming ProxyCLIP by 11.6% and 5.5%, respectively. Even without sliding-window inference, CLIPer shows significant improvements over existing methods. The method also demonstrates strong performance in image-level category classification and mask prediction. Qualitative results show that CLIPer produces more accurate segmentation maps with finer details compared to other approaches.
Limitations and Future Work
The authors acknowledge that CLIPer, like many segmentation methods, struggles with accurately segmenting very small objects. For future work, they propose exploring adaptations for high-resolution inputs to improve tiny object segmentation. Additionally, they suggest investigating better image-text pre-training strategies, potentially leveraging frozen Stable Diffusion models, for even higher-quality open-vocabulary segmentation.
Summary updated