[Paper Review] Handwritten Mathematical Expression Recognition with Bidirectionally Trained Transformer
This paper proposes a bidirectionally trained Transformer (BTTR) model for handwritten mathematical expression recognition, replacing RNN-based decoders with a transformer decoder and introducing a novel training strategy to enable bidirectional language modeling. The method improves accuracy by 2.23% on CROHME 2014, 1.92% on CROHME 2016, and 2.28% on CROHME 2019, achieving state-of-the-art performance without data augmentation.
Encoder-decoder models have made great progress on handwritten mathematical expression recognition recently. However, it is still a challenge for existing methods to assign attention to image features accurately. Moreover, those encoder-decoder models usually adopt RNN-based models in their decoder part, which makes them inefficient in processing long $\LaTeX{}$ sequences. In this paper, a transformer-based decoder is employed to replace RNN-based ones, which makes the whole model architecture very concise. Furthermore, a novel training strategy is introduced to fully exploit the potential of the transformer in bidirectional language modeling. Compared to several methods that do not use data augmentation, experiments demonstrate that our model improves the ExpRate of current state-of-the-art methods on CROHME 2014 by 2.23%. Similarly, on CROHME 2016 and CROHME 2019, we improve the ExpRate by 1.92% and 2.28% respectively.
Motivation & Objective
- Address the lack of coverage problem in HMER, where models under- or over-predict symbols due to poor long-range dependency modeling.
- Overcome the inefficiency and sequential nature of RNN-based decoders in handling long LaTeX sequences.
- Enable a single transformer decoder to perform both left-to-right and right-to-left decoding for improved syntactic awareness.
- Improve model generalization and accuracy through joint use of image and word positional encodings.
- Achieve state-of-the-art performance on CROHME benchmarks without relying on data augmentation techniques.
Proposed method
- Replace RNN-based decoders with a transformer decoder to enable parallel training and better modeling of long-range dependencies.
- Introduce image positional encoding (IPE) to guide attention to specific regions of the input feature map, improving spatial localization.
- Propose a bidirectional training strategy that jointly optimizes left-to-right and right-to-left decoding within a single transformer decoder.
- Utilize approximate joint search (AJS) to re-score predictions from both directions, enhancing output balance and syntactic correctness.
- Apply model ensemble techniques by averaging predictions from five independently initialized models to further boost performance.
- Train the model end-to-end using cross-entropy loss with scheduled sampling, while leveraging the permutation-invariant property of self-attention for bidirectional learning.
Experimental results
Research questions
- RQ1Can a single transformer decoder effectively learn bidirectional language modeling for HMER without increasing model complexity?
- RQ2Does the integration of image positional encoding improve attention alignment and reduce over- and under-parsing in HMER?
- RQ3How does bidirectional training compare to unidirectional training in terms of recognition accuracy and syntactic correctness?
- RQ4To what extent does approximate joint search improve the balance and accuracy of predictions in long LaTeX sequences?
- RQ5Can the proposed BTTR model achieve state-of-the-art performance without data augmentation on standard CROHME benchmarks?
Key findings
- The BTTR model achieves an ExpRate of 57.91% on the CROHME 2014 test set, improving the state-of-the-art by 2.23% without data augmentation.
- On CROHME 2016, the model achieves 54.49% ExpRate, a 1.92% improvement over prior methods.
- On CROHME 2019, the model reaches 56.88% ExpRate, representing a 2.28% relative gain over current SOTA.
- The ablation study confirms that image positional encoding improves generalization, especially on diverse scales.
- The bidirectional training strategy improves performance by 2.52% over unidirectional training even with L2R decoding only.
- Using approximate joint search and model ensemble further boosts performance by 4.68% and 3.35% respectively in ExpRate.
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.