[Paper Review] Segmentation in Style: Unsupervised Semantic Image Segmentation with Stylegan and CLIP
This paper proposes an unsupervised semantic image segmentation method that leverages pretrained StyleGAN2 and CLIP to discover consistent, human-aligned semantic regions without any human-annotated data. By clustering features from the generator's intermediate layers and using CLIP for prompt-based class discovery, the method generates synthetic image-mask pairs to train a segmentation model that generalizes effectively to real images, achieving state-of-the-art performance on benchmark datasets with zero manual annotations.
We introduce a method that allows to automatically segment images into semantically meaningful regions without human supervision. Derived regions are consistent across different images and coincide with human-defined semantic classes on some datasets. In cases where semantic regions might be hard for human to define and consistently label, our method is still able to find meaningful and consistent semantic classes. In our work, we use pretrained StyleGAN2 generative model: clustering in the feature space of the generative model allows to discover semantic classes. Once classes are discovered, a synthetic dataset with generated images and corresponding segmentation masks can be created. After that a segmentation model is trained on the synthetic dataset and is able to generalize to real images. Additionally, by using CLIP we are able to use prompts defined in a natural language to discover some desired semantic classes. We test our method on publicly available datasets and show state-of-the-art results.
Motivation & Objective
- To address the challenge of costly and inconsistent human annotation in semantic segmentation, especially in domains like medical imaging where expert labeling is time-consuming and subjective.
- To develop a method that discovers semantically meaningful and consistent image regions without any human-annotated segmentation masks.
- To enable the discovery of rare or hard-to-define semantic classes (e.g., beard, glasses) using natural language prompts via CLIP.
- To train a generalizable segmentation model on synthetic data generated from a StyleGAN2 model, achieving competitive performance on real images.
- To demonstrate that unsupervised discovery via feature clustering and prompt-based classification can match or exceed semi-supervised and even fully supervised methods on certain benchmarks.
Proposed method
- Use a pretrained StyleGAN2 generator to synthesize N images and extract intermediate feature maps from its generator network.
- Apply clustering (e.g., k-means) on the feature maps to discover semantically meaningful regions, forming initial semantic classes.
- Generate a larger set of images and assign each pixel to a cluster using the learned feature space, creating a synthetic dataset with segmentation masks.
- Train a segmentation model (e.g., ResNet-18 with dilated convolutions) on the synthetic dataset to generalize to real images.
- Use CLIP's text and image encoders to embed natural language prompts and cluster features, then assign each discovered cluster to the most similar prompt via dot product similarity.
- For rare classes like beard or glasses, learn a disentangled latent direction in StyleGAN using text prompts, then re-cluster to discover the attribute as a distinct semantic region.
Experimental results
Research questions
- RQ1Can unsupervised clustering of intermediate features from a pretrained StyleGAN2 generator discover consistent and semantically meaningful image regions without any human annotations?
- RQ2Can CLIP-based zero-shot prompting effectively guide the discovery of rare or hard-to-define semantic classes such as glasses or beards in the absence of public annotations?
- RQ3Does a segmentation model trained on synthetic data generated via this method generalize well to real images, achieving competitive performance against fully supervised models?
- RQ4How does the performance of this unsupervised method compare to recent semi-supervised learning approaches that use a small number of annotated images?
- RQ5Can the method discover semantic classes that align with human-defined annotations, even in complex or ambiguous cases where visual boundaries are unclear?
Key findings
- On the CelebA-Mask8 dataset, the method achieves a mean IoU of 73.1%, outperforming semi-supervised methods that use 16–30 manually annotated images (70.01 and 69.02, respectively).
- On the more complex CelebAMask-HQ dataset with 19 semantic classes, the method achieves a mean IoU of 62.5%, compared to 70.5% for a fully supervised DRN model, demonstrating strong zero-shot generalization.
- On the OpenEDS eye segmentation dataset, the method achieves a mean IoU of 82.39%, very close to the fully supervised SegNet baseline (84.1%), indicating strong performance on simpler, well-defined semantic classes.
- The method successfully discovers and classifies rare attributes like beard and glasses using only text prompts, with the beard class achieving a mean IoU of 84.29% on a custom dataset, outperforming a fully supervised baseline (88.8%) in a zero-shot setting.
- Visualizations confirm that discovered regions are consistent across images, even in cases with ambiguous or overlapping boundaries, and align well with human-defined semantic classes.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.