XenonStack Glossary: AI, Data and Cloud Terms Explained

Capsule Networks (CapsNet) vs CNN: A Plain Guide

Written by Dr. Jagreet Kaur | 07 Feb 2023

A capsule network is a neural network built from capsules, groups of neurons whose activity vector represents the parameters of an object or object part. The length of that vector represents the probability that the entity exists, and its orientation encodes the entity's properties.

This page is for practitioners and technology leaders comparing CapsNet with a convolutional neural network (CNN). It covers how capsules work, the routing idea, the comparison, and a short first-steps list.

What is a capsule network?

The paper Dynamic Routing Between Capsules by Sara Sabour, Nicholas Frosst and Geoffrey Hinton introduced the approach in its modern form. Lower-level capsules make predictions for higher-level capsules through transformation matrices. That structure lets the network keep information about where a part sits and how it is oriented, instead of reducing everything to whether a feature is present.

How does routing by agreement work?

The paper uses an iterative process called routing by agreement. A lower-level capsule sends its output to the higher-level capsules whose activity vectors closely match its prediction. In the authors' words, when multiple predictions agree, a higher level capsule becomes active.

Dynamic routing, the name used in the paper title, is this agreement mechanism. It is the core of the idea and it is what separates capsules from a stack of ordinary layers.

How do capsule networks differ from CNNs?

The Stanford CS231n notes on convolutional networks describe what a CNN does: each neuron connects to only a local region of the input, neurons in a depth slice share weights, and pooling progressively reduces the spatial size of the representation. For example, 2 by 2 max pooling with stride 2 discards 75 per cent of the activations.

AspectCNNCapsule network
Unit of representationA single neuron activation in a feature mapA capsule: a vector with length and orientation
How layers connectLocal connections with shared weights, plus poolingPredictions through transformation matrices, routed by agreement
What is keptWhether a feature is present, with spatial size reduced by poolingThe probability an entity exists and its properties
Reported resultEstablished, widely usedState-of-the-art MNIST result and better on highly overlapping digits, per the paper

Where were capsule networks shown to help?

The authors report that a discriminatively trained, multi-layer capsule system achieves state-of-the-art performance on MNIST and is considerably better than a convolutional network at recognising highly overlapping digits. That is a research result on a specific benchmark. The sources read for this page do not show that capsule networks replace CNNs in general, so test them on your own data before choosing.

How do capsule networks relate to AI agents?

Agents that read images or sensor streams rely on a perception model, and CNNs or capsule networks are candidates for that role. On ElixirClaw, XenonStack's AI agents computing platform, a perception model is one component an agent can use. Pick it by measured accuracy, cost and robustness on your own images, and log which model produced each decision.

What should you do first?

  1. Define the perception task and the images or signals involved.
  2. Train a CNN baseline and record its accuracy.
  3. Try a capsule implementation on the same split and compare.
  4. Test on overlapping or cluttered inputs, where capsules were reported to help.
  5. Choose by results, cost and maintainability, not by novelty.

To map one decision your agents make, and the data and policy it depends on, book a Context Workshop. See what happens in the workshop.

Frequently asked questions

What is a capsule network in simple terms?

It is a neural network built from capsules, groups of neurons whose activity vector encodes the properties of an object or part, with its length showing how likely the entity is to exist.

What is routing by agreement?

It is an iterative process in which a lower-level capsule sends its output to the higher-level capsules whose activity vectors closely match its prediction.

Do capsule networks beat CNNs?

On MNIST the authors report state-of-the-art performance and better results on highly overlapping digits. That is one benchmark, so compare on your own data.

Who introduced capsule networks in this form?

Sara Sabour, Nicholas Frosst and Geoffrey Hinton, in the paper Dynamic Routing Between Capsules.