Abstract
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.
Introduction
Standard discriminative models for semantic segmentation, which learn a direct mapping from an image $x$ to a label $y$, are notoriously data-hungry and brittle. They require extensive pixel-level annotations and often fail when the input data shifts slightly from the training distribution. This paper proposes a paradigm shift: instead of building a conditional model $p(y|x)$, the authors build a generative model that learns the joint distribution $p(x, y)$. This approach addresses two critical challenges in computer vision: label efficiency and robustness to out-of-domain (OOD) data.
Methodology
The researchers modified the StyleGAN2 architecture by adding a label synthesis branch that shares style layers with the main image generation branch. This ensures that the features used to synthesize realistic images are the same features used to generate their corresponding segmentation masks.
Training and Inference
The model is trained using a large set of unlabeled images and a small set of labeled examples. Two discriminators are employed: $D_r$ for image realism and $D_m$ to ensure that generated image-label pairs are both realistic and spatially aligned.
At inference time, the model uses GAN inversion. To label a new test image, an encoder provides an initial guess for the latent code ($w^+$), which is then refined via optimization to best reconstruct the target image. Once the optimal code is found, it is passed through the label branch to produce the segmentation mask. This process acts as a semantic filter; because the model can only generate labels for structures it can represent in its latent space, it is less likely to be distracted by superficial textures.
Results and Generalization
The framework was evaluated on medical imaging (Chest X-rays, Skin Lesions, Liver CT) and face segmentation (CelebA-Mask). The results highlight the model's superior performance in the "low-data" regime, where it consistently outperformed strong semi-supervised learning baselines like Mean Teacher.
Key Insights
- Extreme Generalization: The model trained on real human faces successfully segmented MetFaces (paintings), cartoons, and even animal faces. In the medical domain, a model trained on CT scans successfully segmented MRI scans without additional domain adaptation.
- Label Efficiency: On the MetFaces dataset, the generative model trained with only 1,500 labels outperformed a standard DeepLabV2 model trained on the full 28,000 labels.
Conclusion and Limitations
While this generative approach offers a powerful solution for semi-supervised learning and OOD generalization, it faces challenges regarding inference speed. The optimization-based inversion process is computationally more expensive than a standard forward pass. Additionally, the model's performance is tied to the expressivity of the underlying GAN, which currently excels at unimodal data (like faces or specific organs) but may struggle with more complex, diverse scenes.
Summary updated