Skip to main content
QUICK REVIEW

[Paper Review] A GRU-based Encoder-Decoder Approach with Attention for Online Handwritten Mathematical Expression Recognition

Jianshu Zhang, Jun Du|arXiv (Cornell University)|Dec 4, 2017
Handwritten Text Recognition TechniquesComputer Science27 references12 citations
TL;DR

This paper proposes an end-to-end GRU-based encoder-decoder model with coverage-based attention for online handwritten mathematical expression recognition (OHMER), leveraging trajectory sequences to jointly perform symbol recognition and structural analysis. It achieves a 52.43% expression recognition accuracy on the CROHME 2014 benchmark using only official training data, outperforming prior state-of-the-art methods by automatically learning spatial relationships and segmentation through attention mechanisms.

ABSTRACT

In this study, we present a novel end-to-end approach based on the encoder-decoder framework with the attention mechanism for online handwritten mathematical expression recognition (OHMER). First, the input two-dimensional ink trajectory information of handwritten expression is encoded via the gated recurrent unit based recurrent neural network (GRU-RNN). Then the decoder is also implemented by the GRU-RNN with a coverage-based attention model. The proposed approach can simultaneously accomplish the symbol recognition and structural analysis to output a character sequence in LaTeX format. Validated on the CROHME 2014 competition task, our approach significantly outperforms the state-of-the-art with an expression recognition accuracy of 52.43% by only using the official training dataset. Furthermore, the alignments between the input trajectories of handwritten expressions and the output LaTeX sequences are visualized by the attention mechanism to show the effectiveness of the proposed method.

Motivation & Objective

  • To address the limitations of sequential and global OHMER methods that rely on explicit segmentation and predefined grammars.
  • To develop an end-to-end deep learning framework that jointly performs symbol recognition, segmentation, and structural analysis without prior knowledge of mathematical grammar.
  • To improve recognition accuracy by leveraging online trajectory data through a GRU-RNN encoder and a coverage-based attention decoder.
  • To visualize attention alignments to demonstrate the model's ability to learn intuitive spatial relationships in handwritten expressions.

Proposed method

  • The encoder uses a stack of bidirectional GRUs to encode 2D trajectory points into high-level representations, capturing spatial and sequential context.
  • The decoder employs a unidirectional GRU with a coverage-based attention mechanism to generate LaTeX-formatted output token by token.
  • The attention mechanism dynamically attends to relevant input trajectory segments, implicitly learning symbol boundaries and spatial relationships such as superscript, subscript, and horizontal/vertical alignment.
  • The coverage mechanism tracks previously attended regions to prevent redundant attention and improve alignment stability.
  • The model is jointly trained to optimize both symbol recognition and structural parsing in a single differentiable framework.
  • Input trajectory preprocessing includes feature extraction from raw (x, y, timestamp) points to form input sequences for the RNNs.

Experimental results

Research questions

  • RQ1Can an end-to-end attention-based encoder-decoder model effectively recognize online handwritten mathematical expressions without explicit segmentation or predefined grammars?
  • RQ2How well can the attention mechanism learn and represent complex two-dimensional spatial relationships such as superscripts, subscripts, and fractions?
  • RQ3Does the inclusion of a coverage-based attention mechanism improve recognition performance and alignment interpretability compared to standard attention?
  • RQ4To what extent does the model’s attention visualization align with human intuition in symbol and structure localization?
  • RQ5How does the proposed method compare to state-of-the-art OHMER systems in terms of recognition accuracy using only official training data?

Key findings

  • The proposed model achieves a 52.43% expression recognition accuracy on the CROHME 2014 test set, significantly outperforming previous state-of-the-art methods using only official training data.
  • The attention mechanism successfully learns to align input trajectory segments with output LaTeX tokens, and visualizations show that attention focuses on relevant regions such as the start/end of base symbols and superscript/subscript regions.
  • The model automatically performs symbol segmentation and structural analysis without relying on predefined grammars or rule-based parsing.
  • The coverage-based attention mechanism improves attention stability and reduces redundant attention, contributing to better performance.
  • Error analysis reveals that over-translating errors often arise from split strokes (e.g., a single symbol split into two), while under-translating errors occur when critical strokes (e.g., a minus sign) are written in reverse order.
  • The model correctly generates LaTeX braces for exponents after detecting superscript relationships, demonstrating its ability to learn syntactic structure implicitly.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.