Compressing Image-to-Image Translation GANs Using Local Density Structures on Their Learned Manifold

Alireza Ganjdanesh, Shangqian Gao, Hirad Alipanah, Heng Huang

TL;DR

MGGC (Manifold Guided GAN Compression) is a novel framework that slims down heavy image-to-image translation GANs by ensuring the pruned model preserves the "local density structure" of the original model's learned manifold. By using collaborative pruning agents that balance the capacities of the generator and discriminator, MGGC achieves state-of-the-art compression ratios—up to 95%—while often maintaining or even improving image quality.

What Problem Does This Paper Address?

Generative Adversarial Networks (GANs) are the gold standard for tasks like turning sketches into photos or swapping horses for zebras. However, they are computationally massive, making them nearly impossible to run on mobile or edge devices.

Compressing GANs is significantly harder than compressing standard CNN classifiers. In a standard CNN, you just care about accuracy; in a GAN, you are managing a delicate "adversarial game" between a generator and a discriminator. If you prune the generator too much without touching the discriminator, the balance is destroyed, the Nash Equilibrium collapses, and the model fails to converge. Furthermore, most existing methods treat GANs like simple classifiers, ignoring their most vital trait: they are generative models that learn a complex data distribution (a manifold).

Methods

The authors introduce two primary innovations to tackle these challenges:

  1. Local Density Preservation: Instead of just matching pixels, the authors argue that a pruned GAN should "forget" as little as possible about the original model's learned manifold. They partition this manifold into local neighborhoods. Using a self-supervised encoder (fine-tuned on the target data), they identify the $k$-nearest neighbors for generated samples. They then use a novel adversarial objective to force the pruned model to mimic the local density of the original model within these neighborhoods, similar to a technique called Kernel Density Estimation (KDE).
  2. Collaborative Pruning Agents: To keep the adversarial game stable, the authors use two reinforcement-learning-style agents, $gen_G$ and $gen_D$, to determine the architecture of the generator and discriminator respectively.
  3. Feedback Loop: As shown in Figure 1, these agents exchange "architecture embeddings." When $gen_G$ decides which parts of the generator to cut, it looks at what $gen_D$ is doing, and vice versa. This ensures the two models stay "matched" in capacity throughout the pruning process.
  4. Differentiable Pruning: They use the Gumbel-Sigmoid trick and Straight-Through Estimators (STE) to allow gradients to flow through the discrete choices of which neural network channels to keep or kill.
Figure 1: Our GAN pruning method. We encourage the pruned generator to preserve the density structure of the original model over its learned manifold during pruning. To do so, we partition the manifold into local neighborhoods around the samples generated by the original generator (Fig. 2) and represent each local neighborhood with a ‘Center’ sample (shown with a red frame) and its neighbors (blue frames). We use these samples as ‘real’ samples and the one generated by the pruned generator as a ‘fake’ one in our adversarial pruning objective. We implement our adversarial game with two pruning agents, genG and genD, that collaboratively learn to prune the original pretrained G and D. genG (genD) takes the architecture embedding of their colleague genD (genG) when determining the architecture of G (D). By doing so, genG and genD can maintain the balance between the capacity of G and D during pruning and make the process stable. (Fig. 4)

Datasets

The researchers evaluated their method on two classic image-to-image translation frameworks:

  • Pix2Pix: Tested on the Cityscapes (urban scenes) and Edges2Shoes datasets.
  • CycleGAN: Tested on the Horse2Zebra and Summer2Winter datasets.

Key Insights and Ideas

  • The Manifold Matters: The "aha moment" here is that the geometry of the learned space is a powerful supervision signal. By focusing on local neighborhoods (Figure 2), the complex task of global manifold matching becomes a series of simpler, local density matching problems.
  • Don't Prune in a Vacuum: Pruning the generator alone is a recipe for failure. The discriminator must be pruned dynamically to maintain the "fairness" of the adversarial game.
  • Stability through Communication: The exchange of feedback between pruning agents leads to much smoother training dynamics. Figure 4 in the paper illustrates how the losses of the generator and discriminator stay closely coupled and stable when the manifold regularization ($\lambda_1$) is properly tuned.
Figure 2: Our method to find local neighborhoods on the learned manifold of the original generator. (Top Left): First, we obtain the original model’s predictions in the target domain for training samples in the source domain. (Right and Down): We call the sample that we want to find its local neighborhood on the manifold ‘Center’ sample (shown with Red solid frame). We pass the predicted samples in the previous step to a pretrained self-supervised encoder (Caron et al. 2020) that is fine-tuned on the target images in the training dataset. Then, we take the samples whose representations have the highest cosine similarity with the representation of the ‘Center’ sample as its approximate neighbors on the manifold. Neighbor samples and the approximate neighborhood on the manifold are shown with blue crosses and a dashed line.

Key Results

MGGC consistently outperformed state-of-the-art baselines across all metrics:

  • Efficiency: On Cityscapes (Pix2Pix), MGGC reduced computational costs (MACs) by 83.60% while actually improving the mean Intersection over Union (mIoU) by 1.92 points over the original, uncompressed model.
  • Extreme Compression: For CycleGAN on Horse2Zebra, it achieved a massive 95.60% compression ratio with a Frechet Inception Distance (FID) of 55.06, significantly beating the previous best method (GCC) which scored 59.31.
  • Visual Fidelity: Qualitative results (Figure 3) show that MGGC-compressed models retain sharp details and faithful background colors that other pruning methods often wash out or distort.
Figure 3: Qualitative results for 1) Pix2Pix: Cityscapes (top left), Edges2Shoes (bottom left), and 2) CycleGAN: Horse2Zebra (top right) and Summer2Winter (bottom right).

Limitations and Future Work

While the results are impressive, the paper leaves a few stones unturned:

  • Dependency on Pre-trained Encoders: The method relies on a high-quality self-supervised encoder (like SwAV) to define the manifold neighborhoods. If such a model isn't available for a specific niche domain, the performance might degrade.
  • Computational Overhead of Pruning: While the final model is tiny, the pruning process itself involves training two additional agents and performing neighborhood searches, which adds to the initial training time.
  • Future Directions: The authors suggest that this manifold-centric approach could be extended beyond I2I GANs to other generative architectures, potentially including the now-dominant Diffusion Models.

Summary updated

BibTeX
@inproceedings{ganjdanesh2024compressing,
  author = {Alireza Ganjdanesh and Shangqian Gao and Hirad Alipanah and Heng Huang},
  title = {{Compressing Image-to-Image Translation GANs Using Local Density Structures on Their Learned Manifold}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  doi = {10.1609/aaai.v38i11.29100},
}
Figure