top of page

Capsule Networks: Encoding Spatial Hierarchies and Part-Whole Relationships

  • Writer: Yatin Taneja
    Yatin Taneja
  • Mar 9
  • 12 min read

Capsule networks aim to improve how neural systems represent and process visual data by explicitly modeling spatial hierarchies and part-whole relationships, moving beyond the limitations built into standard feature extraction methods. Traditional convolutional neural networks rely heavily on pooling operations, which discard precise spatial information in favor of translational invariance, effectively forcing the network to lose track of where specific features are located relative to one another. This loss of spatial coherence creates a key barrier for tasks requiring an understanding of object composition, as the system recognizes the presence of a feature without understanding its pose or its relationship to the larger entity. Capsules preserve pose, including position, orientation, and scale of detected features, by encapsulating these parameters within the neuron's activity, thereby retaining the geometric information necessary to reconstruct the scene structure. This approach addresses the limitations of scalar activations in standard deep learning models, where a single number is the confidence of a feature detection, failing to capture the rich manifold of variations that an object can exhibit. Geoffrey Hinton proposed the concept to solve the Picasso problem, where CNNs recognize features regardless of their spatial arrangement, leading to classifications based on the presence of parts rather than their coherent spatial organization. By ensuring that the recognition of a whole depends on the correct spatial arrangement of its parts, capsule networks introduce a level of geometric reasoning that is absent in purely discriminative models.



Each capsule outputs a vector whose length is the probability of an entity’s presence, ensuring that the magnitude of the output correlates directly with the likelihood that the entity exists in the input field. The orientation of this vector encodes instantiation parameters such as pose, meaning that changes in the input image, such as rotation or translation, result in linear changes to the orientation of the activity vector. This vector-based representation allows the network to maintain a detailed internal model of the object, capturing not just that an object is present, but exactly how it is instantiated in the visual field. Active routing enables lower-level capsules to send outputs to higher-level capsules based on the agreement between the predicted pose of the parent and the actual output of the child. This routing mechanism replaces max-pooling with a learned iterative process that dynamically allocates computational resources to the most plausible hypotheses about the scene structure. It preserves spatial coherence across layers by ensuring that features that agree on the pose of a higher-level entity are grouped together, while conflicting hypotheses are suppressed. This mechanism mimics the iterative process of visual perception in biological systems where ambiguous low-level features are resolved into high-level objects through feedback and agreement.


Capsules exhibit equivariance to affine transformations, a property that distinguishes them significantly from the invariance sought after in traditional convolutional architectures. Pose vectors transform predictably under input image transformations, meaning that if an input image is rotated or scaled, the pose vectors inside the network undergo a corresponding linear transformation. This equivariance allows the network to learn spatial relationships that are durable to viewpoint changes, as the internal representation moves in tandem with the external object. Transformation matrices within capsules allow explicit modeling of how parts relate to wholes in 3D space, providing a mechanism to infer the global pose of an object from the local poses of its parts. This supports inverse graphics by inferring scene structure from pixels, effectively reversing the rendering process to deduce the parameters of the objects that generated the image. By learning these transformation matrices, the network acquires an understanding of the 3D geometry of the world, enabling it to generalize across different viewpoints with far fewer training examples than would be required by a network relying solely on texture statistics.


EM routing extends energetic routing by modeling capsule outputs as Gaussian distributions rather than simple point estimates, thereby capturing the uncertainty associated with pose predictions. Expectation-Maximization assigns parts to wholes based on probabilistic alignment, treating the assignment as a latent variable that is inferred iteratively. In the expectation step, the algorithm computes the probability that a lower-level capsule belongs to a specific higher-level capsule based on how well the predicted pose matches the parent's distribution. In the maximization step, the parameters of the higher-level capsule are updated to maximize the likelihood of the assigned poses, effectively refining the estimate of the object's pose and existence probability. This probabilistic framework provides a durable mechanism for handling occlusion and clutter, as the network can maintain multiple hypotheses about object identities and poses until sufficient evidence accumulates to resolve the ambiguity. Routing-by-agreement ensures only consistent part-whole configurations propagate forward, preventing the network from forming spurious associations between unrelated features.


