Meta Internal Learning

Raphael Bensadoun, Shir Gur, Tomer Galanti, Lior Wolf

Overview

"Internal learning" is the practice of training a generative model, such as a Generative Adversarial Network (GAN), on the internal statistics of a single image. While models like SinGAN produce impressive results for tasks like image editing, harmonization, and animation, they suffer from significant limitations in scale and application.

This paper introduces a novel meta-learning framework that uses hypernetworks to dynamically generate the weights of a single-image GAN. By training across a collection of images rather than optimizing one at a time from scratch, the model achieves a 12x speedup in training per image and unlocks novel capabilities, such as model interpolation and instant feedforward generation for unseen images.

The Problem: Efficiency and Isolation

Traditional single-image GANs face two major drawbacks:

  1. Efficiency: They are computationally expensive and slow. Every new image requires a lengthy, isolated optimization process (often taking up to 60 minutes per image).
  2. Isolation: They treat every image as a blank slate. By failing to leverage common features—like textures, edges, or structural patterns—shared across different images, they miss out on valuable prior knowledge that could speed up training and improve generation quality.

The authors aim to bridge the gap between "learning from a single image" and "learning from a massive dataset" by creating a meta-learner that understands how to build a single-image generator for any given input.

Methodology: Hypernetworks and Adversarial Meta-Learning

The core innovation of this paper is the use of Hypernetworks. Instead of learning the weights of a generator directly, the authors train a meta-network ($f$) that takes an image as input and outputs the weights for a primary generator ($g$).

Key Architectural Components

  • Hyper-Generator and Hyper-Discriminator: The system uses two distinct hypernetworks ($f_g$ and $f_d$) to produce weights for a hierarchy of multiple generators and discriminators.
  • Weight Decomposition: To keep the massive parameter count of hypernetworks manageable, the networks are split into a shared embedding network (which extracts general features) and scale-specific linear projections.
  • Progressive Training: Similar to previous single-image GANs, this model trains across multiple scales, learning to generate coarse structures before refining fine details.
Comparison of meta-learning architectures for single-image GANs. The proposed method (a) utilizes both a hyper-generator and a hyper-discriminator to prevent feature leakage.

The Necessity of the Hyper-Discriminator

A critical theoretical and practical finding of the paper is that the model must be trained using an adversarial meta-learning approach where the discriminator is also generated by a hypernetwork. If the discriminator is simply shared across all images (as seen in alternative architectures), it fails to provide image-specific feedback. The authors prove that this leads to "patch leakage," where features from one training image accidentally appear in the generated variations of another.

Key Insights and Results

The authors evaluated their method on standard benchmarks, including Places-50, LSUN-50, and a custom "Valley" dataset of up to 5,000 images, yielding several significant breakthroughs:

  • Dramatic Speedups: Training time per image dropped from roughly 60 minutes (using SinGAN) to just 5 minutes in the dataset setting, representing a 12x improvement.
  • Competitive Performance: The model achieved competitive or superior SIFID (Single Image Fréchet Inception Distance) scores compared to established baselines like SinGAN and ConSinGAN.
  • Feedforward Inference: Once trained on a sufficiently large dataset (e.g., Valley-5000), the model can generate variations of a completely new, unseen image in a single forward pass. This takes only a fraction of a second and is a feat previously impossible for internal learning methods.
  • Generative Interpolation: Because the model maps images to a continuous weight space, users can linearly interpolate between the latent representations of two different images. This creates a smooth transition not just in pixel space, but in the underlying generative "style" of the models.

Limitations and Future Work

While highly effective, the approach has a few limitations:

  • Model Size: The hypernetwork approach requires a massive number of parameters. A single projection layer can reach ~18 million parameters, which heavily impacts GPU memory usage during training.
  • Out-of-Distribution (OOD) Limits: The model generalizes well to images similar to its training set (e.g., training on valleys and testing on a new valley). However, it struggles with images that are completely out of distribution (e.g., testing on a medical MRI scan after training on nature photos).

Future work will likely focus on increasing architecture capacity and training on even more heterogeneous datasets to further improve the "one-model-fits-all" capability for internal learning.

Summary updated

BibTeX
@inproceedings{bensadoun2021meta,
  author = {Raphael Bensadoun and Shir Gur and Tomer Galanti and Lior Wolf},
  title = {{Meta Internal Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
  url = {https://openreview.net/forum?id=xfskdMFkuTS},
}
Figure