Group Equivariant Capsule Networks

Jan Eric Lenssen, Matthias Fey, Pascal Libuschewski

Abstract

Standard Convolutional Neural Networks (CNNs) are naturally equivariant to translations but struggle with other geometric transformations like rotations. Capsule Networks were proposed to address this by disentangling an object's existence from its properties (pose), yet original architectures lacked formal mathematical guarantees. We present Group Equivariant Capsule Networks, a framework that defines capsules on group manifolds. By introducing manifold-aware routing and pose-aligning kernels, we provide rigorous guarantees for equivariance and invariance. Our approach achieves state-of-the-art performance on MNIST-rot and affNIST with significantly fewer parameters than previous capsule implementations.

Introduction

Deep learning models often fail to generalize across geometric transformations. While translation equivariance is baked into the convolution operation, rotations and reflections typically require extensive data augmentation or specialized architectures. Capsule Networks (CapsNets) offer a promising alternative by representing entities as vectors where the magnitude denotes existence and the orientation denotes "pose." However, original CapsNets faced two primary hurdles: vector space averaging on curved manifolds (like rotations) and receptive field agnosticism, which breaks equivariance during spatial aggregation.

Methodology

The proposed Group Equivariant Capsule Network defines pose vectors as elements of a Lie group $G$ (e.g., the group of 2D rotations, $SO(2)$).

Manifold-Aware Routing

In traditional capsule networks, "routing-by-agreement" involves averaging the "votes" of lower-level capsules to determine the pose of a higher-level capsule. However, if these poses represent rotations, they exist on a curved manifold rather than a flat Euclidean space. Averaging rotations as if they were regular vectors leads to invalid poses. To solve this, the authors implement a routing algorithm using a left-equivariant weighted average ($\mathcal{M}$) and a distance-preserving metric ($\delta$) defined specifically for the group manifold. This ensures that the routing process itself respects the underlying geometry, guaranteeing that if the input transforms, the output pose transforms identically (equivariance) while the activation strength remains constant (invariance).

Pose-Aligning Kernels

A significant challenge in achieving equivariance in deep networks is "receptive field agnosticism." When a standard convolution operation aggregates features from a local neighborhood, it does not account for the orientation of those features relative to the center. The authors address this by "aligning" the receptive field: they calculate a local mean pose and use its inverse to transform the coordinates of the trainable kernels. Essentially, the network "un-rotates" its view of the local neighborhood before applying the convolution, ensuring a consistent feature representation regardless of the input's global orientation.

Sparse Group Convolutions

The framework integrates capsules with Group Convolutions (G-convs). Instead of evaluating a convolution over a dense grid of all possible rotations, the model uses capsule poses as "sparse indices," evaluating the convolution only where the capsules suggest an object exists. This allows the model to achieve high accuracy with significantly fewer parameters.

Experimental Results

The framework was evaluated on three primary benchmarks: MNIST-rot, affNIST, and standard MNIST.

  • Superior Generalization: On the MNIST-rot dataset, the model achieved 98.42% accuracy, significantly outperforming a standard CNN (92.30%) and a basic Capsule baseline (94.68%).
  • Parameter Efficiency: On affNIST, the model reached 89.10% accuracy using only 235k parameters. For comparison, the original Sabour et al. (2017) capsule model required 6.8 million parameters to achieve 79% accuracy.
  • Exact Equivariance: For rotations by multiples of 90 degrees, the network produced identical activations and perfectly transformed pose vectors, with numerical errors below 0.0001.
  • Pose Accuracy: Incorporating a reconstruction loss further refined the poses, reducing the average pose error from 28.32 to 16.21 degrees.

Discussion and Future Work

While Group Equivariant Capsule Networks bridge the gap between intuitive routing and mathematical symmetry, some limitations remain. The current framework requires poses to be elements of a group with well-defined mean and distance operations. Furthermore, calculating Karcher means on complex manifolds like 3D rotations ($SO(3)$) can be computationally expensive. Future work will focus on applying these principles to higher-dimensional groups and more complex vision tasks beyond digit recognition.

Summary updated

BibTeX
@inproceedings{lenssen2018group,
  author = {Jan Eric Lenssen and Matthias Fey and Pascal Libuschewski},
  title = {{Group Equivariant Capsule Networks}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2018},
}
Figure