Abstract
The issue of generative pretraining for vision models has persisted as a long-standing conundrum. At present, the text-to-image (T2I) diffusion model demonstrates remarkable proficiency in generating high-definition images matching textual inputs, a feat made possible through its pre-training on large-scale image-text pairs. This leads to a natural inquiry: can diffusion models be utilized to tackle visual perception tasks? In this paper, we propose a simple yet effective scheme to harness a diffusion model for visual perception tasks. Our key insight is to introduce learnable embeddings (meta prompts) to the pre-trained diffusion models to extract proper features for perception. The effect of meta prompts are two-fold. First, as a direct replacement of the text embeddings in the T2I models, it can activate task-relevant features during feature extraction. Second, it will be used to re-arrange the extracted features to ensures that the model focuses on the most pertinent features for the task on hand. Additionally, we design a recurrent refinement training strategy that fully leverages the property of diffusion models, thereby yielding stronger visual features. Extensive experiments across various benchmarks validate the effectiveness of our approach. Our approach achieves new performance records in depth estimation tasks on NYU depth V2 and KITTI, and in semantic segmentation task on CityScapes. Concurrently, the proposed method attains results comparable to the current state-of-the-art in semantic segmentation on ADE20K and pose estimation on COCO datasets, further exemplifying its robustness and versatility.
1. Introduction
Text-to-image (T2I) diffusion models, such as Stable Diffusion, have demonstrated an extraordinary ability to synthesize complex visual scenes from textual descriptions. This generative prowess stems from pre-training on billions of image-text pairs, which imbues the models with a deep "understanding" of visual semantics and geometry. However, repurposing these generative models for discriminative perception tasks—such as semantic segmentation, depth estimation, and pose estimation—remains a challenge.
The primary bottleneck lies in the interface between the image and the model's internal representations. Existing approaches often rely on "Label Prompts" (using dataset categories) or "Caption Prompts" (using external models to describe the scene). These methods are limited: category labels are often sparse, and generated captions may capture the general "vibe" of an image while ignoring fine-grained geometric details. This research explores whether we can adapt diffusion models for perception by bypassing human-language interfaces entirely.
2. Methodology
The proposed framework treats the diffusion model's UNet as a powerful feature extractor, governed by three core technical innovations.
2.1 Meta Prompts ($M_\phi$)
Instead of relying on fixed text strings, the authors introduce Meta Prompts: a set of learnable embeddings that serve as internal instructions for the pre-trained UNet. These prompts act as a direct replacement for text embeddings, activating task-relevant features within the model. By allowing the network to learn its own "language" for a specific task, the model can capture nuances that human language might fail to describe.
2.2 Prompt-Guided Feature Rearrangement
The UNet produces a hierarchy of feature maps. To ensure the model focuses on the most pertinent information for a given task (e.g., semantic boundaries for segmentation or edges for depth), the authors implement a feature rearrangement mechanism. This involves a dot-product operation between the Meta Prompts and the extracted feature maps, effectively filtering the high-dimensional data before it is passed to a task-specific decoder.
2.3 Recurrent Refinement with Modulated Timesteps
Leveraging the iterative nature of diffusion models, the framework employs a recurrent refinement strategy. Features are fed back into the UNet for multiple passes. To account for the shifting feature distribution across iterations, modulated timestep embeddings are introduced to adjust the UNet’s parameters at each step, progressively "polishing" the features for higher accuracy.
3. Experiments and Results
The "Meta Prompts" approach was evaluated across several diverse computer vision benchmarks, demonstrating its versatility and robustness.
- Depth Estimation: On NYU Depth V2, the model achieved an RMSE of 0.223, significantly outperforming previous diffusion-based methods like VPD (0.254) and TADP (0.225).
- Semantic Segmentation: On the Cityscapes urban driving dataset, it reached 87.1% mIoU, surpassing massive non-diffusion backbones such as InternImage-XL.
- Pose Estimation: The method achieved results comparable to current state-of-the-art models on the COCO human keypoint detection dataset.
Ablation studies confirmed that learnable Meta Prompts consistently outperform both Label and Caption prompts across all tasks, proving that internal learnable embeddings are a superior interface for perception than text-based prompts.
4. Discussion and Conclusion
This work demonstrates that the generative priors of diffusion models can be effectively harnessed for discriminative tasks. By replacing human-centric text prompts with machine-learned Meta Prompts, the model unlocks latent knowledge about scene structure and semantics. Furthermore, the iterative "feature polishing" enabled by the diffusion architecture allows for a level of refinement not typically seen in standard one-pass backbones.
Despite these gains, the model's size remains a consideration. Based on the Stable Diffusion UNet, the backbone contains approximately 912 million parameters, which may limit its deployment in real-time or edge computing environments. Future research may focus on distilling this knowledge into more efficient architectures or developing "universal" Meta Prompts capable of handling multiple perception tasks simultaneously.
Summary updated