Introduction
Handwritten Mathematical Expression Recognition (HMER) represents a significant challenge in the field of computer vision and document analysis. Unlike standard Optical Character Recognition (OCR), which typically processes linear strings of text, HMER must account for the complex two-dimensional spatial relationships inherent in mathematical notation. To represent these structures in LaTeX, models must correctly predict "implicit characters"—symbols such as ^ (superscript), _ (subscript), and { } (grouping)—that define the layout but do not physically appear in the handwriting.
Existing encoder-decoder architectures often struggle to maintain global structural consistency, leading to errors where individual symbols are identified correctly but placed in the wrong mathematical context. The Implicit Character-Aided Learning (ICAL) framework addresses this by explicitly teaching models to identify the "structural skeleton" of an equation, fusing these cues with standard recognition to achieve state-of-the-art results.
Methodology
The ICAL framework is built upon a robust foundation consisting of a DenseNet encoder and a Transformer decoder. To enhance the model's structural awareness, the authors introduce three key innovations:
1. Implicit Character Construction Module (ICCM)
The ICCM is designed to force the model to learn the underlying layout of the LaTeX string. It takes the output from the primary Transformer decoder and attempts to predict a sequence composed exclusively of structural characters and placeholders. For example, for the expression $B_{m+1}$, the ICCM focuses on predicting the sequence <space> _ { <space> <space> <space> }. This secondary task ensures the model "mines" the global structural information necessary for accurate 2D reconstruction.
2. Attention-Based Fusion Module
Recognizing that structural cues should inform the final prediction, the authors implemented a Fusion Module. This component uses a weighted adjustment strategy to merge the features from the main decoder with the structural features extracted by the ICCM. By acting as a "structural corrector," the module uses the identified skeleton to refine the final LaTeX output, ensuring that symbols are placed in their correct relative positions.
3. Dynamic Weighted Loss Strategy
Structural characters are statistically rare compared to standard alphanumeric symbols, which can lead to a data imbalance during training. To counteract this, ICAL employs a dynamic logarithmic weighting function within the cross-entropy loss. This ensures the model assigns sufficient importance to the rare but vital structural cues, preventing them from being overshadowed by more common tokens.
Experimental Evaluation
The ICAL framework was rigorously evaluated on two major benchmarks:
- CROHME (2014, 2016, 2019): The standard benchmark for HMER, featuring thousands of handwritten samples in InkML format.
- HME100k: A large-scale, real-world dataset containing over 100,000 images. This dataset is particularly challenging due to its inclusion of 249 symbol classes and real-world noise such as blur, color variations, and complex backgrounds.
Performance Results
ICAL consistently outperformed previous state-of-the-art (SOTA) models across all metrics. On the CROHME datasets, the model improved the Expression Recognition Rate (ExpRate) by 2.25% (2014), 1.81% (2016), and 1.39% (2019). On the massive HME100k dataset, it achieved a SOTA ExpRate of 69.06%, a nearly 1% improvement over the previous best-performing model.
Beyond absolute accuracy, ICAL showed significant gains in the "$\\le 1$ error" and "$\\le 2$ error" metrics. This indicates that even when the model fails to achieve a 100% match, its predictions are much closer to the ground truth than those of its predecessors, often missing only a single character rather than failing on the entire structure.
Discussion and Efficiency
A critical advantage of ICAL is its practical efficiency. Despite the addition of the ICCM and Fusion modules, the parameter count only increased from 6.39M to 7.37M. Inference speed remained largely unaffected, dropping only slightly from 2.48 FPS to 2.39 FPS. This balance of high accuracy and low computational overhead makes ICAL a viable candidate for real-world applications.
Case studies within the research highlight the "Aha!" moments of the system: in instances where standard models (like CoMER) misidentify a subscript or miss a bracket, the ICCM often correctly identifies the structural requirement. The Fusion Module then leverages this hint to guide the main decoder toward the correct mathematical interpretation.
Conclusion
ICAL demonstrates that treating mathematical structure as a "first-class citizen" in the learning process significantly improves HMER performance. By explicitly modeling the implicit characters of LaTeX, the framework provides a more reliable "skeleton" for AI to build upon. Future work will focus on extending this approach to even more complex scenarios, such as multi-line equations and deeply nested matrices, while further validating the model's robustness across large-scale datasets.
Summary updated