Pose encoding allows reconstruction of input from capsule states, providing a powerful regularization signal that forces the network to retain all essential information in the capsule outputs. By using the pose matrices and activation vectors of the final layer capsules, a decoder network can reconstruct the original input image, ensuring that the internal representation captures all relevant details. This enables self-supervised learning and verification of internal representations, as the network can be trained to minimize the reconstruction error alongside the classification loss. Equivariance provides built-in reliability to geometric transformations, ensuring that the learned representations are stable and predictable across a wide range of input variations. Inverse graphics capability supports generative tasks such as image synthesis, where specific object poses can be manipulated to generate novel views of a scene without requiring additional training data. This generative capacity positions capsule networks as a unified framework for both perception and generation, bridging the gap between discriminative AI and generative modeling.


A capsule consists of a group of neurons whose activity vector is instantiation parameters, functioning as a distinct unit that encapsulates information about a specific entity or part. Unlike a single scalar neuron, which fires to indicate the presence of a feature, a capsule encodes a wealth of information about the feature's properties within its vector output. Lively routing is an iterative algorithm determining coupling coefficients between capsules, dynamically adjusting the strength of connections based on the consensus between lower-level predictions and higher-level activations. A pose vector is the orientation component of a capsule’s output encoding spatial attributes, serving as a compact representation of the object's position and orientation relative to a reference frame. A transformation matrix is a learned weight matrix predicting parent capsule poses, encoding the intrinsic spatial relationship between a part and the whole it belongs to. These matrices are learned during training and allow the network to predict how the pose of a parent object should change given a change in the pose of a child part.


Routing-by-agreement strengthens connections when lower-level predictions align with higher-level expectations, creating a competitive environment where only the most coherent interpretations survive. This process is analogous to attention mechanisms in transformers, but operates on explicit geometric predictions rather than feature similarity. Equivariance means internal representations transform in tandem with input transformations, providing a systematic way to handle geometric variability without requiring massive amounts of data augmentation. EM routing models capsule outputs as mixture-of-Gaussians to refine assignments, allowing for a more thoughtful handling of uncertainty and overlapping objects. By treating poses as distributions, the network can represent situations where an object's location is not precisely known, maintaining a spread of possibilities until further evidence sharpens the estimate. Early CNNs dominated computer vision while lacking explicit spatial reasoning, relying on the implicit assumption that spatial statistics are sufficient for recognition tasks.


This approach proved highly effective for large-scale classification benchmarks where texture and local features are strong predictors. Hinton’s 2011 work on transforming auto-encoders introduced foundational concepts for capsules, specifically the idea of using transformation matrices to relate parts to wholes in an unsupervised manner. This work laid the theoretical groundwork for explicit coordinate frames within neural networks, though it did not yet incorporate the adaptive routing mechanisms that define modern capsule architectures. The 2017 paper Agile Routing Between Capsules formalized the routing algorithm, demonstrating that iterative agreement-based routing could be implemented effectively within deep learning frameworks. It demonstrated superior performance on MNIST and smallNORB under affine transformations, proving that capsules could achieve high robustness to viewpoint changes with significantly fewer parameters than CNNs. Subsequent work introduced matrix capsules with EM routing in 2018, replacing vector outputs with 4x4 pose matrices to capture richer spatial information and using the Expectation-Maximization algorithm for more durable clustering.


These models showed promise on smallNORB yet struggled to scale to CIFAR-10 and ImageNet, revealing limitations in the architecture when applied to complex, high-resolution natural images. Performance on CIFAR-10 and ImageNet remains below modern CNNs and vision transformers, as the computational complexity of routing becomes prohibitive for deep networks with millions of capsules. Benchmarks highlight strengths in pose estimation and reconstruction fidelity alongside weaknesses in flexibility, suggesting that capsules excel at tasks requiring precise geometric reasoning but lag in tasks where statistical pattern matching is more effective. The rigidity of the hierarchical part-whole assumptions may hinder performance on datasets where objects are highly deformable or lack clear compositional structure. Adoption stalled despite theoretical advantages due to computational complexity, as the iterative nature of adaptive routing requires significantly more arithmetic operations than standard feed-forward convolution. High memory and compute requirements exist per capsule due to vector outputs, increasing the bandwidth requirements for storing intermediate activations and transformation matrices.


Iterative routing loops increase inference latency significantly, making it difficult to deploy capsule networks in real-time applications such as autonomous driving or video analysis. Training active routing is sensitive to initialization and hyperparameters, requiring careful tuning to ensure convergence and prevent collapsing to trivial solutions where all capsules route to a single parent. Scaling to high-resolution images remains challenging due to quadratic growth in routing computations, as each capsule in one layer must potentially communicate with every capsule in the next layer. Hardware optimization for capsule-specific operations lags behind improved CNN kernels, as modern GPUs and TPUs are heavily fine-tuned for matrix multiplications and convolutions rather than the irregular memory access patterns of agile routing. The lack of specialized hardware support means that capsule networks run inefficiently on existing silicon, negating their potential advantages in terms of parameter efficiency. Recurrent neural networks lack explicit pose representation and struggle with long-range dependencies, often suffering from vanishing gradients that make training deep recurrent networks difficult.



