Introduction
Semantic Image Synthesis (SIS) aims to generate realistic images based on user-provided spatial layouts, such as semantic masks. Traditionally, this requires training complex models from scratch on massive datasets with pixel-perfect human annotations—a process that is expensive, labor-intensive, and rigid. This paper introduces a novel method that leverages pre-trained unconditional generators (like StyleGAN2) to achieve high-quality, spatially controlled image generation from masks, sketches, and scribbles with minimal training time and data.
The Challenge of Traditional SIS
Conventional SIS relies on "full-shot" training, demanding thousands of paired images and annotations. If a user wants to change the input modality—say, from detailed segmentation masks to simple hand-drawn scribbles—the entire model typically requires re-annotation and re-training.
While some approaches use pre-trained unconditional GANs to bypass heavy data requirements, they often struggle with fine-grained spatial control or force users to manually tweak internal feature clusters. The authors seek to bridge the gap between user-friendly inputs and the high-quality internal representations of an unconditional generator, keeping training requirements to "one-shot" or "few-shot" scenarios.
Proposed Methodology
The authors propose a lightweight framework that avoids retraining the core generator. Instead, it introduces two main components: the Semantic Mapper and the Rearranger.
- Proxy Masks via Clustering: Unconditional generators inherently possess internal semantic knowledge. By applying K-means clustering to the intermediate feature maps of a random sample, the authors extract a "proxy mask." This mask represents the spatial layout the generator naturally understands, eliminating the need for human labels.
- The Semantic Mapper: Because users do not naturally draw in the format of "proxy masks," a small mapper network is trained to translate human-friendly inputs (semantic masks, sketches, or free-form scribbles) into the generator's internal proxy mask format.
- The Rearranger: This network uses a cross-attention mechanism to take feature maps from a latent code and rearrange them to fit the shape of the target proxy mask. It treats the features as a "bag of parts," reassembling them into a new configuration without losing their photorealistic qualities.
- Self-Supervised Training: The system uses a self-reconstruction loss (to rebuild the original image if the mask is unchanged) and a mask reconstruction loss (to ensure rearranged features match the target layout). Because the core generator is frozen, training takes less than 30 minutes.
Key Insights and Flexibility
- Rearranging vs. Generating: Instead of teaching a model how to "paint" from scratch based on a mask, this method teaches it how to "move" existing high-quality features into a new arrangement, preserving the GAN's original photorealism.
- The Internal Language of GANs: The proxy masks act as an intermediate language, bridging the perception gap between human-defined shapes and GAN representations.
- Input Versatility: Since only the Semantic Mapper needs to adapt to different input types, the model seamlessly handles everything from precise segmentation maps to single-line scribbles.
Results and Performance
The method was evaluated across diverse datasets, including human faces (CelebAMask-HQ, FFHQ), animal faces (AFHQ), and scenes (LSUN Church/Bedroom).
- Quantitative Superiority: In few-shot settings, the proposed method significantly outperformed competitors like LinearGAN. On the FFHQ dataset using just 1 mask, it achieved an mIoU of 49.8, compared to LinearGAN's 37.2.
- Image Quality: The method achieved a significantly lower Fréchet Inception Distance (FID) than supervised one-shot competitors. For one-shot face generation, it reached an FID of 18.5, beating OASIS (25.5) and INADE (28.1).
- Free-form Editing: The model excels at handling "out-of-distribution" masks. If a user draws unnaturally large eyes or ears, the Rearranger successfully warps the features to fit, a task where traditional GAN-inversion methods often fail.
Limitations
While highly effective in few-shot scenarios, a slight performance gap remains compared to models trained on massive full-shot datasets (28k+ images), particularly for fine-grained details like small accessories. Additionally, because manipulation occurs at the feature map level, achieving absolute pixel-level control remains a future goal. Finally, the output quality is inherently bound by the pre-trained unconditional generator; it cannot generate objects or styles it has never seen.
Summary updated