Letting small image regions negotiate before a capsule network decides
Many image classifiers are really committees. Several small networks each look at a different part of the picture, and a final step combines their answers. Usually that step is a vote or an average. We asked whether the members could instead negotiate, and we built a two-stage routing scheme for capsule networks that lets them do so.
The problem
A standard convolutional neural network slides small filters over an image. At every spot a filter reports one number: how strongly its pattern appears here. One number can say 'present' or 'absent', but it says nothing about how the feature is bent, tilted or stretched.
Capsule networks replace that single number with a short list of numbers, called a vector. They also add a rule named routing by agreement. A low-level capsule sends its output to the higher-level capsules whose own output agrees with it. We hoped this would model how parts fit into a whole, even when the parts can deform independently.
The second ingredient is the multi-column network. Each column is a small network that reads a different region of the image: the whole picture, its quarters, and so on. Columns are usually trained separately and combined by majority vote or by averaging their probabilities. Both keep only the strongest opinion of each column. Weak opinions that happen to agree with each other are thrown away.
The idea
We made every column a small capsule network and replaced the vote with routing. Because small parts and whole objects are different levels of detail, we split the routing into two phases. The first phase deals with micro-level features from the individual regions. The second phase gathers the result into the macro-level answer for each class.
How it works
Each region goes through its own region-specific capsule network. It has one convolutional layer with 256 channels, followed by a capsule layer of 32 blocks of 8-number vectors. We tried two designs. Caps-5 has five columns: the whole image plus its four quadrants, each scaled up to full size. Caps-21 adds the sixteen smaller tiles, so it has 21 columns.

In phase one, the capsules of all regions vote on what the image shows, and votes that agree with each other get more weight. This produces intermediate capsules that summarise the whole image from the regions' consensus. In phase two, those intermediate capsules are routed to the final class capsules, again by agreement. Picture a panel of experts who each see one corner of a photo. They first reconcile their notes with each other, and only then does a chair write down the verdict.