Graph neural networks typically require predefined graph structures, limiting their applicability in domains where the relational structure is not known a priori. Capsules infer structure dynamically from data, offering a more flexible alternative for tasks involving scene understanding and object parsing. Transformer-based vision models use attention for global context while lacking natural encoding of geometric pose, relying on token embeddings to implicitly capture spatial relationships. While transformers excel at modeling long-range dependencies and have achieved modern results on many benchmarks, they treat images as sequences of patches without an inherent notion of coordinate frames or 3D geometry. These alternatives do not natively support equivariant pose encoding in a unified framework, necessitating complex architectural modifications or auxiliary losses to achieve similar geometric consistency. Dominant architectures remain CNNs like ResNet and EfficientNet due to their maturity, ease of training, and extensive ecosystem support in terms of libraries and pre-trained models.


Vision transformers like ViT and Swin dominate due to adaptability and ecosystem support, using massive amounts of data and compute to achieve performance that outweighs their lack of explicit geometric reasoning. Appearing challengers include hybrid models working with capsule-like modules into transformer backbones, attempting to combine the global context of attention with the geometric rigor of capsules. Pure capsule networks have not achieved competitive performance on large-scale datasets which limits architectural influence, causing researchers to focus on working with capsule concepts into proven architectures rather than developing pure capsule systems. No widespread commercial deployment exists as of 2024, as industry practitioners prioritize reliability and speed over theoretical elegance or improved data efficiency on niche tasks. Research remains confined to academic prototypes and niche benchmarks, where the focus is often on validating theoretical properties rather than achieving practical deployment goals. Economic viability is constrained by marginal gains over CNNs on standard benchmarks, as the cost of implementing and improving capsule networks outweighs the benefits for most commercial applications.


Training costs and inference latency limit practical adoption, particularly in edge computing environments where power and compute budgets are tightly constrained. No major tech company has publicly committed to capsule-based vision systems, with Google, Meta, and NVIDIA focusing primarily on CNNs and transformers that scale efficiently on their existing hardware accelerators. Academic labs maintain research interest while lacking industrial translation, often exploring novel routing algorithms or loss functions without the resources to scale these innovations to production levels. Startups exploring geometric deep learning prioritize more scalable alternatives like graph neural networks or differentiable rendering, which offer some of the benefits of capsules without the associated computational overhead. Software stacks rely on existing deep learning frameworks with custom capsule layers, requiring researchers to implement complex routing algorithms from scratch rather than using improved built-in functions. Dependency on high-quality pose-annotated datasets remains a constraint for real-world deployment, as training effective capsule networks requires ground truth information about object poses, which is expensive and labor-intensive to collect.


No significant geopolitical implications currently exist; research is globally distributed with no export controls, as capsule networks are currently viewed as a purely academic pursuit without dual-use applications that would trigger regulatory scrutiny. Potential future relevance exists in defense or surveillance if capsule networks prove superior in adversarial or low-data regimes, though no evidence exists yet to suggest they outperform ensemble methods or synthetic data generation techniques currently favored in these sectors. Collaboration exists between academia and industry, yet industry engagement has waned as the initial hype surrounding the 2017 publication has faded without yielding commercially viable products. Open-source implementations are available while being minimally maintained, often lacking the documentation and optimization required for connection into professional production pipelines. Lack of standardized benchmarks or tooling hinders joint development, making it difficult for researchers to compare different approaches fairly or build upon each other's work effectively. Software frameworks need native support for vector-valued activations, routing loops, and pose-aware loss functions to lower the barrier to entry for new researchers and engineers interested in the field.


Regulatory standards for AI safety may eventually favor interpretable models like capsules, whereas current regulations do not mandate architectural choices focusing primarily on outcome-based metrics such as accuracy and fairness. The explicit part-whole hierarchy of capsules offers a degree of interpretability that is lacking in black-box models like deep CNNs, potentially aligning with future requirements for explainable AI in high-stakes domains such as healthcare or finance. Infrastructure on edge devices would require new compiler optimizations to handle iterative routing efficiently, necessitating a shift in hardware design to support the specific computational patterns of capsule networks. Capsules could reduce reliance on massive labeled datasets if they enable more data-efficient learning, thereby lowering entry barriers for smaller firms that cannot afford the data annotation costs associated with current best models. New business models could arise around geometric AI services if capsule-based systems prove reliable for tasks such as 3D reconstruction or robotic manipulation where spatial understanding is crucial. Economic displacement remains unlikely in the near term due to limited adoption; long-term impact depends on performance breakthroughs that allow capsules to compete with transformers on general-purpose vision tasks.


