[Paper Review] Semantic Segmentation with Generative Models: Semi-Supervised Learning and Strong Out-of-Domain Generalization
This paper proposes a generative adversarial network (GAN)-based framework for semantic segmentation that jointly models image and label distributions, enabling semi-supervised learning with minimal labeled data. By optimizing latent codes at test time and generating segmentation masks from inferred embeddings, the method achieves state-of-the-art in-domain performance and unprecedented out-of-domain generalization—transferring from CT to MRI in medical imaging and from real faces to paintings, sculptures, and animal faces.
Training deep networks with limited labeled data while achieving a strong generalization ability is key in the quest to reduce human annotation efforts. This is the goal of semi-supervised learning, which exploits more widely available unlabeled data to complement small labeled data sets. In this paper, we propose a novel framework for discriminative pixel-level tasks using a generative model of both images and labels. Concretely, we learn a generative adversarial network that captures the joint image-label distribution and is trained efficiently using a large set of unlabeled images supplemented with only few labeled ones. We build our architecture on top of StyleGAN2, augmented with a label synthesis branch. Image labeling at test time is achieved by first embedding the target image into the joint latent space via an encoder network and test-time optimization, and then generating the label from the inferred embedding. We evaluate our approach in two important domains: medical image segmentation and part-based face segmentation. We demonstrate strong in-domain performance compared to several baselines, and are the first to showcase extreme out-of-domain generalization, such as transferring from CT to MRI in medical imaging, and photographs of real faces to paintings, sculptures, and even cartoons and animal faces. Project Page: \url{https://nv-tlabs.github.io/semanticGAN/}
Motivation & Objective
- Address the challenge of high annotation cost in dense pixel-level tasks like semantic segmentation, especially in domains like medical imaging where expert labeling is expensive.
- Overcome the limitations of discriminative models in generalizing to out-of-distribution data, such as different imaging modalities or artistic representations.
- Enable effective semi-supervised learning by leveraging large-scale unlabeled data alongside only a few labeled examples.
- Develop a unified generative framework that models the joint distribution of images and their semantic labels, facilitating zero-shot and few-shot adaptation to novel domains.
Proposed method
- Adapt StyleGAN2 as a conditional generator to model the joint distribution of images and segmentation masks, with a dedicated label synthesis branch.
- Train the generator and discriminators using adversarial objectives, where the image and mask discriminators ensure realistic image and label generation.
- Use a separate encoder network to map input images to latent codes via supervised reconstruction losses on images and masks.
- Perform test-time optimization to refine the latent code that reconstructs the input image, followed by label generation from the optimized embedding.
- Leverage the trained generative model to synthesize large-scale, fully-annotated synthetic data for training discriminative segmentation networks.
- Apply truncation and diversity-based sampling strategies to generate high-quality synthetic data for data augmentation and transfer learning.

Experimental results
Research questions
- RQ1Can a purely generative model that learns the joint image-label distribution achieve competitive performance in semantic segmentation with minimal labeled data?
- RQ2To what extent can a generative model generalize to out-of-domain inputs, such as different imaging modalities (e.g., CT to MRI) or artistic representations (e.g., paintings, cartoons)?
- RQ3How does the performance of the generative model compare to discriminative baselines in both in-domain and extreme out-of-domain settings?
- RQ4What is the relative value of labeled versus unlabeled data in this semi-supervised generative framework, and how does data quantity affect segmentation mIoU?
- RQ5Can the generative model be used to synthesize high-quality, diverse, and useful training data for downstream discriminative segmentation models?
Key findings
- The proposed method achieves a mIoU of 0.7600 on CelebA-Mask and 0.6336 on MetFaces-40, outperforming strong baselines in both in-domain and out-of-domain settings.
- With only 150 labeled and 3,000 unlabeled images, the model achieves mIoU of 0.7046, comparable to 1,500 labeled and 28,000 unlabeled images (0.7566), demonstrating high data efficiency.
- Synthetic data generated via the model improves downstream segmentation performance: using 20k synthetic samples with mixing strategies, mIoU reached 0.7192 on MetFaces, surpassing real-data-only baselines.
- The model generalizes remarkably to extreme out-of-domain inputs, producing plausible segmentations for animal faces, sculptures, and cartoons, even when trained only on real human faces.
- Test-time optimization of the latent code significantly improves performance over direct encoder inference, highlighting the importance of refinement in the latent space.
- The generative approach outperforms both discriminative models trained on synthetic data and real-data baselines, establishing a new SOTA in few-shot and zero-shot segmentation.

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.