SinGAN: Learning a Generative Model From a Single Natural Image

Tamar Rott Shaham, Tali Dekel, Tomer Michaeli

Introduction

Generative Adversarial Networks (GANs) have traditionally been synonymous with large-scale datasets. To synthesize realistic imagery, models typically require thousands of examples to approximate the underlying distribution of a class. However, this dependency on "Big Data" limits GANs in scenarios where data is scarce or when the goal is to model the unique characteristics of a specific scene. SinGAN addresses this limitation by learning an unconditional generative model from a single natural image. By shifting the focus from external datasets to the internal statistics of a single image, SinGAN enables high-quality image manipulation and synthesis that preserves both global structure and fine-grained textures.

The Internal Patch Distribution

The fundamental premise of SinGAN is that a single natural image contains a wealth of internal information. While it lacks a variety of distinct objects, it provides a massive "dataset" of overlapping patches across multiple scales. Traditional GANs trained on small datasets often suffer from overfitting or fail to capture complex structures. SinGAN avoids this by learning the distribution of these internal patches, allowing it to generate new, diverse versions of the training image that maintain the original's "DNA."

Methodology: A Hierarchical Approach

SinGAN utilizes a hierarchical pyramid of fully convolutional GANs, designed to capture information in a coarse-to-fine manner.

Multi-Scale Architecture

The model consists of a sequence of generators ($G_0, \dots, G_N$) and corresponding discriminators ($D_0, \dots, D_N$). Training begins at the coarsest scale (lowest resolution) and progresses to the original resolution. This allows the model to first learn the global layout and subsequently refine the details.

Sequential Training and Residual Learning

Each level of the pyramid is trained independently and sequentially. Once a scale is optimized, its weights are frozen. To facilitate learning at finer scales, SinGAN employs residual learning. Except for the coarsest level $G_0$, which generates an image from noise, each generator $G_n$ receives an upsampled version of the output from the previous scale ($G_{n-1}$) and learns to add the missing residual details.

Markovian Discriminator

To prevent the model from simply memorizing the global layout, SinGAN employs "PatchGAN" discriminators. These discriminators evaluate the realism of small overlapping patches (e.g., 11x11) rather than the entire image. This forces the generators to focus on the statistical arrangement of features rather than exact pixel coordinates.

Optimization

The training objective combines a WGAN-GP adversarial loss, which ensures the generated patches are indistinguishable from the original, and a reconstruction loss. The reconstruction loss ensures that a specific "zero-noise" input can perfectly recover the original image, providing a stable anchor for the generative process.

Applications and Versatility

Despite being trained on only one image, SinGAN demonstrates remarkable versatility across several computer vision tasks without requiring task-specific architectural changes:

  • Image Synthesis: Generating new samples with varying layouts and textures by starting the generation process at different scales.
  • Super-Resolution: Producing realistic textures that often surpass methods optimized solely for PSNR (Peak Signal-to-Noise Ratio).
  • Harmonization: Seamlessly blending external objects into a background by adapting their textures to the background's internal statistics.
  • Animation: Creating dynamic content, such as moving clouds or swaying trees, from a single static frame.

Results and Evaluation

The authors introduced the Single Image Frechet Inception Distance (SIFID) to quantify the quality of generated images by comparing the distribution of their internal patches to the original. Human evaluation via Amazon Mechanical Turk further validated the model's performance; in "Real/Fake" tests, users confused SinGAN-generated images with real ones 42.9% of the time, approaching the ideal 50% confusion rate.

Limitations and Future Work

SinGAN is primarily a structural and textural model; it lacks high-level semantic understanding. For instance, while it can rearrange the components of a landscape, it cannot transform one breed of dog into another. Furthermore, images with prominent, unique salient objects (like human faces) can suffer from "monster-like" distortions if the patch shuffling at coarse scales disrupts the necessary global symmetry or arrangement. Future research may focus on incorporating semantic constraints or extending the internal learning approach to video and 3D data.

Conclusion

SinGAN represents a significant shift in generative modeling, proving that the internal statistics of a single image are sufficient to train a powerful, unconditional GAN. Its ability to handle diverse tasks through a unified architecture makes it a flexible and potent tool for image editing and synthesis.

Summary updated

BibTeX
@inproceedings{shaham2019singan,
  author = {Tamar Rott Shaham and Tali Dekel and Tomer Michaeli},
  title = {{SinGAN: Learning a Generative Model From a Single Natural Image}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2019},
  doi = {10.1109/iccv.2019.00467},
}
Figure