UniMERNet: A Universal Network for Real-World Mathematical Expression Recognition

Zhuangcheng Gu, Guang Liang, Bin Wang, Zhi-Yuan Zhao, Qin-Tong Zhang +7 more
1/1/2026
transformer-attention

No official code found. Best implementation: opendatalab/UniMERNet (516 stars, Python, Apache-2.0, last commit 2025-09-28).

Abstract

This paper introduces UniMERNet, a high-accuracy, computation-efficient algorithm for Mathematical Expression Recognition (MER) across diverse real-world scenarios. To facilitate UniMERNet's training, we constructed UniMER-1M, a million-scale dataset whose unprecedented diversity endows the model with robust generalization ability.

Show full abstract

Through in-depth analysis, we discover a distinctive raster-scan pattern (left-to-right, top-to-bottom) in the attention distribution of Transformer models for MER tasks, which closely aligns with human reading habits. Based on this key finding, we design an innovative **Raster-Scan Attention** mechanism that employs a "horizontal-first, vertical-second" sequential attention computation strategy. This approach not only successfully reduces computational complexity from \mathcal O (NH^2W^2D) to \mathcal O (NHWD(H + W)) , but also enables the model to capture long-range dependencies more efficiently, achieving recognition performance comparable to global attention. Leveraging both UniMER-1M and our innovative attention mechanism, UniMERNet achieves state-of-the-art performance across four real-world scenarios while significantly reducing computational resources compared to global attention: over **1.2x** memory savings during training, approximately **10x** memory reduction during inference, and **5x** speed with slightly improved accuracy. All resources will be publicly released to advance MER research further.

Semantic Scholar

Code Implementations(1)

Apache-2.0

UniMERNet: A Universal Network for Real-World Mathematical Expression Recognition

51648Python, Jupyter NotebookApr 23, 20241 years agoApache-2.0

Similar Papers

Cite this paper

@article{gu2026unimernet,
  title  = {UniMERNet: A Universal Network for Real-World Mathematical Expression Recognition},
  author = {Zhuangcheng Gu and Guang Liang and Bin Wang and Zhi-Yuan Zhao and Qin-Tong Zhang and Wei-Jia Li and Chao-Chao Xu and Bo Zhang and Bo-Tian Shi and Jiang Wu and Wen-Tao Zhang and Cong-Hui He},
  year   = {2026},
  url    = {https://api.semanticscholar.org/CorpusID:2e545a7c2fc5753921717f1a914e2ad1216b0408},
  journal = {Computer Vision and Pattern Recognition}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2e545a7c2fc5753921717f1a914e2ad1216b0408.svg)](https://codeofpaper.com/paper/2e545a7c2fc5753921717f1a914e2ad1216b0408)

Discussion