ABM
A handwritten math expression recognizer with a DenseNet encoder and two decoders working in opposite directions.
Documents and OCR · 2,463 operations Checked
Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.
At a glance
- Task
- Documents and OCR
- Parameters
- 8.4M
- Operations
- 2,463
- Framework
- PyTorch
- Recurrent
- Yes
- Published
- AAAI 2022
- Cited by
- 77 (as of 24 October 2026)
- Authors
- Xiaohang Bian, Bo Qin, Xiaozhe Xin and others
- Source
- GitHub: XH-B/ABM
- Checked
- Passed: the trace was replayed operation by operation and matched the model's own output for this input.
Files
The file opened in a new tab. Use your browser's Save command there to keep it.
The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.
Details
- Stable ID
- m14479
- Graph hash
- cb735095ca7cb70b70f5747ffdcca72a5db8c890c2bc8dc3d5cdf95f6b27d519
- Skeleton hash
- f786159b572c5b28f9c1492c1c748696554d054e421bb4cfda8443e19aaaad0d
- Architecture hash
- e3cda026f073eeb8e5a3c22fd7f32de1d0a4f71ed44bfd0652807345b0279640
- Diagram SHA-256
- ac9f33c52a1c4992077be5ab27c3ed0bbcd28662ab634ac2e27373896fcbdd9b
- TorchLens version
- 2.36.0
- Renderer
- graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
- Check
- Forward pass replayed in PyTorch
What it is
ABM recognizes handwritten mathematical expressions, a task that aims to generate LaTeX sequences from images. Attention-based encoder-decoder models for this task typically generate the sequence left to right (L2R), which leaves the right-to-left (R2L) context unused. ABM, the Attention aggregation based Bi-directional Mutual learning Network, consists of one shared encoder and two parallel inverse decoders, one for each direction.
The encoder is a DenseNet that extracts features from the input image. The two decoders are trained with mutual distillation, a one-to-one knowledge transfer at each training step. A Kullback-Leibler (KL) loss measures the difference between their prediction distributions. The two branches do not share parameters during training. To handle symbols of different sizes, an Attention Aggregation Module (AAM) integrates multi-scale coverage attentions. It uses convolutions with small and large kernel sizes, for example 5 and 11.
At inference only the L2R branch is used, which keeps the original parameter size and inference speed. The paper reports recognition accuracy of 56.85% on CROHME 2014, 52.92% on CROHME 2016 and 53.96% on CROHME 2019, without data augmentation or model ensembling. The authors train on the CROHME 2014 train set and test on those three test sets.
Key idea. ABM trains two parallel decoders in opposite directions on one shared encoder, enhances them through mutual distillation, and keeps only the left-to-right branch for inference.
- abm
- handwritten mathematical expression recognition
- hmer
- image to latex
- handwritten formula recognition
- bi-directional mutual learning
- attention aggregation
- mutual distillation
- crohme
AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.
Cite the paper
@misc{bian2022handwrittenmathematicalexpressionrecognition,
title={Handwritten Mathematical Expression Recognition via Attention Aggregation based Bi-directional Mutual Learning},
author={Xiaohang Bian and Bo Qin and Xiaozhe Xin and Jianwu Li and Xuefeng Su and Yanfeng Wang},
year={2022},
eprint={2112.03603},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2112.03603},
}