Traditional accuracy metrics remain insufficient; new KPIs such as pose estimation error, reconstruction fidelity, equivariance consistency, and sample efficiency are needed to properly evaluate the strengths of capsule networks. Evaluation should include reliability to affine transformations, occlusion handling, and compositional generalization, testing the network's ability to recognize objects from novel viewpoints or to identify objects composed of unseen combinations of familiar parts. Benchmark suites must move beyond classification to tasks requiring spatial reasoning, such as counting objects in a cluttered scene or inferring the 3D structure of an object from a single 2D image. Setup with neural rendering will enable end-to-end inverse graphics pipelines, allowing researchers to train capsule networks directly from raw pixels to 3D parameters without intermediate supervision. Capsule-based world models will support reinforcement learning agents requiring spatial memory, enabling them to build mental maps of their environment that persist across time and viewpoint changes. Hybrid architectures will combine capsules with transformers for global context and local geometry, applying the strengths of both approaches to create strong perception systems capable of handling both texture and shape.


Differentiable rendering layers will close the loop between capsule poses and pixel generation, providing a strong training signal that ties internal representations directly to visual input. Potential convergence with 3D deep learning will occur where explicit pose and part structure are native, blurring the line between computer vision and computer graphics. Synergy with physics-informed neural networks will require geometric consistency, ensuring that simulated physical phenomena adhere to the spatial constraints encoded in the capsule hierarchy. Alignment with neurosymbolic AI will provide structured, interpretable representations for symbolic reasoning, allowing neural networks to interface directly with logic-based systems that require discrete entities and relationships. A key limit exists where routing complexity scales quadratically with the number of capsules, making deep, wide networks infeasible without approximation methods that sacrifice some degree of accuracy. Workarounds include sparse routing, hierarchical grouping, or replacing iterative routing with learned attention-like mechanisms that approximate the agreement process without explicit iteration.


Memory bandwidth may become a constraint before compute due to vector state storage, as reading and writing large pose matrices for every capsule can saturate memory channels even if arithmetic units are underutilized. Capsule networks represent a principled shift from pattern recognition to structural perception, addressing a core weakness of current deep learning regarding spatial reasoning and compositionality. Their value lies in enabling new capabilities where spatial understanding is essential rather than outperforming CNNs on existing tasks such as image classification or object detection. Success depends on redefining success metrics beyond classification accuracy toward geometric fidelity and compositional reasoning, emphasizing the quality of the internal representation rather than just the final label prediction. Superintelligence systems will utilize capsule-like representations for efficient world modeling, as managing complex interactions with the physical world requires an understanding of objects as cohesive entities with persistent properties rather than bags of features. Explicit part-whole hierarchies will align with how intelligent agents parse structured reality, allowing them to reason about objects by manipulating their constituent parts mentally.



Capsules will serve as a foundational layer in hybrid architectures for symbolic reasoning, providing the perceptual grounding necessary for abstract concepts to be tied to physical reality. Superintelligence will employ capsules as components within larger systems rather than as standalone models, working with them with memory modules, planners, and executive functions to achieve general intelligence. Calibration will involve aligning capsule outputs with causal structures in the environment, ensuring that the inferred relationships between parts reflect actual physical interactions rather than mere correlations in pixel data. This alignment will enable counterfactual reasoning and planning, allowing the system to simulate the consequences of actions by manipulating the pose parameters of objects within its internal world model. Capsules will function as perceptual primitives feeding into higher-order cognitive modules, translating raw sensory data into structured symbolic descriptions that can be manipulated by logic engines or language models. The transition from current deep learning frameworks to superintelligent systems will likely involve working with these geometric representations with large-scale associative learning mechanisms.


Future research must address the flexibility issues intrinsic in current formulations through novel approximations or hardware acceleration to open up the full potential of this approach. The development of standardized frameworks and metrics will accelerate progress by enabling direct comparison between different architectural innovations in this domain. As the field moves towards more comprehensive forms of intelligence, the ability to represent and manipulate spatial hierarchies will become increasingly critical for solving problems that current systems find intractable.


© 2027 Yatin Taneja

South Delhi, Delhi, India

bottom of page