Foreground-Background Separation through Concept Distillation from Generative Image Foundation Models

Mischa Dombrowski, Hadrien Reynaud, Matthew Baugh, Bernhard Kainz

Abstract

Object segmentation typically requires extensive manual pixel-level annotation, creating a significant bottleneck for scaling models to new domains. This paper introduces a method to create high-quality foreground-background segmentation models without a single manual label. By "distilling" the internal knowledge of pre-trained latent diffusion models (LDMs), we generate synthetic training data and refined masks that allow unsupervised models to approach the performance of fully supervised counterparts. Our multi-stage pipeline, Concept Distillation, leverages cross-attention maps and inpainting capabilities to extract precise object boundaries, achieving state-of-the-art unsupervised performance across diverse benchmarks.

Introduction

Object segmentation—the task of identifying exactly which pixels belong to an object versus the background—is notoriously labor-intensive. While massive datasets exist for image classification, pixel-perfect masks for segmentation require expensive manual annotation. Existing "weakly supervised" methods often produce coarse results. However, large-scale generative foundation models clearly "understand" object structures, as evidenced by their ability to generate them from text. This work explores how to extract this latent knowledge to build segmentation models without human-provided masks.

The Concept Distillation Framework

The proposed pipeline consists of three primary steps to transition from a general-purpose generative model to a specialized segmentation tool:

  1. Preliminary Mask Extraction: A pre-trained LDM is prompted (e.g., "a photo of a bird"). By analyzing the model's internal cross-attention maps, coarse low-resolution (64x64) masks are generated based on the pixels the model associates with the target concept.
  2. Fine-tuning for Inpainting: The LDM is fine-tuned on a target dataset to perform two tasks: image synthesis and inpainting. Using the coarse masks, the model learns to "erase" the object and fill in the background realistically.
  3. Mask Refinement: To achieve high-resolution masks, the original image is compared to its inpainted (object-removed) version. The pixel-wise difference between these states provides a detailed boundary of the object.
The three-step Concept Distillation pipeline: preliminary mask extraction, model fine-tuning, and mask refinement.

Finally, these high-quality synthetic masks are used as "ground truth" labels to train a standard, lightweight segmentation model, such as a U-Net.

Experimental Setup

The method was evaluated across several diverse domains:

  • CUB (Caltech-UCSD Birds 200): Fine-grained bird segmentation.
  • Stanford Dogs & Stanford Cars: Common animal and vehicle categories.
  • Human3.6m: Humans in various poses.
  • MS-CXR: A medical dataset of chest X-rays to test generalization to specialized domains like radiology.

Results and Discussion

The Concept Distillation method achieves state-of-the-art unsupervised performance. On the CUB dataset, it reached a foreground Intersection over Union (IoU) of 77.2%, significantly outperforming previous unsupervised methods like Layered GAN (69.7%) and narrowing the gap with fully supervised U-Nets (88.3%).

Qualitative segmentation results on the Stanford Dogs dataset, showing input images and the corresponding masks generated via concept distillation.

Key insights from the results include:

  • The Power of Erasure: Inpainting serves as an effective proxy for segmentation. The difference between "object-present" and "object-erased" states defines silhouettes more accurately than raw attention maps.
  • Zero-Shot Capability: The system can generate a functional segmentation model for any concept known to the foundation model simply by changing the text prompt.
  • Domain Adaptability: Fine-tuning on specialized data, such as X-rays, allows the framework to identify lung pathologies despite the foundation model not being originally trained on medical imagery.

Limitations and Future Work

Despite its success, the method currently assumes a "bimodal" distribution (one foreground object and one background). It struggles with complex scenes containing multiple overlapping objects or low-contrast scenarios where the object color matches the background. Future work may involve prompt engineering for multi-object scenes or layering multiple masks for multi-class segmentation.

Summary updated

BibTeX
@inproceedings{dombrowski2023foreground,
  author = {Mischa Dombrowski and Hadrien Reynaud and Matthew Baugh and Bernhard Kainz},
  title = {{Foreground-Background Separation through Concept Distillation from Generative Image Foundation Models}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2023},
  doi = {10.1109/iccv51070.2023.00097},
}
Figure