Recently, most handwritten mathematical expression recognition (HMER) methods adopt the encoder-decoder networks, which directly predict the markup sequences from formula images with the attention mechanism. However, such methods may fail to accurately read formulas with complicated structure or generate long markup sequences, as the attention results are often inaccurate due to the large variance of writing styles or spatial layouts. To alleviate this problem, we propose an unconventional network for HMER named Counting-Aware Network (CAN), which jointly optimizes two tasks: HMER and symbol counting. Specifically, we design a weakly-supervised counting module that can predict the number of each symbol class without the symbol-level position annotations, and then plug it into a typical attention-based encoder-decoder model for HMER. Experiments on the benchmark datasets for HMER validate that both joint optimization and counting results are beneficial for correcting the prediction errors of encoder-decoder models, and CAN consistently outperforms the state-of-the-art methods. In particular, compared with an encoder-decoder model for HMER, the extra time cost caused by the proposed counting module is marginal. The source code is available at https://github.com/LBH1024/CAN.
Stroke Constrained Attention Network for Online Handwritten Mathematical Expression Recognition
University of Science and Technology of China(中国科学技术大学);National Engineering Laboratory for Speech and Language Information Processing(国家语音与语言信息处理工程实验室)
Recognizing Handwritten Mathematical Expressions of Vertical Addition and Subtraction
Universidade Federal Rural de Pernambuco (UFRPE)(伯南布哥联邦农村大学(UFRPE));Universidade Federal de Pernambuco (UFPE)(伯南布哥联邦大学(UFPE));Federal University of Alagoas(阿拉戈斯联邦大学)