arXiv:2610.30623cs.CVOct 2026

Manuscript Offprint

arXiv:2610.30623

Refining Open-Vocabulary Semantic Segmentation via Regional Semantics and Visual Prototypes

Aijing Yu, Zhengbo Wang, Lijun Sheng, Jian Liang, Xiao-Yu Zhang

ABSTRACT

Contrastive Language-Image Pre-training (CLIP) has shown superior performance in the image-level open-vocabulary classification task, benefiting from its powerful alignment of visual features and text embeddings. However, dense prediction tasks require models to perform pixel-level predictions, necessitating modifications to CLIP for region-text alignment. In this paper, we adjust the attention layers within the vanilla visual encoder of CLIP. With a novel attention calculation method for selective attention features, the model retains more regional semantic information. To further mitigate the negative impact of the modality gap, we introduce additional visual prototypes to refine the original predictor solely based on text embeddings. Specifically, patch features with confident predictions are selected to form an additional auxiliary memory-based classifier for more accurate prediction. We further integrate an optimizable feature extractor with an exponential moving average updating strategy to enhance prediction quality. Extensive experiments on 5 semantic segmentation datasets demonstrate the effectiveness of our method.

Index Terms— Semantic segmentation, Open-vocabulary, Contrastive language-image pre-training

1. INTRODUCTION

Semantic segmentation [1, 2] aims to classify an image at the pixel level, applying segmentation masks to separate diverse objects in the input. Conventional semantic segmentation methods follow a supervised paradigm, relying on manually labeled category annotations. To address the limitations of predefined categories, the Open-Vocabulary Semantic Segmentation (OVSS) task has been proposed and is receiving widespread attention. OVSS aims to effectively handle entirely new categories during inference, which may not have appeared during training. Recently, visual language models [3, 4] have shown remarkable generalization performance in image-level classification tasks [5, 6]. Inspired by this, some existing OVSS methods explore the potential of Contrastive Language-Image Pre-training (CLIP) [3] in pixel-level classification tasks. Most of them [4, 7, 8] follow a semi-supervised paradigm, utilizing both image-text pairs and additional dense annotations. Typically, these methods train a dense predictor with segmentation masks and expand target categories using image-text pairs [9, 10]. Furthermore, recent works improve feature extraction with additional image-text pairs [11], clustering features [12, 13], modifying structures [14, 15], aiming to convert image-level visual-text alignment to pixel-level visual-text alignment. MaskCLIP [14] revisits the global pooling layer of the visual encoder in the CLIP model, arguing that its value features already encompass rich pixel-level semantic information. Consequently, it directly calculates the similarity between the value features of the last attention module and the text embeddings to obtain accurate segmentation masks. However, the segmentation masks generated by MaskCLIP still exhibit noise. Recent work [16] suggests that while using the final value projection for prediction, the key and query projection in the attention module may concatenate features that do not belong to the same semantic category, thereby diminishing the correlation between pixels in neighboring regions. Additionally, existing methods remain constrained by the inherent vision-text modality gap of the CLIP.

To address the challenging OVSS task, we propose an annotation-free method to obtain high-quality segmentation masks in this work. We begin by introducing a regional semantic preservation module to refine pixel-level visual features. In this module, we modify the attention layer of the original CLIP image encoder, selectively reusing features that contain rich pixel-level semantic information. We design a novel attention calculation method for these features, enhancing regional semantic coherence by calculating the similarity of adjacent pixel-level features. To preserve local information and maintain the integrity of feature extraction, we modify only the final attention layer in pre-trained CLIP.

To mitigate the vision-language modality gap in CLIP, we further leverage additional visual prototypes of the entire unlabeled set to refine the dense predictions. For each semantic category, we select representative pixel-level features to form a visual feature memory module. Serving as an auxiliary dense predictor, the memory module computes the similarity of its vision embedding with the visual feature of the input image. The dense predictions from the auxiliary predictor are combined with the outcomes by text embeddings to construct the final segmentation results. The core idea of this design is to use the intra-domain similarity of the vision embedding and the input image to alleviate the vision-language modality gap inherent in CLIP. Additionally, we incorporate an additional feature extractor specifically tailored for semantic segmentation, optimizing it to enhance prediction performance further. The optimization is entirely supervised using model-generated masks of unlabeled samples, without relying on any annotated information during the process. To improve generalization and stability, we adopt an Exponential Moving Average (EMA) strategy to maintain a smoothly updated version of the feature extractor.

In summary, our contributions are as follows:

Xiao-Yu Zhang is the corresponding author (zhangxiaoyu@iie.ac.cn).

Figure

Fig. 1: The diagram of the Regional Semantic Preservation Module. We discard Wq and Wk, using only the value feature output by Wv for self-attention calculation. This mechanism yields dense features that better capture regional semantic information.

• We propose a novel attention modification method based on vanilla CLIP to preserve regional semantics. We intuitively modify the final attention layer of CLIP's image encoder, devising a specific attention calculation method to obtain pixel-level visual features with greater local semantic consistency.

• We introduce a prediction enhancement strategy with visual prototypes. A visual feature memory module is designed to select representative visual prototypes for each category. Serving as an auxiliary dense predictor, this module mitigates the modality gap of text embeddings and images.

• We achieve state-of-the-art annotation-free semantic segmentation performance compared to existing methods.

References (27)