Improving Visual Discriminability of CLIP for Training-Free Open-Vocabulary Semantic Segmentation

Jinxin Zhou, Jiachen Jiang, Zhihui Zhu · DOI

Introduction

Contrastive Language-Image Pre-training (CLIP) has become the standard for zero-shot image-text matching. However, its application to dense prediction tasks like semantic segmentation reveals a significant limitation: as features progress through the Transformer layers, they lose local visual discriminability in favor of global semantic alignment. This "vision-language trade-off" makes it difficult to extract precise object boundaries from the final layers of a frozen CLIP model.

The Problem: The Vision-Language Trade-off

The primary challenge in using CLIP for segmentation is the misalignment of objectives. CLIP is optimized for global image-level classification. Consequently, deeper layers tend to aggregate information into global concepts, effectively "blurring" spatial details.

Visual discriminability follows an inverted U-curve across layers, while semantic alignment increases monotonically.

As shown in the analysis across multiple datasets and backbones, visual discriminability peaks in middle layers and then sharply declines. By the final layer, the features are often too "noisy" or biased toward global text matching to support accurate pixel-level segmentation.

Proposed Method: LHT-CLIP

To address these issues without additional training, the authors introduce LHT-CLIP, a framework that intervenes at three levels:

1. Abnormal Token Replacement (ATR)

The researchers identified "abnormal tokens" in deep layers—outliers with disproportionately high norms and sparse activations. These tokens act as a learned global bias that obscures local details.

Visualization of abnormal tokens (yellow boxes) emerging in deeper layers (7-11), which distract the attention mechanism from local object features.

ATR detects these tokens using the Hoyer score (a sparsity metric) and replaces them with a local neighborhood average, effectively "cleaning" the feature map of global noise.

2. Spatial-Semantic Reweighting (SSR)

To preserve structural information, SSR upweights the residual (skip) connections in the final layers. This ensures that the high-resolution spatial features from earlier layers are not completely overwritten by the semantic-heavy updates of the deep Transformer blocks.

3. Selective Head Enhancement (SHE)

Analysis revealed that only a small subset of attention heads—"expert heads"—maintain high visual discriminability. SHE identifies these heads to generate high-quality pseudo-masks, which are then used to refine and sharpen the final segmentation boundaries.

Key Results

LHT-CLIP serves as a plug-and-play enhancement for existing training-free methods like SCLIP, ClearCLIP, and ResCLIP.

  • Performance Gains: It achieved state-of-the-art results across eight benchmarks. For instance, it improved the SCLIP baseline by +3.3% mIoU and ClearCLIP by +3.5%.
  • Efficiency: By avoiding heavy post-processing like PAMR, LHT-CLIP is significantly faster than competitors, reaching 8.2 FPS compared to ResCLIP’s 3.0 FPS.
  • Robustness: The method scales effectively from ViT-B to ViT-L backbones, confirming that it addresses fundamental architectural biases in CLIP.

Conclusion

LHT-CLIP demonstrates that the "vision" in CLIP can be restored for dense tasks by identifying and mitigating the biases inherent in its deep layers. By focusing on abnormal tokens, residual weighting, and expert heads, it provides a powerful, training-free solution for open-vocabulary semantic segmentation.

Summary updated

BibTeX
@article{zhou2025improving,
  author = {Jinxin Zhou and Jiachen Jiang and Zhihui Zhu},
  title = {{Improving Visual Discriminability of CLIP for Training-Free Open-Vocabulary Semantic Segmentation}},
  journal = {Accepted by TMLR},
  year = {2025},
  url = {https://openreview.net/forum?id=9spNW3DXg5},
}
Figure