Capsule Networks - A Probabilistic Perspective

Lewis Smith, Lisa Schut, Yarin Gal, Mark van der WilkarXiv 2020

Introduction

Capsule Networks (CapsNets) were introduced to provide a more robust, viewpoint-invariant approach to computer vision by modeling objects as hierarchical arrangements of parts. While intuitively appealing, the "routing-by-agreement" mechanisms used in early implementations often lacked a rigorous mathematical foundation. In "Capsule Networks—A Probabilistic Perspective," Smith et al. reformulate CapsNets as a formal generative model, deriving routing directly from variational inference principles.

The Generative Probabilistic Model

The authors propose a model where a scene is represented as a hierarchy of capsules. Each capsule is defined by a presence variable ($t$) and a pose matrix ($A$). In the generative process, a parent capsule generates its children through learned affine transformations: $A_{child} = A_{parent} \times M$.

The hierarchical generative model for Capsule Networks, illustrating the dependencies between parent and child capsules.

To account for background noise or parts not belonging to any specific object, the model includes a "dummy" parent capsule. The final image is rendered using fixed templates—small image patches—that are transformed according to the leaf capsules' poses and layered via alpha compositing.

Routing as Variational Inference

A central contribution of this work is the redefinition of "routing." Instead of a heuristic algorithm, routing is treated as approximate inference using the Evidence Lower Bound (ELBO). This allows the use of standard Bayesian tools to optimize the latent variables ($t, A$) that best explain the observed image.

To achieve efficient inference, the authors employ an amortized approach using an encoder network. Given that capsules represent a set of parts, they utilize a Set Transformer in the encoder to ensure permutation invariance, treating the input parts as an unordered collection rather than a fixed-grid feature map.

Results and Generalization

The probabilistic framework was evaluated on MNIST, Rotated MNIST, and affNIST. The model achieved high unsupervised accuracy (~96-97%) on MNIST by clustering latent variables. One of the most significant findings involves the model's behavior under rotation. While standard convolutional networks often struggle with unseen orientations, the probabilistic CapsNet demonstrates superior robustness.

Test accuracy on rotated MNIST. The probabilistic model (Ours) demonstrates significantly better generalization to large rotations compared to VAE and SCA baselines.

However, the authors identified an "identifiability trap": training with heavy data augmentation can lead the model to learn multiple separate capsules for different orientations of the same part, rather than a single equivariant representation. To combat this at test time, the model can perform "free-form" optimization of the ELBO, refining the encoder's initial guess to significantly improve performance on difficult, highly rotated samples.

Discussion and Limitations

Despite its theoretical elegance, the model faces practical challenges. The use of fixed templates for rendering is restrictive, and the test-time optimization process is computationally expensive—roughly 1,000 times slower than a standard forward pass. Future research is needed to develop more flexible neural decoders and stronger priors to ensure true equivariance without duplicating capsule representations.

By grounding Capsule Networks in probabilistic inference, this work provides a clearer path for critiquing and improving these architectures using established Bayesian methodologies.

Summary updated

BibTeX
@misc{smith2020capsule,
  author = {Lewis Smith and Lisa Schut and Yarin Gal and Mark van der Wilk},
  title = {{Capsule Networks - A Probabilistic Perspective}},
  year = {2020},
  eprint = {2004.03553},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2004.03553},
}
Figure