Technical GUIDE

Capsule Networks

Capsule networks are a neural architecture that groups neurons into 'capsules' that output vectors encoding both whether a feature exists and its pose (position, orientation, scale).

2 min readLast updated

Overview

They aim to fix a core blindness in standard convolutional networks: losing track of spatial relationships between parts.

Deep Dive

Proposed by Geoffrey Hinton, Sara Sabour, and Nicholas Frosst in 2017, capsule networks replace a scalar neuron output with a vector. The vector's length represents the probability that an entity (like an eye or a nose) is present, while its orientation encodes pose parameters. Lower-level capsules predict the pose of higher-level capsules through transformation matrices, and a process called dynamic routing-by-agreement decides which predictions to trust. When multiple part-capsules agree on the same whole, routing strengthens that connection. The original CapsNet achieved strong results on MNIST and was notably robust to overlapping digits and affine transformations, addressing the 'Picasso problem' where CNNs accept jumbled facial features as a valid face.

Technical Insight

The key mechanism is a 'squash' nonlinearity that shrinks short vectors toward zero and long vectors toward length one, so vector magnitude reads as a probability. Dynamic routing then runs a few iterations of a softmax-weighted agreement step: each lower capsule sends its prediction up, and coupling coefficients increase for higher capsules whose output aligns (via dot product) with that prediction. This replaces max-pooling, preserving precise spatial information instead of discarding it.

Strategic Impact

Cost and budget

Architecture decisions drive performance and operating cost for years.

Clearer decisions

Technical education helps teams choose the right stack, not just the newest one.

Quality control

Better engineering choices reduce reliability incidents in production.

The Future of Capsule Networks

Capsule networks remain more a research direction than a deployed standard, largely because dynamic routing is computationally expensive and scales poorly to large images like ImageNet. Later work explored EM routing (Matrix Capsules) and self-attention-based routing to improve efficiency. As interest in equivariance, sample efficiency, and interpretable part-whole hierarchies grows, capsule ideas continue to influence research, including Hinton's later GLOM proposal, even as Transformers dominate mainstream vision.

Real-World Implementation

Classifying handwritten digits on MNIST while reconstructing the input from capsule vectors, showing the pose parameters are meaningful.

Separating two overlapping digits (the MultiMNIST task) by segmenting which pixels belong to which entity.

Medical imaging research using capsules to detect lung nodules or brain tumors where part-whole spatial relationships matter.

Recognizing objects from novel viewpoints with fewer training examples, leveraging the architecture's built-in viewpoint equivariance.

Risks & Guardrails

Optimizing one benchmark can hide broader system weaknesses.

Infrastructure and maintenance costs are often underestimated.

Security and observability gaps can grow as systems become more complex.

Implementation Roadmap

1

Define latency, quality, and cost targets before implementation.

2

Benchmark under realistic load and data conditions.

3

Instrument monitoring for errors, drift, and user impact.

4

Prepare rollback and incident response paths before scaling.

Keep Exploring

Free newsletter

Get the daily AI briefing

Three verified AI stories every weekday morning, written in plain English. Free forever, no ads.

One email each weekday. Unsubscribe in one click. We never sell or share your address.

Test yourself

Take the Capsule Networks quiz

Instant feedback on every answer, and a shareable certificate with a verifiable ID once you pass a course.

Start quiz

Support free AI education. AI Understanding is a 501(c)(3) nonprofit — no ads, no paywall, ever. Make a donation

Next guide

Highway Networks and Skip Connections

Frequently asked questions

What is Capsule Networks?

Capsule networks are a neural architecture that groups neurons into 'capsules' that output vectors encoding both whether a feature exists and its pose (position, orientation, scale). They aim to fix a core blindness in standard convolutional networks: losing track of spatial relationships between parts.

In a capsule network, what does the LENGTH of a capsule's output vector represent?

The vector's length (magnitude) encodes the probability that the entity exists, while its orientation encodes pose parameters like position and rotation.

What problem with standard CNNs were capsule networks specifically designed to address?

CNNs with max-pooling discard precise spatial relationships, so a face with misplaced features can still score highly. This is the 'Picasso problem' capsules try to fix.

What is the name of the algorithm that decides which lower-level capsules connect to which higher-level capsules?

Dynamic routing-by-agreement iteratively strengthens connections between capsules whose predictions agree with a higher capsule's output.

Who introduced the capsule network with dynamic routing in 2017?

The 2017 paper 'Dynamic Routing Between Capsules' was authored by Sara Sabour, Nicholas Frosst, and Geoffrey Hinton.

What is the purpose of the 'squash' function in a capsule network?

The squash nonlinearity shrinks short vectors toward zero and caps long vectors near length one, so magnitude can be read as a probability while orientation (pose) is preserved.