Abstract
Image manipulation dates back long before the deep learning era. The classical prevailing approaches were based on maximizing patch similarity between the input and generated output. Recently, single-image GANs were introduced as a superior and more sophisticated solution to image manipulation tasks. Moreover, they offered the opportunity not only to manipulate a given image, but also to generate a large and diverse set of different outputs from a single natural image. This gave rise to new tasks, which are considered “GAN-only”. However, despite their impressiveness, single-image GANs require long training time (usually hours) for each image and each task and often suffer from visual artifacts. In this paper we revisit the classical patch-based methods, and show that - unlike previously believed - classical methods can be adapted to tackle these novel “GAN-only” tasks. Moreover, they do so better and faster than single-image GAN-based methods. More specifically, we show that: (i) by introducing slight modifications, classical patch-based methods are able to unconditionally generate diverse images based on a single natural image; (ii) the generated output visual quality exceeds that of single-image GANs by a large margin (confirmed both quantitatively and qualitatively); (iii) they are orders of magnitude faster (runtime reduced from hours to seconds).
Introduction: The Case for Simplicity
In the fast-moving world of computer vision, the Generative Adversarial Network (GAN) has long been the undisputed champion of image synthesis. Models like SinGAN demonstrated that a network could learn the internal patch distribution of a single image to create new, structurally similar variations. However, this sophistication comes at a significant cost: hours of training per image, training instability, and frequent visual artifacts.
Researchers at the Weizmann Institute of Science propose a return to basics with GPNN (Generative Patch Nearest-Neighbor). They argue that single-image GANs are essentially acting as inefficient, slow nearest-neighbor search engines. By replacing the complex generator with a refined patch-search algorithm, GPNN achieves superior results in seconds rather than hours.
Methodology: The GPNN Framework
GPNN revitalizes classical patch-based methods by incorporating a modern multi-scale approach. The process begins at a coarse resolution and progressively refines the image through a pyramid of scales.
- Noise-Driven Diversity: To generate diverse outputs from a single source, GPNN injects noise at the coarsest level. This initial "shuffle" determines the global structure of the final image.
- The PNN Module: Instead of a neural network, GPNN uses a Query-Key-Value (QKV) patch search. It matches patches from a blurry "query" (the current guess) to a blurry "key" (the source image at that scale) and replaces them with sharp "values" from the original source.
- Visual Completeness: A normalized similarity measure ensures that the model utilizes the full range of patches from the source image, preventing the repetitive use of a few "best" patches and maintaining visual variety.
Results and Applications
Diverse Image Generation
One of the primary "GAN-only" tasks is the generation of multiple, distinct images from a single input. GPNN excels here, producing variations that maintain the semantic essence of the original while significantly altering the layout.
Speed and Quality
The performance gains are dramatic. While GAN-based models typically require an hour of training per image, GPNN produces results in approximately 2 seconds—a speedup of $10^3$ to $10^4$. Furthermore, human studies show that GPNN's outputs are more frequently mistaken for real images than those of SinGAN, as they suffer from fewer "broken" structural artifacts and mode collapse issues.
Versatility in Manipulation
Beyond simple generation, the GPNN framework is highly versatile. It can be applied to tasks like retargeting, where an image is resized while preserving the proportions and integrity of its key elements.
Other applications include structural analogies (e.g., mapping footprints from snow to sand) and conditional inpainting, all achieved within the same non-parametric framework without any task-specific training.
Conclusion
"Drop the GAN" serves as a powerful reminder that for single-image tasks, explicit patch search is often more effective than implicit learning via neural networks. By removing the need for optimization, GPNN provides a faster, more stable, and higher-quality alternative to the current GAN-centric paradigm, proving that sometimes the most sophisticated tool isn't the best one for the job.
Summary updated