E2GAN: Efficient Training of Efficient GANs for Image-to-Image Translation

Yifan Gong, Zheng Zhan, Qing Jin, Yanyu Li, Yerlan Idelbayev, Xian Liu, Andrey Zharkov, Kfir Aberman, Sergey Tulyakov, Yanzhi Wang, Jian Ren · DOI

TL;DR

$E^2$GAN introduces a "double efficiency" framework for image-to-image translation: it significantly speeds up both the training of new image editing concepts and their inference on mobile devices. By distilling large-scale diffusion models into lightweight GANs using Low-Rank Adaptation (LoRA) and smart data selection, the authors enable high-quality, real-time (60+ FPS) mobile image editing with 33x faster training and 869x less storage per concept than previous distillation methods.

The Challenge: Bulky Diffusion Models

Large-scale text-to-image diffusion models (like Stable Diffusion) have revolutionized image editing, but they are computationally expensive. Running them on a mobile device often takes 30 seconds or more per image—far from the real-time performance needed for interactive applications.

Generative Adversarial Networks (GANs) are much faster and mobile-friendly, but they lack the broad knowledge of diffusion models. A common workaround is data distillation: using a diffusion model to generate a paired dataset (e.g., "Original Face" $\rightarrow$ "Face as a Cyborg") and training a GAN to mimic that specific transformation. However, training a high-quality GAN from scratch for every new artistic style is slow, data-hungry, and requires massive storage for each individual model. $E^2$GAN aims to make this distillation process efficient enough for large-scale deployment.

Methods

The authors propose three main innovations to achieve "Efficient training of Efficient GANs":

  1. Base GAN with Transformer Blocks: Instead of a standard ResNet-based GAN, they construct a "Base GAN" trained on a diverse mix of concepts. They found that reducing the number of ResNet blocks and inserting a single Transformer Block (TB) with self- and cross-attention allowed the model to capture global structures better while maintaining a tiny 15.5ms latency on an iPhone 14.
  2. Crucial Layer Fine-Tuning via LoRA: Rather than updating all 80M+ parameters for a new concept, the authors identified "crucial layers" (sampling layers and the Transformer block). They apply Low-Rank Adaptation (LoRA) to these layers, updating only ~1.29% of the total weights (0.092M parameters).
  3. Similarity Clustering (SC) for Data Reduction: To reduce training time further, they use K-means clustering on image embeddings to select a small, diverse subset of "representative" images. This allows the model to learn a new concept using only 400 images instead of 800+, cutting training time in half without sacrificing quality.

Key Results

$E^2$GAN demonstrates significant improvements across training, storage, and deployment metrics compared to conventional GAN distillation and diffusion baselines.

Comparison of training efficiency and mobile deployment latency between conventional methods and E2GAN.
  • Inference Speed: $E^2$GAN runs in 15.5ms on an iPhone 14 Pro, achieving over 60 FPS. For comparison, the "teacher" diffusion model takes nearly 2,000ms.
  • Training Efficiency: Training a new concept takes only 200 seconds on an H100 GPU, compared to 6,600 seconds for previous distillation baselines (a 33x speedup).
  • Storage Savings: Because only the LoRA weights need to be saved for each new "filter," the storage requirement drops from ~80MB to just 0.092MB per concept (an 869x reduction).
  • Quality: Despite being much smaller, $E^2$GAN achieved a better FID score (80.28 on FFHQ) than standard pix2pix (86.03), meaning the generated images were more realistic and closer to the diffusion model's output.

Key Insights

  • Strategic Transformer Placement: The authors discovered that placing a single Transformer Block after the second ResNet block in the bottleneck provided the best balance of image quality and mobile latency. Adding more blocks increased latency by ~35% with negligible gains in image quality.
  • Transfer Learning for GANs: Traditionally, GAN distillation is done from scratch. This paper proves that a pre-trained "Base GAN" with generalized features can learn a specific new concept much faster than a blank-slate model, mirroring the success of fine-tuning in the NLP world.

Limitations and Future Work

  • Teacher Dependency: The GAN is limited by the quality of the diffusion model used to train it. If the diffusion model fails to render a prompt correctly, the GAN will inherit those flaws.
  • Prompt Complexity: While $E^2$GAN handles stylistic and attribute changes well, extremely complex or "out-of-distribution" prompts remain a challenge for lightweight architectures.
  • Future Directions: The authors suggest that developing even faster techniques to construct high-quality paired datasets from diffusion models would further democratize the creation of real-time mobile AI effects.

Summary updated

BibTeX
@inproceedings{gong2024e,
  author = {Yifan Gong and Zheng Zhan and Qing Jin and Yanyu Li and Yerlan Idelbayev and Xian Liu and Andrey Zharkov and Kfir Aberman and Sergey Tulyakov and Yanzhi Wang and Jian Ren},
  title = {{E2GAN: Efficient Training of Efficient GANs for Image-to-Image Translation}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=lrPrkWXqzd},
}
Figure