What we found
We tested on seven public datasets: handwritten digits in Bengali, Devanagari, Arabic and Telugu (only 2,000 to 4,000 training images each), plus Fashion-MNIST (clothing), Not-MNIST (letters A to J in many typefaces) and SVHN (house numbers from street photos) (Table 3). No data augmentation was used.
Caps-5 beat both a plain capsule network and a LeNet5 baseline on all seven datasets (Table 4). Caps-21 beat LeNet5 everywhere but trailed the plain capsule network on the Bengali and Devanagari digits and on SVHN. On the Telugu digits, Caps-5 reached 98.00% against 95.40% for the plain capsule network and 92.20% for LeNet5. Caps-5 did well on the digit sets and SVHN, while Caps-21 did better on the non-digit sets with more variation inside a class: 91.27% on Fashion-MNIST and 95.66% on Not-MNIST.
Table 4 gives the accuracy of each model on each dataset. Each row is one dataset, and the interesting question is which column is highest.
| Dataset | Caps-5 (%) | Caps-21 (%) | Basic-Caps (%) | LeNet5 (%) |
|---|---|---|---|---|
| CMATERdb 3.1.1 | 97.35 | 96.45 | 97.05 | 94.90 |
| CMATERdb 3.2.1 | 95.60 | 93.60 | 94.70 | 92.40 |
| CMATERdb 3.3.1 | 97.10 | 96.60 | 96.60 | 95.20 |
| CMATERdb 3.4.1 | 98.00 | 97.20 | 95.40 | 92.20 |
| Fashion-MNIST | 90.96 | 91.27 | 89.76 | 88.42 |
| Not-MNIST | 95.43 | 95.66 | 94.36 | 87.49 |
| SVHN | 90.19 | 89.70 | 89.81 | 87.85 |
Caps-5 has the highest value in five of the seven rows and Caps-21 in the other two.
We also built ordinary multi-column convolutional networks with the same inputs. On SVHN, Caps-5 scored 90.19% against 81.87% for the five-column convolutional version, and the 21-column version fell to 57.79% (Table 5). The paper backs these comparisons with McNemar mid-P tests, a check on whether two classifiers really differ. For some pairs, mostly on the small digit sets, the difference is not statistically significant (Table 6).
Next we replaced our routing with majority voting or probability averaging. The paper concludes that the two-phase routing aggregates opinions better. The gap was largest on SVHN, where Caps-5 scored 90.19% with our routing, 87.71% with voting and 87.59% with averaging (Table 7). Majority voting did win on Fashion-MNIST for Caps-5, 91.49% against 90.96% (Table 7).
Why can routing beat voting? When we tested each region alone, the full image was best, the quadrants slightly weaker and the small tiles weakest. Yet in the routing weights, many small regions had contributions comparable to the full image (Figs. 6 to 8 of the paper). The paper's explanation is that voting combines the strongest opinions of independent classifiers, while routing can prefer weaker opinions when they form a stronger consensus.
Results in more detail
The convolutional rivals in our tests were multi-column networks of the same shape, inspired by earlier work of Ciresan and colleagues. Multi-5 and Multi-21 get the same five or 21 inputs as Caps-5 and Caps-21, and their outputs are combined in the traditional way. Table 5 sets them next to our networks.
| Dataset | Caps-5 (%) | Caps-21 (%) | Multi-5 (%) | Multi-21 (%) |
|---|---|---|---|---|
| CMATERdb 3.1.1 | 97.35 | 96.45 | 94.20 | 84.0 |
| CMATERdb 3.2.1 | 95.60 | 93.60 | 93.0 | 87.30 |
| CMATERdb 3.3.1 | 97.10 | 96.60 | 95.20 | 89.30 |
| CMATERdb 3.4.1 | 98.0 | 97.20 | 93.70 | 91.10 |
| Fashion-MNIST | 90.96 | 91.27 | 87.57 | 84.89 |
| Not-MNIST | 95.43 | 95.66 | 87.05 | 84.19 |
| SVHN | 90.19 | 89.70 | 81.87 | 57.79 |
The capsule networks lead in every row, which is the paper's conclusion too: capsule-based architectures outperform the convolutional multi-column models. In the convolutional pair, the 21-column network scored below the five-column one on every dataset.
The statistical tests add detail. The improvement of Caps-5 over the plain capsule network is significant on the Telugu digits, Fashion-MNIST, Not-MNIST and SVHN, and not significant on the other three digit sets. Caps-5 differs significantly from Multi-5 on the Telugu digits, Fashion-MNIST and SVHN (Table 6).
The full comparison of the three ways to combine the columns is in Table 7. Each row uses the same trained region networks; only the final step changes.
| Dataset | Caps-5 majority voting | Caps-5 averaging | Caps-5 our method | Caps-21 majority voting | Caps-21 averaging | Caps-21 our method |
|---|---|---|---|---|---|---|
| CMATERdb 3.1.1 | 95.50 | 94.30 | 97.35 | 93.10 | 91.0 | 96.45 |
| CMATERdb 3.2.1 | 95.50 | 95.85 | 95.63 | 93.45 | 89.20 | 93.60 |
| CMATERdb 3.3.1 | 94.50 | 94.90 | 97.10 | 92.70 | 90.50 | 96.60 |
| CMATERdb 3.4.1 | 96.40 | 96.0 | 98.04 | 96.50 | 94.40 | 97.20 |
| Fashion-MNIST | 91.49 | 90.95 | 90.96 | 90.91 | 90.18 | 91.27 |
| Not-MNIST | 93.82 | 93.65 | 95.43 | 92.66 | 91.19 | 95.66 |
| SVHN | 87.71 | 87.59 | 90.19 | 81.20 | 80.30 | 89.70 |
For Caps-21, our routing has the highest value in every row. The widest gaps are on SVHN, where it reached 89.70% against 81.20% for majority voting and 80.30% for averaging, and on Not-MNIST, 95.66% against 92.66% and 91.19%. For Caps-5, voting and averaging each win one row: majority voting on Fashion-MNIST and probabilistic averaging on the Devanagari digits (Table 7).
Looking at the regions one by one, the paper reports some anomalies. Now and then a single region did much better than the other regions of its kind, and this happened more often on the harder datasets, Fashion-MNIST, Not-MNIST and SVHN (Fig. 6 of the paper). The paper takes this as a sign of how much a well-chosen small region, a fixation point, can contribute.
Discussion
We read these results as follows. Region-specific networks are good at local parts that deform independently, but a standard ensemble looks only at maximal activations and has no way to ask whether the columns agree. Capsule routing can pass on weaker activations when they agree with each other. Two-phase routing keeps the micro-level step, where regions are reconciled, apart from the macro-level step, where the class is decided. In our tests it performed competitively or better than the nearest alternatives: a plain capsule network, multi-column convolutional networks, and voting or averaging.
The mismatch between how strong a region is alone and how much weight routing gives it leads us to say that non-maximal activations can contribute when they form a consensus within and across regions.
The shortfalls are clear. Our networks do not yet match state-of-the-art convolutional networks, and capsule networks in general still need, in the paper's words, a lot of polish before they can compete with large CNNs. Speed is the main bottleneck: like other capsule networks, ours train slowly. Without augmentation, Caps-5 and Caps-21 reached only 68.87% and 68.97% on CIFAR-10 (Table 8). In that comparison the paper reports MS-CapsNet as the best method, and notes that its data loading includes pre-processing and augmentation that ours did not. When we used the MS-CapsNet data loader, our CIFAR-10 numbers rose substantially. We did not add a deep convolutional back end to chase benchmark scores, because the paper argues that would defeat the purpose of capsule networks.
We meant the two-level scheme as a step toward deeper capsule networks with several routing layers. It could in theory be extended to more levels, but that is computationally expensive, so hierarchies with more levels are left for future work.
Sources
The figures and tables listed here are taken from the paper cited at the top of this page; the numbers quoted in the text come from it too.
- Figures: Fig. 4, Fig. 2
- Tables: Table 3: the seven datasets with training and test set sizes; Table 4: accuracy of Caps-5, Caps-21, a plain capsule network and LeNet5 on each dataset; Table 5: accuracy of Caps-5 and Caps-21 against five- and 21-column convolutional networks; Table 6: McNemar mid-P significance tests for the comparisons; Table 7: our routing against majority voting and probability averaging; Table 8: comparison with other capsule network variants on Fashion-MNIST and CIFAR-10
Acknowledgements
This work was supported by the project sponsored by SERB (Government of India, order no. SB/S3/EECE/054/2016, dated 25/11/2016), and was carried out at the Centre for Microprocessor Application for Training Education and Research, CSE Department, Jadavpur University.
Cite the paper
B Mandal, R Sarkhel, Swarnendu Ghosh, N Das, M Nasipuri (2021). Two-phase dynamic routing for micro and macro-level equivariance in multi-column capsule networks. Pattern Recognition, Vol. 109, 107595 · Elsevier.
@article{mandal2021two,
author = {Mandal, B and Sarkhel, R and Ghosh, Swarnendu and Das, N and Nasipuri, M},
title = {Two-phase dynamic routing for micro and macro-level equivariance in multi-column capsule networks},
journal = {Pattern Recognition},
volume = {109},
publisher = {Elsevier},
year = {2021},
doi = {10.1016/j.patcog.2020.107595}
}