NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Label-Efficient Semantic Segmentation with Diffusion Models

Dmitry Baranchuk, Andrey Voynov, Ivan Rubachev, Valentin Khrulkov, Artem Babenko

Introduction

Diffusion models are renowned for generating stunning, high-fidelity images. However, recent research reveals they are also powerful "representation learners." By extracting intermediate activations from a pre-trained diffusion model's U-Net, researchers can perform high-quality semantic segmentation using only a handful of labeled images. This approach significantly outperforms GAN-based and self-supervised alternatives, offering a new pathway for label-efficient computer vision.

The Challenge of Semantic Segmentation

Semantic segmentation—the task of assigning a class label to every single pixel in an image—is notoriously "data-hungry." Traditionally, it requires thousands of meticulously hand-annotated images, which is prohibitively expensive in many domains.

While generative models like Generative Adversarial Networks (GANs) have been used to bridge this gap by creating synthetic training data, they often suffer from a "domain gap." Synthetic images rarely capture the full complexity and diversity of real-world distributions. This paper asks a pivotal question: Can Denoising Diffusion Probabilistic Models (DDPMs), which have recently surpassed GANs in image quality, serve as a more effective, label-efficient source of image representations for discriminative tasks?

Methodology: From Generator to Feature Extractor

The authors propose a surprisingly simple pipeline that repurposes a generative diffusion model into a robust feature extractor.

Methodology Pipeline

The process involves four key steps:

  1. Noise Injection: Take a real image and add a small amount of Gaussian noise corresponding to a specific diffusion timestep ($t$).
  2. Feature Extraction: Feed this noisy image into a pre-trained DDPM (specifically, the U-Net architecture used to predict noise). Instead of looking at the final output, the system extracts the intermediate activations from the U-Net's decoder blocks.
  3. Representation Building: These activations are upsampled to the original image resolution and concatenated to form a rich, high-dimensional feature vector for every pixel.
  4. Pixel Classification: A simple ensemble of Multi-Layer Perceptrons (MLPs) is trained on these feature vectors to predict semantic labels. Because the extracted features are so densely informative, the MLPs only need a few dozen labeled images to learn effectively.

Key Insights and Discoveries

The researchers evaluated this method across diverse domains, including LSUN (Horse, Cat, Bedroom), FFHQ-256 (human faces), and ADE-Bedroom-30. To test the "few-shot" capabilities, professional assessors created fine-grained ground truth masks for these datasets.

Performance across timesteps and blocks

Their experiments revealed several fascinating properties of diffusion representations:

  • The "Sweet Spot" of Noise: Representations are most effective at later diffusion steps (small $t$, meaning less noise). If there is too much noise (large $t$), the semantic structure is destroyed. If there is no noise, the model focuses too heavily on low-level pixel textures rather than high-level concepts.
  • Layer-Wise Specialization: Similar to traditional Convolutional Neural Networks (CNNs), different layers of the U-Net capture different scales. Deeper blocks are better at identifying large objects (like a whole horse), while shallower blocks excel at fine-grained details.
  • Real Data Trumps Synthetic: A major finding was that training on a few real images using DDPM features is more effective than training on thousands of synthetic images generated by the same model. This suggests that even the best generative models still exhibit a domain gap that hinders downstream task performance.
  • Inherent Robustness: DDPM-based features proved to be remarkably robust to image corruptions (like blur or digital noise), maintaining their performance much better than self-supervised methods like Masked Autoencoders (MAE).

Results and Performance

The DDPM-based approach consistently outperformed state-of-the-art baselines in the few-shot regime. For instance, on the Horse-21 dataset, the DDPM method achieved a 65.0 mIoU, vastly outperforming GAN-based approaches like DatasetGAN (45.4). It also beat strong self-supervised models like MAE (63.4) and SwAV (54.0).

Most impressively, the model achieves these results with as few as 20 to 50 labeled images, making it a highly viable solution for niche domains where data labeling is scarce.

Limitations and Future Directions

While promising, the approach has limitations:

  • Domain Specificity: The method relies on having a high-quality diffusion model pre-trained on the specific domain of interest. Segmenting medical images, for example, requires a diffusion model trained specifically on medical data.
  • Computational Overhead: Extracting features from a large U-Net is more computationally expensive than using standard backbones like ResNets or Vision Transformers.
  • Scaling to "In-the-Wild" Data: While results on curated datasets like LSUN and FFHQ are excellent, scaling this to massive, uncurated datasets like ImageNet or MSCOCO remains a challenge due to the difficulty of training diffusion models on such diverse data.

Ultimately, as diffusion models continue to improve and cover broader data distributions, they hold the potential to become the standard backbone for label-efficient computer vision.

Summary updated

BibTeX
@inproceedings{baranchuk2022label,
  author = {Dmitry Baranchuk and Andrey Voynov and Ivan Rubachev and Valentin Khrulkov and Artem Babenko},
  title = {{Label-Efficient Semantic Segmentation with Diffusion Models}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=SlxSY2UZQT},
}
Figure