All models

capsnet_mnist_dynamic_routing

A shallow capsule network that classifies images using dynamic routing between capsules.

Image classification · 90 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (63 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Family
CapsNet
Parameters
8.2M
Operations
90
Framework
PyTorch
Recurrent
Yes
Published
NeurIPS 2017
Cited by
4,080 (as of 22 October 2026)
Authors
Sara Sabour, Nicholas Frosst, Geoffrey E. Hinton
License
Apache-2.0
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m3749
Graph hash
82cd6e8f0549cc346bd2b66ac3a3358d3347967fd95cb860a8886b0114af7dd2
Skeleton hash
0f329a45d9a7ec5f675cef62f88d0099b2a3f1898563ecd223f36e0249a70638
Architecture hash
759b3984dd6b4287f7a84167971c19de03dd7d96d6a71445a216b85ec136fc0f
Diagram SHA-256
7a58a6fcef854235fd920ba5036e5d5c94a840f1286c3b9faf9bae6d0f82b6e2
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

This model is the MNIST configuration, whose PrimaryCapsules layer has 32 channels of convolutional 8D capsules, and it includes the decoder that reconstructs the digit.

About this model's family

CapsNet is a small image classifier built from capsules, groups of neurons whose activity vector describes one entity such as an object or an object part. The length of a capsule's vector represents the probability that the entity exists, and its orientation represents the entity's instantiation parameters. Capsule layers are connected by routing-by-agreement, an iterative procedure in which a lower-level capsule sends its output to the higher-level capsules whose activity agrees with its prediction.

The architecture is shallow, with only two convolutional layers and one fully connected layer. The final layer, DigitCaps, has one 16D capsule per digit class, and each receives input from all the capsules in the layer below. As a regularizer, a decoder of 3 fully connected layers reconstructs the input image from the output of the digit capsule.

The paper reports a 0.25% test error on MNIST with this 3 layer network. It counts 8.2M parameters for CapsNet, or 6.8M without the reconstruction subnetwork. On CIFAR10 the authors report 10.6% error with an ensemble of 7 models, each trained with 3 routing iterations on 24 × 24 patches of the image.

Key idea. The paper shows that a multi-layer system of capsules with iterative routing-by-agreement recognizes highly overlapping digits considerably better than a convolutional net.

  • capsnet
  • capsule network
  • capsule networks
  • dynamic routing between capsules
  • dynamic routing
  • routing-by-agreement
  • capsules
  • mnist capsule network
  • cifar10 capsule network

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{sabour2017dynamicroutingcapsules,
      title={Dynamic Routing Between Capsules}, 
      author={Sara Sabour and Nicholas Frosst and Geoffrey E Hinton},
      year={2017},
      eprint={1710.09829},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/1710.09829}, 
}