Glossary term
Capsule neural network
A capsule neural network, or CapsNet, groups neurons into capsules that output vectors or matrices to represent both the presence of a feature and its pose. Routing by agreement lets lower-level capsules send outputs to higher-level capsules when their predictions align, aiming to model part-whole relationships and preserve spatial structure. The approach was introduced by Geoffrey Hinton and colleagues, with dynamic routing popularized in 2017. CapsNets show promise but are harder to train and scale than standard CNNs, so their use in production remains limited.
What is a capsule neural network?
A capsule neural network is an architecture that replaces scalar neuron outputs with vector or matrix capsules and uses routing to model hierarchical relationships and pose information. It is intended to address limitations of pooling in CNNs by preserving information about where features are and how they are oriented.
Capsules can be seen as groups of neurons whose activity encodes both the probability of a feature and its instantiation parameters, such as position, scale, and rotation. This representation aims to make the network equivariant to viewpoint changes rather than only invariant, which can help with recognizing objects under different poses.
How does a capsule neural network work?
A capsule neural network uses capsules that output pose-aware representations. Lower-level capsules make predictions about higher-level capsules, and an iterative routing process strengthens connections when predictions agree. The length of a capsule output often represents the probability of a feature, while the orientation encodes pose or other attributes.
Common routing methods include routing by agreement and EM routing. These methods attempt to cluster lower-level predictions into coherent higher-level entities, which helps the model capture part-whole structure like eyes to face or wheels to car.
A typical CapsNet begins with convolutional layers that feed into primary capsules, followed by higher-level capsules that represent object classes or parts. Many implementations use a squash nonlinearity to keep capsule vectors bounded and a margin loss to encourage correct classes, sometimes paired with a reconstruction loss that promotes informative pose encoding.
Early studies reported results on datasets like MNIST and smallNORB, using digit capsules or object capsules to test pose sensitivity and part-whole composition.
Dynamic routing often uses a softmax over coupling coefficients and updates them based on agreement between predicted and actual capsule outputs across a small number of iterations.
What are the benefits of using a capsule neural network?
The benefits of using a capsule neural network can include:
- Better modeling of pose and part-whole relationships compared to standard pooling.
- Potential robustness to viewpoint changes or occlusion in some settings.
- More structured intermediate representations that may aid analysis.
- Reduced reliance on large pooling operations, which can preserve spatial detail.
What are some potential applications of capsule neural networks?
Capsule neural networks have been explored in image recognition, object detection, and some 3D or medical imaging tasks. There has also been research into applying capsules to NLP, though results are mixed and less common than in vision.
Some studies focus on small or structured datasets where explicit part-whole reasoning is valuable, such as digit classification or anatomy segmentation. Research also explores hybrid models that combine CNN feature extractors with capsule layers to improve spatial reasoning.
What are some challenges associated with capsule neural networks?
Capsule neural networks can be difficult to train and scale, with routing adding computational overhead and instability. They have not consistently outperformed strong CNN baselines on large benchmarks, and tooling and hardware support are less mature than for standard architectures. These challenges limit adoption despite ongoing research interest.
Additional challenges include sensitivity to hyperparameters, limited support in common deep learning libraries, and difficulty training very deep capsule stacks. As a result, most practical deployments still rely on CNNs or vision transformers, while capsules remain an active research topic.
More terms
Continue exploring the glossary.
Glossary term
What is connectionism?
It's time to build
Collaborate with your team on reliable Generative AI features.
Want expert guidance? Book a 1:1 onboarding session from your dashboard.