Abstract
Generative DNNs are a powerful tool for image synthesis, but they are limited by their computational load. On the other hand, given a trained model and a task, e.g. faces generation within a range of characteristics, the output image quality will be unevenly distributed among images with different characteristics. It follows, that we might restrain the models complexity on some instances, maintaining a high quality. We propose a method for diminishing computations by adding so-called early exit branches to the original architecture, and dynamically switching the computational path depending on how difficult it will be to render the output. We apply our method on two different SOTA models performing generative tasks: generation from a semantic map, and cross-reenactment of face expressions; showing it is able to output images with custom lower-quality thresholds. For a threshold of LPIPS <=0.1, we diminish their computations by up to a half. This is especially relevant for real-time applications such as synthesis of faces, when quality loss needs to be contained, but most of the inputs need fewer computations than the complex instances.
Introduction
Deep Neural Networks (DNNs), particularly Generative Adversarial Networks (GANs) used for high-resolution image synthesis, are notoriously computationally intensive. This high GFLOP requirement makes them difficult to deploy in real-time applications like mobile filters or live video avatars.
A key observation driving this research is that not all images are equally difficult to generate. A model typically spends the same energy rendering a simple, front-facing portrait as it does a complex, highly-angled face with intricate lighting. While "Early Exit" (EE) strategies have succeeded in classification tasks, they are challenging for generative models because intermediate layers usually contain abstract feature maps rather than meaningful images. The researchers evaluated their proposed solution, FIANCEE, on two state-of-the-art (SOTA) generative tasks: landscape generation from semantic maps (Cityscapes) and neural head avatar creation (VoxCeleb2).
Methods
FIANCEE (Faster Inference of Adversarial Networks via Conditional Early Exits) introduces a framework that adds three novel components to existing generative backbones to enable dynamic computational paths.
- Depth-Varying Exit Branches: Instead of stopping abruptly, FIANCEE attaches lightweight branches to the main backbone. These branches are reduced versions of the remaining backbone layers, allowing the model to "finish" the image generation process using fewer parameters.
- Exit Predictor: A small, separate network analyzes the initial input to predict the expected quality (LPIPS score) for every available exit. It selects the earliest (fastest) branch that meets a user-defined quality threshold before the main generation begins.
- Guiding Feature Database: To bolster the performance of early, "thin" branches, a semi-parametric approach is used. A small database of high-quality features is maintained. During inference, the model retrieves similar patches to "guide" early branches, effectively filling in structural details that the lightweight layers might otherwise miss.
Results and Insights
The researchers demonstrated that generative early exits are not only possible but highly efficient. By adding completion branches, intermediate features can be successfully transformed into high-quality pixels. A significant finding was that image "difficulty" is predictable; for instance, the head rotation angle in portraits correlates directly with the required backbone processing depth.
Key performance metrics include:
- Computational Savings: For a standard quality threshold (LPIPS ≤ 0.1), FIANCEE reduced computations by up to 50%.
- Efficiency Gains: The model achieved a mean gain of $1.2 \times 10^3$ GFLOPs saved per unit of quality loss for landscapes and $1.3 \times 10^3$ for face synthesis.
- Predictor Accuracy: The exit predictor estimated quality with a mean error of only ~5%, ensuring the system reliably meets user requirements.
Discussion and Limitations
While FIANCEE offers substantial speedups, it currently has some limitations. The method is designed for CNN-based decoders and is not yet directly applicable to Transformers. Additionally, implementing the framework requires training new branches and the predictor, increasing initial development overhead. Future work may focus on more strategic database selection and optimizing the system for large-batch server-side scenarios, where varying computational paths can lead to GPU idling challenges.
Summary updated