[Paper Review] Stroke Constrained Attention Network for Online Handwritten Mathematical Expression Recognition
This paper proposes Stroke Constrained Attention Network (SCAN), a novel encoder-decoder framework for online handwritten mathematical expression recognition that treats strokes as the fundamental unit for feature representation and attention alignment. By leveraging stroke-level features from both online (trace-based) and offline (image-based) modalities, SCAN improves attention alignment, accelerates decoding, and enables early fusion of multi-modal information, achieving state-of-the-art performance on the CROHME benchmark with 57.20% expression accuracy and 73.94% structural accuracy.
In this paper, we propose a novel stroke constrained attention network (SCAN) which treats stroke as the basic unit for encoder-decoder based online handwritten mathematical expression recognition (HMER). Unlike previous methods which use trace points or image pixels as basic units, SCAN makes full use of stroke-level information for better alignment and representation. The proposed SCAN can be adopted in both single-modal (online or offline) and multi-modal HMER. For single-modal HMER, SCAN first employs a CNN-GRU encoder to extract point-level features from input traces in online mode and employs a CNN encoder to extract pixel-level features from input images in offline mode, then use stroke constrained information to convert them into online and offline stroke-level features. Using stroke-level features can explicitly group points or pixels belonging to the same stroke, therefore reduces the difficulty of symbol segmentation and recognition via the decoder with attention mechanism. For multi-modal HMER, other than fusing multi-modal information in decoder, SCAN can also fuse multi-modal information in encoder by utilizing the stroke based alignments between online and offline modalities. The encoder fusion is a better way for combining multi-modal information as it implements the information interaction one step before the decoder fusion so that the advantages of multiple modalities can be exploited earlier and more adequately when training the encoder-decoder model. Evaluated on a benchmark published by CROHME competition, the proposed SCAN achieves the state-of-the-art performance.
Motivation & Objective
- To address the challenge of inaccurate attention-based symbol segmentation in HMER due to reliance on low-level features like trace points or image pixels.
- To improve recognition performance and decoding efficiency by treating strokes—natural groupings of pen-down/up actions—as the fundamental unit in encoder-decoder models.
- To enable more effective multi-modal fusion in HMER by aligning online and offline modalities at the stroke level before decoding.
- To overcome limitations of delayed or out-of-order strokes in online HMER by leveraging global context from offline images.
Proposed method
- The model uses a CNN-GRU encoder for online modality to extract point-level features from trace sequences, which are then converted into stroke-level features using stroke constraints.
- For offline modality, a CNN encoder extracts pixel-level features from static images, which are similarly transformed into stroke-level representations.
- The decoder employs an attention mechanism that operates on stroke-level features, enabling more accurate and stable symbol segmentation and recognition.
- In multi-modal settings, the model fuses online and offline features at the encoder level using stroke-based alignments, enabling earlier and more effective information interaction.
- The method introduces a novel attention mechanism that leverages stroke-level representations to improve alignment and reduce the number of tokens processed during decoding.
- The framework supports both single-modal (online/offline) and multi-modal HMER, with end-to-end training and inference.
Experimental results
Research questions
- RQ1Can treating strokes as the fundamental unit in HMER improve attention alignment and recognition accuracy?
- RQ2Does using stroke-level features instead of point/pixel-level features reduce the computational cost of decoding?
- RQ3Can early fusion of online and offline modalities via stroke-based alignment outperform late fusion or separate modality processing?
- RQ4How does the model handle challenging cases such as delayed or out-of-order strokes in online handwriting?
- RQ5To what extent does stroke-level representation enhance the robustness of HMER to ambiguous or non-standard writing orders?
Key findings
- SCAN achieved a state-of-the-art expression accuracy of 57.20% and structural accuracy of 73.94% on the CROHME 2014 benchmark, outperforming previous methods.
- The model reduced test time by 50% compared to the E-MAN system, achieving faster inference than the offline WAP system despite higher accuracy.
- Attention visualization showed that MMSCAN-E (early fusion) produced more consistent and accurate attention alignments than MMSCAN-D (late fusion), especially in handling delayed strokes.
- The number of strokes is significantly smaller than the number of trace points or image pixels, leading to faster decoding and reduced computational cost in the attention mechanism.
- The encoder-level fusion in MMSCAN-E successfully resolved the delayed stroke problem by using global context from offline images, while MMSCAN-D failed due to inconsistent attention across modalities.
- The stroke-constrained feature transformation improved feature representation, reducing the difficulty of symbol segmentation and recognition in the decoder.
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.