[Paper Review] An Algorithm for Routing Capsules in All Domains
This paper proposes a novel, general-purpose routing algorithm for capsule networks that uses a new D-Step within an EM framework to compute net benefits and costs for input capsule usage, enabling state-of-the-art performance in both vision and language tasks with minimal hyperparameter tuning. The method achieves 99.1% accuracy on smallNORB with fewer parameters and less training than prior capsule models, and 95.6% on SST-2/R using frozen BERT embeddings, demonstrating universal applicability across domains.
Building on recent work on capsule networks, we propose a new, general-purpose form of "routing by agreement" that activates output capsules in a layer as a function of their net benefit to use and net cost to ignore input capsules from earlier layers. To illustrate the usefulness of our routing algorithm, we present two capsule networks that apply it in different domains: vision and language. The first network achieves new state-of-the-art accuracy of 99.1% on the smallNORB visual recognition task with fewer parameters and an order of magnitude less training than previous capsule models, and we find evidence that it learns to perform a form of "reverse graphics." The second network achieves new state-of-the-art accuracies on the root sentences of the Stanford Sentiment Treebank: 58.5% on fine-grained and 95.6% on binary labels with a single-task model that routes frozen embeddings from a pretrained transformer as capsules. In both domains, we train with the same regime. Code is available at https://github.com/glassroom/heinsen_routing along with replication instructions.
Motivation & Objective
- To develop a general-purpose routing algorithm for capsule networks that works across diverse domains such as vision and natural language processing.
- To improve capsule network performance by modeling both the benefit of using input capsules and the cost of ignoring them, using a new D-Step in the EM routing loop.
- To enable variable-size input handling—critical for sequence modeling in NLP—while maintaining low parameter counts and high accuracy.
- To demonstrate that the same routing algorithm, training regime, and model architecture can achieve state-of-the-art results in multiple domains without domain-specific tuning.
- To explore the potential of capsule networks in learning structured representations, such as 'reverse graphics' in vision and tree-like structures in language, through end-to-end training.
Proposed method
- The routing algorithm uses an expectation-maximization (EM) framework where output capsules iteratively maximize the probability of votes from input capsules they use.
- A novel D-Step is introduced between the E-Step and M-Step to compute the share of each input capsule used or ignored by each output capsule, based on net benefit (use) minus net cost (ignore).
- Output capsule activations are computed via a logistic function applied to the difference between net benefit and net cost, enabling stable, differentiable optimization.
- The algorithm accepts variable-size inputs, such as sequences of contextualized token embeddings, by treating each embedding as a capsule with context-dependent outputs.
- The method supports variable-size outputs and uses pre-activation scores that are passed through logistic functions, improving numerical stability and flexibility for downstream objectives.
- The routing mechanism functions as a form of attention where output capsules 'compete' for input capsule votes, with each output attending to a distinct subset of inputs based on agreement and cost-benefit trade-offs.
Experimental results
Research questions
- RQ1Can a unified routing algorithm for capsule networks achieve state-of-the-art performance across both vision and natural language processing tasks with a single training regime?
- RQ2How does modeling both benefit to use and cost to ignore input capsules improve routing performance and generalization in capsule networks?
- RQ3To what extent can capsule networks learn structured representations—such as pose or syntactic tree structures—without explicit supervision, through end-to-end training?
- RQ4Can the proposed routing algorithm effectively handle variable-size inputs, such as sequences of embeddings, while maintaining low parameter counts and high accuracy?
- RQ5Does the routing mechanism enable learning of 'reverse graphics'—i.e., reconstructing pose from input and label—without explicit architectural or loss function design for this task?
Key findings
- The capsule network with the proposed routing algorithm achieves 99.1% test accuracy on the smallNORB visual recognition task, surpassing previous state-of-the-art results with 272,000 parameters and only 50 training epochs.
- The smallNORB model generalizes better than prior capsule models, requiring no data augmentation via crop averaging and using full-resolution 96×96 stereo images.
- The model shows evidence of learning 'reverse graphics'—reconstructing pose from pixel data and labels—without explicit optimization for this task, as shown in visualization plots.
- On the SST-2/R sentiment classification task, the model achieves 95.6% accuracy with a single-task architecture, setting a new state-of-the-art for single-model performance.
- On SST-5/R, the model achieves 58.5% accuracy, also a new state-of-the-art, using only 140,000 parameters and routing frozen GPT-2-large embeddings as capsules.
- The same routing algorithm, training regime, and model architecture achieve SOTA results in both domains, demonstrating the algorithm’s universality and composable nature.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.