Handwriting Recognition in Low-resource Scripts using Adversarial Learning

Ayan Kumar Bhunia, Abhirup Das, Ankan Kumar Bhunia, Perla Sai Raj Kishore, Partha Pratim Roy

TL;DR

This paper introduces the Adversarial Feature Deformation Module (AFDM), a meta-framework designed to boost handwriting recognition and spotting in low-resource scripts. By using an adversarial "game" to elastically warp intermediate convolutional features, the system forces the model to learn robust, highly informative patterns rather than overfitting to simple variations, leading to significant performance gains when training data is scarce.

What Problem Does This Paper Address?

Deep learning models for Handwritten Word Recognition (HWR) and Word Spotting (HWS) are notoriously data-hungry. While large datasets exist for Latin scripts, many others—such as Indic scripts like Bangla and Devanagari—suffer from a "low-resource" problem where annotated data is limited.

Standard data augmentation (like rotating or adding noise to images) often fails to capture the complex, free-flowing nature of human handwriting. Models frequently overfit to these "easy" variations and fail to generalize to the messy, irregular shapes found in the real world. The authors aim to bridge this gap by generating "hard" examples during training that push the model to find deeper, more invariant features.

Methods

The authors propose a meta-framework that can be plugged into existing architectures like CRNN (for recognition) and PHOCNet (for spotting). The core innovation is the Adversarial Feature Deformation Module (AFDM).

  1. Feature-Space Warping: Unlike traditional methods that augment the input image, AFDM operates on intermediate feature maps (specifically after the conv4_1 layer).
  2. Thin Plate Spline (TPS) Transformation: The module uses a localization network to predict parameters for a TPS transformation—a flexible way to elastically "stretch" and "warp" a plane.
  3. Adversarial Training: The system is trained as a minimax game. The AFDM (the "adversary") tries to deform the features in a way that maximizes the task network's loss (making the word harder to recognize). Simultaneously, the task network tries to minimize its loss, effectively learning to ignore these difficult deformations.
  4. Sub-map Partitioning: To prevent the adversary from finding a single "trivial" warping strategy, the feature map is divided into $k$ sub-maps (the authors found $k=4$ to be optimal), each deformed independently.

Datasets

The researchers evaluated their framework on four major datasets:

  • Latin Scripts:
    • IAM: A large, widely-used English handwriting dataset.
  • RIMES: A French handwriting dataset.
  • Indic Scripts (Low-resource):
    • IndicBAN: A dataset for Bangla.
  • IndicDEV: A dataset for Devanagari (Hindi).

These Indic scripts are significantly more complex than Latin due to the presence of modifiers and intricate cursive shapes.

Key Insights and Ideas

  • Feature Space vs. Image Space: The authors found that deforming features in the intermediate layers is more effective than deforming the raw input image. This is because deeper layers represent higher-level semantic information, and warping them forces the model to learn more sophisticated invariances.
  • The "Hard Example" Advantage: By using an adversarial generator to create "hard" samples on the fly, the model becomes robust to rare deformations that might not even exist in the training set but appear in real-world usage.
  • Stability through Partial Deformation: To prevent the adversary from completely overwhelming the task network (which causes the model to diverge), the authors only deform half of the samples in each training batch.
  • Optimal Placement: The AFDM works best when placed in the "mid-to-deep" layers. If placed too early (shallow layers), the model fails to converge; if placed too late, the features are already too compressed to benefit from spatial warping.

Key Results

The AFDM-enhanced models consistently outperformed baselines across all datasets:

  • Low-Data Regime: On the IAM dataset, the performance gap between AFDM and standard augmentation was most pronounced when training data was limited (e.g., 10k samples), proving its utility for low-resource scenarios.
  • Indic Scripts: For Bangla (IndicBAN), the Word Error Rate (WER) dropped from 26.31% (baseline) to 15.47% (Ours). For Devanagari (IndicDEV), it dropped from 25.35% to 14.3%.
  • Hard Sample Generalization: In a specific experiment where the model was trained on "easy" samples and tested on "hard" ones, the adversarial framework achieved a 27.64% WER, vastly outperforming the non-adversarial version at 40.22% WER.

Limitations and Future Work

  • Training Complexity: Adversarial training is inherently more complex and requires careful hyperparameter tuning (like the 10k iteration pre-training phase) to ensure the adversary doesn't "break" the recognizer early on.
  • Computational Overhead: Adding a localization network and performing TPS transformations on feature maps increases the training time per iteration.
  • Future Directions: The authors suggest that this meta-framework could be extended to other architectures like ResNet and potentially applied to other sequence-based tasks beyond handwriting, such as scene text recognition or even speech.

Summary updated

Abstract

Handwritten Word Recognition and Spotting is a challenging field dealing with handwritten text possessing irregular and complex shapes. The design of deep neural network models makes it necessary to extend training datasets in order to introduce variations and increase the number of samples; word-retrieval is therefore very difficult in low-resource scripts. Much of the existing literature comprises preprocessing strategies which are seldom sufficient to cover all possible variations. We propose the Adversarial Feature Deformation Module (AFDM) that learns ways to elastically warp extracted features in a scalable manner. The AFDM is inserted between intermediate layers and trained alternatively with the original framework, boosting its capability to better learn highly informative features rather than trivial ones. We test our meta-framework, which is built on top of popular word-spotting and word-recognition frameworks and enhanced by the AFDM, not only on extensive Latin word datasets but also sparser Indic scripts. We record results for varying training data sizes, and observe that our enhanced network generalizes much better in the low-data regime; the overall word-error rates and mAP scores are observed to improve as well.
BibTeX
@inproceedings{bhunia2019handwriting,
  author = {Ayan Kumar Bhunia and Abhirup Das and Ankan Kumar Bhunia and Perla Sai Raj Kishore and Partha Pratim Roy},
  title = {{Handwriting Recognition in Low-resource Scripts using Adversarial Learning}},
  booktitle = {CVPR},
  year = {2019},
  url = {https://openreview.net/forum?id=roow6WmxdaH},
}
Figure