NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Attention routing between capsules

Jaewoong Choi, Hyun Seo, Suii Im, Myungju KangWorkshops @ ICCV 2019

Abstract

Capsule Networks (CapsNets) were proposed to overcome the limitations of Convolutional Neural Networks (CNNs) by better encoding spatial relationships and pose information through transformation equivariance. However, the original architecture's reliance on iterative "dynamic routing" makes it computationally expensive and difficult to scale. This paper presents AR CapsNet, a streamlined architecture that replaces iterative routing with a fast attention mechanism. AR CapsNet achieves significantly higher accuracy on datasets like CIFAR-10 and affNIST while utilizing fewer parameters and training up to five times faster than the original CapsuleNet.

Introduction

Standard CNNs achieve translation invariance by losing precise spatial relationships between features—a phenomenon often illustrated by the "face with an eye on the chin" problem. CapsuleNets address this by representing features as vectors (capsules) that encode properties such as position, size, and orientation. While conceptually elegant, the original dynamic routing process is an iterative clustering-like procedure that is parameter-heavy and often fails to outperform CNNs on complex natural images. AR CapsNet addresses these efficiency and performance bottlenecks by reimagining routing as a single-pass attention operation.

Methodology

The AR CapsNet architecture introduces two fundamental changes to the capsule framework:

  1. Attention Routing: The iterative "agreement" process is replaced by an attention module. Agreement between layers is calculated via a scalar product between capsules and a trainable kernel acting as a reference vector. This transformation turns routing into a fast, single forward-pass operation that preserves spatial information.
  2. Capsule Activation: The traditional "squash" function is replaced with a new Capsule Activation consisting of an affine transformation followed by a tanh function. The authors posit that performing operations at the capsule scale is more critical than strictly preserving vector orientation.
Overall architecture of AR CapsNet, illustrating the transition from standard convolutions to primary and convolutional capsule layers.

The architecture is designed convolutionally, allowing for weight sharing and easier stacking of layers compared to the fully connected approach of the original model.

Experimental Results

The model was evaluated on MNIST, affNIST (testing robustness to affine transformations), and CIFAR-10 (natural images).

Performance and Efficiency

AR CapsNet demonstrates substantial improvements in both speed and accuracy. On MNIST, it requires only 65% of the parameters and 19% of the training time of the original CapsuleNet. Its performance on affNIST (91.6% accuracy vs. 79%) highlights its superior robustness to spatial transformations. Notably, AR CapsNet bridges the gap on CIFAR-10, reaching 87.19% accuracy (and up to 90.11% with an ensemble), whereas the original model struggled at approximately 63.1%.

Comparison of test accuracy across various benchmarks. AR CapsNet (Ours) significantly outperforms the baseline CapsuleNet on affNIST and CIFAR-10.

Equivariance and Interpretability

Dimension perturbation experiments confirm that AR CapsNet maintains the core appeal of capsules: individual dimensions within the vectors encode specific visual properties such as skew, thickness, and rotation. This confirms that the transition to attention-based routing does not sacrifice the model's ability to learn meaningful, equivariant representations.

Conclusion

By shifting the routing paradigm from unsupervised clustering to a supervised attention mechanism, AR CapsNet makes Capsule Networks a viable alternative for complex image recognition tasks. While it still trails the most advanced modern CNNs and Transformers on very large-scale datasets, its efficiency and robustness to affine transformations mark a significant step forward. Future work includes exploring feature compression via 1x1 convolutions and integrating more sophisticated Transformer-based attention mechanisms.

Summary updated

BibTeX
@inproceedings{choi2019attention,
  author = {Jaewoong Choi and Hyun Seo and Suii Im and Myungju Kang},
  title = {{Attention routing between capsules}},
  booktitle = {Workshops @ ICCV},
  year = {2019},
  url = {https://openreview.net/forum?id=XVOFjFViTc5},
}
Figure