Abstract
Image segmentation traditionally relies on extensive manual annotations, limiting its scalability to open-vocabulary scenarios. FreeSeg-Diff introduces a training-free pipeline that repurposes the internal features of frozen diffusion models for zero-shot segmentation. By integrating Stable Diffusion’s spatial priors with CLIP’s semantic embeddings and BLIP-2’s scene captioning, FreeSeg-Diff achieves competitive performance on standard benchmarks like Pascal VOC and COCO without any task-specific fine-tuning.
Introduction
The challenge of image segmentation lies in the high cost of pixel-level labeling. While foundation models like CLIP have enabled open-vocabulary classification, they often lack the spatial granularity required for precise localization. Conversely, generative diffusion models (DMs) demonstrate a profound understanding of image structure. FreeSeg-Diff explores whether this "spatial intelligence" can be extracted to perform segmentation in a zero-shot manner, bypassing the need for expensive human-annotated datasets.
Methodology
The FreeSeg-Diff pipeline operates through four distinct stages using frozen, off-the-shelf models:
- Candidate Class Assessment: To constrain the search space, BLIP-2 generates a caption for the input image. Natural Language Processing (NLP) is then used to extract nouns, forming a localized vocabulary of candidate classes.
- Class-Agnostic Mask Retrieval: The image is processed through a frozen Stable Diffusion U-Net. Multiscale features are extracted from internal layers and clustered via K-Means to produce class-agnostic masks representing distinct structural regions.
- Mask Classification: Each region is isolated and evaluated by CLIP against the candidate vocabulary. The region is assigned the label with the highest semantic similarity.
- Refinement: A Conditional Random Field (CRF) is applied to sharpen mask boundaries, ensuring alignment with the original image's edges.
Key Insights: Generative vs. Discriminative Features
A primary contribution of this work is the observation that features from generative models (e.g., Stable Diffusion) are superior for localization compared to discriminative models (e.g., ViT, DINO). The denoising objective in diffusion models forces the network to learn the underlying geometry and composition of objects to reconstruct them accurately.
The use of a "captioning filter" via BLIP-2 is also critical. By narrowing the potential classes to those likely present in the scene, the model significantly reduces false positives and semantic noise.
Experimental Results
FreeSeg-Diff was evaluated on Pascal VOC and COCO benchmarks. Despite being training-free, it achieved:
- Pascal VOC: 53.27 mIoU, outperforming supervised baselines like MoCo (+19 points) and DINO (+14 points).
- COCO: 31.01 mIoU, surpassing training-based open-vocabulary methods like ReCo by 15 points.
- Competitive Performance: The results are comparable to weakly-supervised state-of-the-art methods, demonstrating the power of latent knowledge in foundation models.
Conclusion
FreeSeg-Diff demonstrates that pre-trained diffusion models contain rich, untapped spatial information suitable for complex vision tasks. While it currently relies on external captioners and multi-step processing, it sets a new benchmark for training-free, open-vocabulary segmentation. Future work may focus on streamlining the pipeline for real-time applications and extending the approach to instance-level segmentation.
Summary updated