One-Shot Synthesis of Images and Segmentation Masks

Vadim Sushko, Dan Zhang, Juergen Gall, Anna Khoreva · DOI

Abstract

Training deep networks for image segmentation typically requires massive amounts of pixel-level annotations, which are expensive and time-consuming to produce. OSMIS (One-Shot Mask-Image Synthesis) is a novel GAN framework designed to generate diverse new images and their corresponding segmentation masks from just a single labeled training pair. By utilizing a masked attention mechanism in the discriminator, OSMIS avoids the common "memorization" trap of one-shot learning without requiring large-scale pre-training on thousands of images.

Introduction

In many real-world scenarios—such as identifying rare medical conditions or specific industrial defects—large datasets for segmentation simply do not exist. While Generative Adversarial Networks (GANs) can synthesize labeled data, existing models like DatasetGAN or SemanticGAN require extensive pre-training on domain-specific datasets before they can learn to generate masks from a few examples. OSMIS addresses this "one-shot" challenge: training a model from scratch using only one image and its mask to generate an infinite variety of new, labeled training examples.

Methodology

OSMIS builds upon the architecture of "One-Shot GAN" with two critical modifications to enable joint image and mask synthesis:

  1. Mask Synthesis Branch (Generator): The generator is modified to produce both an image and an $N$-channel probability map (the mask) simultaneously. To handle the non-differentiable nature of picking the "best" class for each pixel, the authors employ a straight-through gradient estimator, allowing backpropagation through discrete mask predictions.
  2. Masked Content Attention (MCA) (Discriminator): Standard discriminators often lead to memorization in one-shot settings. The MCA module uses the segmentation mask to "crop" features of individual objects, forcing the discriminator to judge the realism of these objects separately. This incentivizes the generator to create realistic objects that can be rearranged, rather than just recreating a static global scene.
Overview of the OSMIS framework, illustrating the training pair input, the dual-branch generator, and the masked discriminator architecture.

Key Results

The researchers evaluated OSMIS on benchmarks including DAVIS-17 and COCO. The model demonstrated several key strengths:

  • Superior Diversity: OSMIS significantly outperformed previous single-image GANs in diversity, achieving an LPIPS score of 0.387 compared to SinGAN’s 0.267.
  • High-Fidelity Masks: In terms of mask alignment, OSMIS reached an mIoU of 86.6 on DAVIS-17, far exceeding SemanticGAN’s 65.8 when trained in the same one-shot regime.
  • Effective Data Augmentation: When used to augment training for state-of-the-art segmentation models (like OSVOS), OSMIS-generated data provided consistent performance boosts, improving OSVOS's J&F score on DAVIS-16 from 78.5 to 79.8.
Examples of diverse image-mask pairs generated by OSMIS from a single training example, showing varied object layouts and backgrounds.

Discussion and Limitations

While OSMIS effectively breaks the memorization cycle, it still faces challenges with extremely fine details due to discriminator downsampling. Additionally, while the model excels at changing scene layouts and backgrounds, it does not yet learn to significantly alter the pose of an object (e.g., making a sitting dog stand) because it only has one reference pose to learn from. Future work may involve incorporating structural priors to allow for more complex object deformations from a single example.

Summary updated

BibTeX
@inproceedings{sushko2023one,
  author = {Vadim Sushko and Dan Zhang and Juergen Gall and Anna Khoreva},
  title = {{One-Shot Synthesis of Images and Segmentation Masks}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2023},
  doi = {10.1109/wacv56688.2023.00622},
}
Figure