Standard Convolutional Neural Networks (CNNs) are remarkably effective at detecting features, but they are notoriously poor at understanding the spatial relationships between them. A CNN might identify an image as a face simply because it detects two eyes, a nose, and a mouth, even if those features are scrambled in a "Picasso-style" arrangement. This happens because traditional neurons use scalar activations to represent the presence of a feature, and pooling layers discard precise positional information to achieve translation invariance.
To solve this, researchers led by Sara Sabour, Nicholas Frosst, and Geoffrey E. Hinton introduced Capsule Networks (CapsNets). Instead of scalar values, these networks use vector-valued "capsules" to represent entities.
From Scalar Presence to Vector Pose
In a standard network, a neuron's output is a single number representing the probability that a feature exists. In a Capsule Network, a capsule outputs a vector. This shift allows the network to encode two distinct types of information simultaneously:
- Magnitude: The length of the vector represents the probability that the entity (e.g., an eye) is present.
- Orientation: The direction of the vector encodes the "instantiation parameters"—the specific properties of that entity, such as its angle, scale, and precise position.
As Clément Poiret and colleagues demonstrate in 3D-AGSCaps, this vector-based approach enables equivariance. While a CNN tries to be invariant (making the output the same regardless of rotation), a Capsule Network is equivariant (the output vector rotates or transforms predictably as the input does). This allows the model to recognize objects across different geometric transformations without needing to see every possible orientation during training.
Routing by Agreement
The most significant departure from traditional architectures is how information moves between layers. CNNs typically use max-pooling, which simply passes the strongest signal forward, effectively saying "an eye was found somewhere in this region."
Capsule Networks replace this with dynamic routing. In this mechanism, lower-level capsules (parts) "vote" for the state of higher-level capsules (wholes). If multiple part-capsules (eyes, nose, mouth) agree on the predicted pose and orientation of a whole-capsule (face), the connection between them is strengthened.
This "routing-by-agreement" ensures the network preserves spatial hierarchies. As Qiang Zhang notes in TSPOANet, this explicitly models the geometric relationships between local parts and global structures, preventing the "wholeness" of an object from being lost in the layers of the network.
Generalization and Efficiency
Because capsules encode the underlying geometry of a scene, they are significantly more parameter-efficient and robust than scalar-based networks.
- Viewpoint Invariance: Nicola Garau showed in DECA that using 4x4 pose matrices within capsules allows models to generalize to entirely unseen camera angles, such as top-down views of human poses.
- Data Efficiency: In medical and security contexts where data is scarce, capsules shine. Baoyang Liu developed DR-CapsNet for X-ray security, achieving 99% accuracy on small datasets by leveraging the network's inherent understanding of object tilt and rotation.
- Disentanglement: By representing objects as vectors of properties, models can better isolate distinct entities. Jianlin Su and Hong Lu found that PS CapsNet could identify two different objects side-by-side even when trained only on single objects, a task where standard CNNs fail.
Beyond Static Images
The intuition of vector-based agreement extends beyond 2D vision. In FlowCaps, Debaditya Roy applied these principles to optical flow, using capsules to track how spatial relationships change over time for action recognition. Similarly, Bruce McIntosh utilized multi-modal capsule routing to find agreement between visual entities in a video and textual descriptions in a natural language query, enabling precise video segmentation.
By treating features as structured entities with pose and identity rather than simple intensity signals, Capsule Networks provide a path toward AI that understands the physical world's inherent geometry.