Abstract
While diffusion models have emerged as powerful backbones for discriminative vision tasks, their performance is often bottlenecked by the quality of text guidance. We present Text-Aligned Diffusion Perception (TADP), a framework that leverages image-specific captions to align the generative prior of diffusion models with downstream perception tasks. By replacing generic class-average prompts with automated captions generated by BLIP-2, TADP achieves state-of-the-art results in semantic segmentation, depth estimation, and cross-domain object detection, demonstrating that precise text-image alignment is the "secret sauce" for diffusion-based vision.
Introduction
Diffusion models, such as Stable Diffusion, have revolutionized image generation by learning rich visual representations guided by text. Recent research has attempted to repurpose these models as backbones for traditional computer vision tasks like semantic segmentation and depth estimation. However, a significant challenge remains: "semantic shift." Most existing methods use generic, unaligned text prompts—such as averaging the embeddings of all possible class names in a dataset—to guide the model during inference. This mismatch between the specific image content and the generic text prompt leads to blurry internal attention maps, hindering the performance of downstream task-specific decoders.
Methods
The TADP framework addresses this semantic shift by ensuring the text prompt is always aligned with the specific image being processed. The core components of the method include:
- Automated Captioning: TADP utilizes an off-the-shelf captioning model (BLIP-2) to generate unique, descriptive captions for every image during both training and inference.
- Latent Scaling (LS): The authors found that normalizing image latents to a standard normal distribution significantly improves the stability and performance of the diffusion backbone.
- Cross-Domain Alignment: To bridge domain gaps (e.g., from real photos to watercolors), TADP appends style modifiers to the captions. For more challenging shifts, techniques like Textual Inversion or DreamBooth are used to learn specific "style tokens" from a small set of target-domain images.
The architecture extracts multi-scale features and cross-attention maps from the Stable Diffusion U-Net, which are then fed into task-specific heads for final prediction.
Key Insights: The Role of Attention
A critical finding of this work is the impact of prompt alignment on the model's internal cross-attention maps. When using generic class-average prompts, the model's attention is diffuse and noisy. In contrast, image-specific captions produce highly localized and "sharp" attention maps that accurately ground words to their corresponding visual objects. This spatial precision is vital for dense prediction tasks like segmentation.
Further analysis revealed that nouns are the primary drivers of performance, suggesting the model uses text mainly to ground objects in visual space. Additionally, the researchers found that "recall matters more than precision" in prompting; missing a relevant class name in a caption hurts performance significantly more than including an extra, non-existent class.
Experimental Results
TADP was evaluated across several rigorous benchmarks, setting new standards for diffusion-pretrained models:
- Monocular Depth Estimation: On the NYUv2 dataset, TADP achieved a new state-of-the-art RMSE of 0.225, representing an 8% relative improvement over previous baselines.
- Semantic Segmentation: The model reached 55.9 mIoU on ADE20K, the highest reported for diffusion-based backbones.
- Cross-Domain Generalization: TADP demonstrated remarkable robustness in unsupervised domain adaptation. On the Watercolor2K dataset, it achieved 43.5 AP for object detection. It also set new records for segmentation in challenging environments like Dark Zurich and Nighttime Driving, often through simple zero-shot style guidance (e.g., adding "at night" to the prompt).
Conclusion and Future Work
TADP demonstrates that the generative knowledge within diffusion models can be effectively harnessed for perception through proper text-image alignment. While the method introduces some computational overhead due to the captioning step and relies on the quality of the captioner (BLIP-2), it provides a clear path forward for building more flexible, open-vocabulary vision systems. Future research may explore more efficient, task-specific captioning strategies to reduce latency for real-time applications.
Summary updated