DeepCaps: Going Deeper with Capsule Networks

Jathushan Rajasegaran, Vinoj Jayasundara, Sandaru Jayasekara, Hirunima Jayasekara, Suranga Seneviratne, Ranga Rodrigo

Abstract

Capsule Network is a promising concept in deep learning, yet its true potential is not fully realized thus far, providing sub-par performance on several key benchmark datasets with complex data. Drawing intuition from the success achieved by Convolutional Neural Networks (CNNs) by going deeper, we introduce DeepCaps, a deep capsule network architecture which uses a novel 3D convolution based dynamic routing algorithm. With DeepCaps, we surpass the state-of-the-art results in the capsule network domain on CIFAR10, SVHN and Fashion MNIST, while achieving a 68% reduction in the number of parameters. Further, we propose a class-independent decoder network, which strengthens the use of reconstruction loss as a regularization term. This leads to an interesting property of the decoder, which allows us to identify and control the physical attributes of the images represented by the instantiation parameters.

Introduction

Capsule Networks (CapsNets) were designed to preserve spatial hierarchies and model "part-whole" relationships, addressing fundamental weaknesses in standard Convolutional Neural Networks (CNNs), such as the loss of spatial information during pooling. However, early implementations were limited by their shallow depth. Stacking capsule layers historically introduced significant computational overhead, vanishing gradient issues, and a lack of spatial locality in the routing mechanism, which prevented them from scaling to complex datasets.

Architecture and Methodology

DeepCaps overcomes these limitations through a deep architecture comprising 16 convolutional capsule layers. A central innovation is the use of 3D Convolution-Based Dynamic Routing. Unlike traditional routing, which is fully connected and computationally expensive, this approach treats routing as a 3D convolution. This enforces locality—where capsules only vote for higher-level capsules in their spatial neighborhood—and enables parameter sharing, significantly reducing the model's footprint.

The DeepCaps architecture featuring stacked CapsCells and skip connections.

To ensure stable training in deep stacks, DeepCaps incorporates skip connections between capsule cells. By using element-wise addition, gradients can bypass the routing process, preventing the vanishing gradient problem that previously hindered deep capsule networks. The architecture utilizes specialized ConvCaps and ConvCaps3D layers to maintain the vector-based capsule structure while performing efficient convolutional operations.

Experimental Results

The model was evaluated on four standard benchmarks: CIFAR10, SVHN, Fashion MNIST, and MNIST. DeepCaps achieved a state-of-the-art accuracy of 91.01% on CIFAR10 for the capsule domain (92.74% with an ensemble), outperforming the original CapsNet.

Remarkably, it achieved these results with only 7.22 million parameters—a 68% reduction compared to the 22.48 million parameters in the original, shallower architecture. Inference speed also improved significantly; on an NVIDIA V100 GPU, DeepCaps inference took 1.38ms for a 64x64 image, whereas the original CapsNet took 2.86ms for a smaller 32x32 image.

Interpretability and the Class-Independent Decoder

Traditional CapsNets use class-dependent decoders for reconstruction. DeepCaps introduces a class-independent decoder that learns a joint distribution across all classes. This design choice makes the "instantiation parameters" within capsule vectors consistent and interpretable across different object categories.

Visualization of physical attributes controlled by universal instantiation parameters.

As shown in the figure, specific dimensions of the capsule vector correspond to physical attributes like rotation, thickness, and skewness. Because the decoder is class-independent, these parameters are universal; for example, a parameter representing "thickness" for the digit '1' will represent the same attribute for the digit '9'. This provides unprecedented controllability for data generation and a deeper understanding of the model's internal representations.

Conclusion

DeepCaps demonstrates that Capsule Networks can indeed "go deep" and scale to complex datasets. By combining 3D convolutional routing with skip connections and an interpretable decoder, the architecture provides a more efficient and powerful alternative to traditional shallow CapsNets. While a small performance gap remains compared to the most advanced CNNs like DenseNet, DeepCaps represents a significant step forward in realizing the potential of capsule-based deep learning.

Summary updated

BibTeX
@inproceedings{rajasegaran2019deepcaps,
  author = {Jathushan Rajasegaran and Vinoj Jayasundara and Sandaru Jayasekara and Hirunima Jayasekara and Suranga Seneviratne and Ranga Rodrigo},
  title = {{DeepCaps: Going Deeper with Capsule Networks}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2019},
  doi = {10.1109/cvpr.2019.01098},
}
Figure