Probabilistic Prompt Learning for Dense Prediction

Hyeongjun Kwon, Taeyong Song, Somi Jeong, Jin Kim, Jinhyun Jang, Kwanghoon SohnCVPR 2023

Abstract

Recent progress in deterministic prompt learning has become a promising alternative to various downstream vision tasks, enabling models to learn powerful visual representations with the help of pre-trained vision-language models. However, this approach results in limited performance for dense prediction tasks that require handling more complex and diverse objects, since a single and deterministic description cannot sufficiently represent the entire image. In this paper, we present a novel probabilistic prompt learning (PPL) to fully exploit the vision-language knowledge in dense prediction tasks. First, we introduce learnable class-agnostic attribute prompts to describe universal attributes across the object class. The attributes are combined with class information and visual-context knowledge to define the class-specific textual distribution. Text representations are sampled and used to guide the dense prediction task using the probabilistic pixel-text matching loss, enhancing the stability and generalization capability of the proposed method. Extensive experiments on different dense prediction tasks and ablation studies demonstrate the effectiveness of our proposed method.

Introduction

Vision-Language Models (VLMs) like CLIP have revolutionized computer vision by aligning images with natural language. However, applying them to "dense prediction" tasks—such as semantic segmentation or object detection—presents unique challenges. Most current methods rely on deterministic prompts, learning a single optimal phrase like "a photo of a [class]."

This "one-size-fits-all" approach is often too rigid for complex scenes. For instance, a "dog" on a sunny beach appears vastly different from a "dog" in a dark living room. A single point in the text embedding space cannot capture these variations, leading to "aleatoric uncertainty"—the inherent ambiguity caused by diverse visual contexts. To address this, we propose modeling prompts as a distribution that adapts to visual context, allowing the model to account for inherent randomness rather than ignoring it.

Conceptual overview of Probabilistic Prompt Learning (PPL) vs. deterministic sampling. PPL models prompts as a distribution to capture diverse visual attributes.

Methodology

The PPL framework treats text prompts as a learnable probability distribution rather than a fixed vector. The architecture consists of several key components:

  1. Class-Agnostic Attribute Prompts: The model learns universal attributes (e.g., size, color, position) that apply across all object classes.
  2. Visual-Context Probabilistic Decoder: This transformer-based module analyzes the input image and text embeddings to calculate a standard deviation ($\sigma$), adjusting the "spread" of the prompt distribution based on specific image context.
  3. Mixture of Gaussians (MoG) Modeling: Final text representations are modeled as a Mixture of Gaussians. During training and inference, the model samples multiple prompts ($N$-samples) to achieve a granular understanding of image details.
  4. Probabilistic Pixel-Text Matching Loss: This novel loss function handles uncertainty by penalizing the model less in high-uncertainty regions, preventing noisy alignments from degrading performance.
  5. Diversity Loss: This encourages learned attribute prompts to remain distinct and orthogonal, preventing representation collapse.
The PPL framework architecture, showing the transition from deterministic embeddings to probabilistic distributions and the pixel-wise similarity matching.

Experimental Results

PPL was evaluated on gold-standard benchmarks: ADE20k for semantic segmentation and COCO for object detection and instance segmentation. The model utilized pre-trained CLIP weights with ResNet and ViT backbones.

  • Semantic Segmentation: PPL achieved 44.7% mIoU on ADE20k with a ResNet-50 backbone, outperforming DenseCLIP by 1.2%. With a ViT-B backbone, performance reached 51.6% mIoU.
  • Object Detection: On COCO with ResNet-50, PPL improved Average Precision ($AP^b$) to 41.0, compared to 39.3 for the vanilla CLIP baseline.
  • Uncertainty Analysis: Experiments revealed a negative correlation between uncertainty and accuracy. By explicitly modeling uncertainty, the model learns to focus on the most informative features while neglecting redundant or confusing visual cues.

Conclusion

Probabilistic Prompt Learning (PPL) successfully moves beyond static text prompts by modeling them as context-aware distributions. While the approach introduces some computational overhead—increasing GFLOPs due to the sampling process—it sets new performance benchmarks for dense prediction tasks. Future work will explore extending this probabilistic approach to more complex multi-modal tasks like video understanding and open-vocabulary scene graph generation.

Summary updated

BibTeX
@inproceedings{kwon2023probabilistic,
  author = {Hyeongjun Kwon and Taeyong Song and Somi Jeong and Jin Kim and Jinhyun Jang and Kwanghoon Sohn},
  title = {{Probabilistic Prompt Learning for Dense Prediction}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2023},
  url = {https://openreview.net/forum?id=G8H0VYi0WY},
}
Figure