Source-linked AI summary

CapsuleGAN: Generative Adversarial Capsule Network

Ayush Jaiswal, Wael AbdAlmageed, Yue Wu, Premkumar Natarajan

arXiv:1802.06167v7stat.MLcs.LG

TL;DR

GANs are difficult to train reliably, motivating alternatives to conventional CNN-based discriminators. CapsuleGAN uses CapsNets as discriminators with design guidelines and a margin-loss objective, and reports better image-distribution modeling and semi-supervised classification than convolutional GANs across MNIST and CIFAR-10. The paper also identifies theoretical analysis of margin loss and broader GAN variants as future work.

  • Problem

    GANs model complex image distributions but face instability, vanishing gradients, mode collapse, and inadequate mode coverage.

  • Method

    CapsuleGAN replaces CNN discriminators with CapsNets, provides discriminator design guidelines, and incorporates CapsNet margin loss into the GAN objective.

  • Results

    CapsuleGAN outperforms convolutional GANs on the generative adversarial metric and semi-supervised classification for image data on MNIST and CIFAR-10.

  • Takeaways & Limitations

    The results motivate using CapsNets instead of CNNs as discriminators in GAN variants for image modeling.

  • Takeaways & Limitations

    The paper does not theoretically analyze the use of margin loss within the GAN objective and deliberately omits many GAN training tricks.

Abstract

from arXiv · show

We present Generative Adversarial Capsule Network (CapsuleGAN), a framework that uses capsule networks (CapsNets) instead of the standard convolutional neural networks (CNNs) as discriminators within the generative adversarial network (GAN) setting, while modeling image data. We provide guidelines for designing CapsNet discriminators and the updated GAN objective function, which incorporates the CapsNet margin loss, for training CapsuleGAN models. We show that CapsuleGAN outperforms convolutional-GAN at modeling image data distribution on MNIST and CIFAR-10 datasets, evaluated on the generative adversarial metric and at semi-supervised image classification.

1 Introduction

GANs model complex data distributions but remain difficult to train because of instability and mode-related problems. CapsuleGAN replaces conventional CNN discriminators with CapsNets and reports stronger image modeling and semi-supervised classification results.

  • Motivation: GANs combine a generator that maps prior samples to complex data distributions with a discriminator that distinguishes real from generated samples.The two networks are trained through an adversarial game.
  • Motivation: GAN training is affected by instability, vanishing gradients, mode collapse, and inadequate mode coverage.These challenges motivate improved objectives, training strategies, architectures, and heuristics.
  • Motivation: CapsNets learn representations more robust to pose and spatial relationships than CNNs, which motivates their use in GANs.The paper connects this motivation to CapsNets’ reported advantages on MNIST digit classification and overlapping-digit segmentation.
  • Contribution: CapsuleGAN uses CapsNets rather than CNNs as GAN discriminators and evaluates image modeling with generative adversarial and semi-supervised classification metrics.The framework is evaluated on MNIST and CIFAR-10.

2 Related Work

Prior GAN work established CNN-based architectures such as DCGANs and explored recurrent generators and classifier-like discriminators. CapsuleGAN extends this architectural line by changing the discriminator architecture.

  • CNN-based GANs: DCGANs use architectural guidelines to build CNN-based GANs for image data and related applications.They became a widely used approach for GAN architecture design.
  • Alternative architectures: Related work replaces CNN generators with recurrent neural networks or modifies discriminators to also act as classifiers.These approaches produced GRANs and became relevant to conditional GAN design.

3 Preliminaries

GANs learn a transformation from a simple prior to the data distribution using adversarial generator and discriminator models. CapsNets represent visual entities with vector outputs, route information between capsules, and train classification with margin loss and reconstruction regularization.

  • Generative adversarial networks: GANs transform prior samples z ∼ p_z into data-like samples through a generator G(z), while discriminator D distinguishes real from generated data.The generator and discriminator play an adversarial game.
  • Capsule networks: Capsules encode visual entities and their properties in vector outputs whose lengths represent entity presence.This representation supports capsule-based classification.
  • Capsule networks: Routing-by-agreement adjusts coupling coefficients between successive capsule layers using agreement between predicted and actual outputs.The coefficients determine how information flows between capsule pairs.
  • Capsule networks: CapsNet training uses margin loss with target labels and adds weighted image reconstruction loss using final-layer capsule outputs.The margin-loss formulation includes m+ = 0.9, m− = 0.1, and λ = 0.5.

4 Generative Adversarial Capsule Networks

CapsuleGAN keeps a deep CNN generator but replaces the conventional CNN discriminator with a capsule-based discriminator. Its discriminator uses a single output capsule and margin-loss-based objectives, with design constraints motivated by training stability and routing cost.

  • Architecture: CapsuleGAN uses capsule layers in the discriminator while retaining a deep CNN generator.The discriminator performs two-class classification of real versus generated images.
  • Design guidelines: CapsuleGAN keeps the CapsNet discriminator relatively small because powerful discriminators can harshly penalize the generator early and dynamic routing is slow.The parameter constraint also aligns with shallow convolutional discriminator designs.
  • Objective: The discriminator’s single final capsule represents the probability that its input is real or generated, and training uses margin loss instead of binary cross-entropy.The objective applies margin loss to real targets T = 1 and generated targets T = 0.
  • Objective: The generator minimizes LM(D(G(z)), T = 1), removing the margin-loss down-weighting factor λ from generator training.This differs from minimizing the discriminator-style generated-sample term.

5 Experimental Evaluation

Experiments compare CapsuleGAN with convolutional GAN using matched generators on MNIST and CIFAR-10. CapsuleGAN produces competitive or improved image quality, GAM outcomes, and semi-supervised classification performance.

  • Experimental setup: Both models use the same generator architecture and are evaluated on randomly generated MNIST and CIFAR-10 images.
  • Visual quality: CapsuleGAN images are similarly crisp on MNIST, while convolutional-GAN outputs appear less diverse in generated digit classes.
  • Visual quality: CapsuleGAN images look cleaner and crisper than convolutional-GAN images on CIFAR-10, although both produce diverse image sets.
  • Generative adversarial metric: CapsuleGAN achieves r_samples = 0.79 and r_test = 1 on MNIST, outperforming convolutional GAN on the generative adversarial metric.The metric requires r_samples < 1 and r_test ≃ 1 for CapsuleGAN to win.
  • Semi-supervised classification: CapsuleGAN consistently outperforms convolutional GAN in semi-supervised classification, by 1.7–3.97 percentage points on MNIST and 0.91–3.22 on CIFAR-10.The experiments use 50,000 generated images and n ∈ {100, 1000, 10000} real labeled samples.

6 Discussion and Future Work

CapsuleGAN replaces CNN discriminators with CapsNets and uses a margin-loss-based objective. The authors report improvements on the evaluated tasks and identify theoretical analysis and broader architectural applications as future work.

  • Contributions: CapsuleGAN uses CapsNets instead of CNNs as discriminators and incorporates an updated objective function for training.
  • Findings: CapsuleGAN outperforms convolutional GANs on the generative adversarial metric and semi-supervised classification for MNIST and CIFAR-10.
  • Future work: The authors plan theoretical analysis of margin loss within the GAN objective and further evaluation of CapsNets as encoders in GAN variants.
Loading 1802.06167v7…