Handwritten Indic Character Recognition using Capsule Networks

Bodhisatwa Mandal, Suvam Dubey, Swarnendu Ghosh, Ritesh Sarkhel, Nibaran DasarXiv 2019

Abstract

Convolutional neural networks (CNNs) have become the primary algorithm for various computer vision tasks, including handwritten character recognition. While architectures like LeNet and AlexNet have been prominent for decades, the spatial invariance of their kernels remains a significant limitation. This paper explores the implementation of Capsule Networks (CapsNets) on handwritten Indic digits and character datasets. By utilizing dynamic routing to combine individual opinions of groups of kernels (capsules), CapsNets employ equivariance to better model spatial relationships. Our results demonstrate that CapsNets not only outperform traditional networks like LeNet but also significantly boost the performance of larger architectures like AlexNet through ensemble methods.

Introduction

Standard Convolutional Neural Networks (CNNs) excel at detecting the presence of features but often struggle to model the relative spatial relationships between them. This limitation, known as spatial invariance, is particularly problematic for Indic scripts such as Bangla, Devanagari, and Telugu. Unlike the standard 10-digit MNIST dataset, Indic scripts contain complex basic characters and compound characters with intricate, overlapping geometries. For instance, Bangla includes 50 basic and 199 compound characters. This study investigates whether Capsule Networks, designed to handle these spatial relationships via "equivariance," can provide superior performance in this domain.

Methodology

The implemented Capsule Network architecture follows the design proposed by Sabour et al. (2017), focusing on capturing hierarchical relationships through specialized layers.

Architecture of the Capsule Network showing Primary and Digit Capsule layers with Dynamic Routing.

Key Components:

  • Primary Capsules: This convolutional layer groups activations into capsules, representing the presence and properties of specific character parts.
  • Digit Capsules: A higher-level layer where each capsule represents a specific class (digit or character).
  • Dynamic Routing: Instead of traditional max-pooling, the network uses an iterative "agreement" mechanism. Lower-level capsules "vote" for the higher-level capsules they likely belong to. If multiple parts agree on the presence of a whole object, that pathway is strengthened.
  • Squashing Function: A non-linear function ensures the length of the capsule vector represents the probability of an entity's existence.
  • Ensemble Approach: To leverage complementary features, the authors created ensembles (e.g., AlexNet+CapsNet) using probabilistic averaging.

Datasets

The study utilizes five datasets from the CMATERdb collection, split into a 2:1 ratio for training and testing:

  1. Bangla Digits: 10 classes.
  2. Devanagari Digits: 10 classes.
  3. Telugu Digits: 10 classes.
  4. Bangla Basic Characters: 50 classes.
  5. Bangla Compound Characters: 199 classes.

Results and Discussion

The experimental results highlight the robustness of Capsule Networks compared to traditional CNN architectures, especially as the complexity of the character set increases.

Comparison of recognition accuracy across different architectures and Indic script datasets.

The "Booster" Effect

One of the most significant findings is the performance of the AlexNet+CapsNet ensemble, which consistently yielded the best results across all datasets. For Bangla Digits, this ensemble achieved 97.75% accuracy. This suggests that CapsNets capture unique structural information that even much larger CNNs miss. Notably, while AlexNet has approximately 57 million parameters, a standalone CapsNet achieves competitive results with only ~8.2 million parameters.

Robustness to Complexity

While LeNet performed adequately on 10-class digit datasets, its performance dropped significantly on the 199-class Bangla Compound Character dataset (75.4%). In contrast, the AlexNet+CapsNet ensemble reached 94.40% accuracy on the same dataset, outperforming previous benchmarks in the literature. On Bangla Basic Characters, CapsNet alone reached 90.6% accuracy, far exceeding LeNet's 63.0%.

Convergence and Efficiency

CapsNets exhibited a steeper learning curve than LeNet or AlexNet, reaching high accuracy in fewer training epochs. This efficiency in learning suggests that the dynamic routing mechanism more effectively captures the underlying structure of the characters compared to standard convolution and pooling.

Conclusion

Capsule Networks offer a powerful alternative to traditional CNNs for complex handwriting recognition tasks. By modeling spatial hierarchies through dynamic routing, they provide a significant performance boost, particularly when used in ensembles. However, the computational overhead of the iterative routing phase remains a challenge, requiring high-end hardware for efficient processing. Future work will explore multi-layer routing to further enhance recognition capabilities for even more complex scripts.

Summary updated

BibTeX
@misc{mandal2019handwritten,
  author = {Bodhisatwa Mandal and Suvam Dubey and Swarnendu Ghosh and Ritesh Sarkhel and Nibaran Das},
  title = {{Handwritten Indic Character Recognition using Capsule Networks}},
  year = {2019},
  eprint = {1901.00166},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1901.00166},
}
Figure