Official implementation of "GryphOne: Symbol-Aware Masked Diffusion for Structural Refinement in Offline Handwritten Mathematical Expression Recognition" (ECCV 2026).
GryphOne iteratively refines symbols and their relationships with symbol-aware masked diffusion:
Install PyTorch 2.4+ and run the following command:
$ pip install -e .See releases.
Download the following datasets:
Run preprocess.py as follows:
$ python3 preprocess.py datasets/crohme_test.yaml
$ python3 preprocess.py datasets/mathwriting.yamlThe datasets must be placed in data directory as follows:
$ ls ~/data
crohme/
CROHME2014_data/
CROHME2016_data/
CROHME2019_data/
mathwriting/
2024/
test/
000a4e8ca49c5a1c.inkml
001083e26028da36.inkml
0017bb5822bcba69.inkml
002ae6d5dd4173e4.inkml
00386113d577085b.inkml
train/
00001d1472a8709f.inkml
00002504391b73b5.inkml
00003037d3a6d0ba.inkml
0000fe986018f92a.inkml
00011d9f03970147.inkml
valid/
00000b332dcd6fe5.inkml
000453d57c3d334d.inkml
0005d0be8e507b24.inkml
0005ea8e21185d36.inkml
00061be0501a1fa8.inkml
pickle/
gryph_crohme_test.pkl
gryph_mathwriting.pklRun train.py to start training for MathWriting using four GPUs:
$ torchrun --nproc-per-node=4 train.py configs/mathwriting.py --work-dir ~/workRun infer.py to start inference using the trained model:
$ python3 infer.py --config ~/work/mathwriting.py --weight ~/work/epoch_60.pth --split test --store results.pklUse LgEval for strict evaluation.
This project is licensed under the MIT License. See LICENSE for more details.
@inproceedings{ECCV26KAT,
author={Takaya Kawakatsu and Ryo Ishiyama},
title={GryphOne: Symbol-Aware Masked Diffusion for Structural Refinement in Offline Handwritten Mathematical Expression Recognition},
booktitle={Computer Vision -- ECCV 2026},
publisher={Springer Nature Switzerland},
year={2026},
pages={609--624},
}MuTabNet (ICDAR2024): our table recognition framework for ICDAR 2024 and 2026.