用线性复杂度模型Mamba替代Transformer,提升古籍文字识别效率
A Benchmark of State-Space Models vs. Transformers and BiLSTM-based Models for Historical Newspaper OCR

- 采用CNN+双向与自回归Mamba架构,实现高效序列建模
- 在1000字符下推理速度提升2.05倍,内存增长仅1.26倍
- 适合大规模文化遗产文字识别,代码与数据已开源
历史报纸端到端文字识别仍具挑战,需处理长文本、退化印刷和复杂版式。尽管基于Transformer的模型主导研究,但其二次复杂度限制了段落级转录与大规模部署。本文首次提出基于状态空间模型(SSMs)的OCR架构,结合CNN视觉编码器与双向及自回归Mamba序列建模,并在大型基准中对比了SSM、Transformer与BiLSTM模型。在卢森堡国家图书馆新发布的超过99%验证的高质量标注数据集上,以及弗拉克特与安提夸字体的跨数据集测试中,所有神经模型均达到约2%的词错误率(CER),计算效率成为主要差异点。基于Mamba的模型在保持竞争力准确率的同时,将推理时间减半,内存增长仅为1.26倍(相比Transformer的2.30倍),在严重退化的段落级别达到6.07% CER,优于DAN模型的5.24%,且速度快2.05倍。我们公开了代码、训练好的模型与标准化评估协议,以支持可复现研究并指导实践者开展大规模文化遗产OCR工作。
原文摘要 · Abstract (English)
End-to-end OCR for historical newspapers remains challenging, as models must handle long text sequences, degraded print quality, and complex layouts. While Transformer-based recognizers dominate current research, their quadratic complexity limits efficient paragraph-level transcription and large-scale deployment. We investigate linear-time State-Space Models (SSMs), specifically Mamba, as a scalable alternative to Transformer-based sequence modeling for OCR. We present to our knowledge, the first OCR architecture based on SSMs, combining a CNN visual encoder with bi-directional and autoregressive Mamba sequence modeling, and conduct a large-scale benchmark comparing SSMs with Transformer- and BiLSTM-based recognizers. Multiple decoding strategies (CTC, autoregressive, and non-autoregressive) are evaluated under identical training conditions alongside strong neural baselines (VAN, DAN, DANIEL) and widely used off-the-shelf OCR engines (PERO-OCR, Tesseract OCR, TrOCR, Gemini). Experiments on historical newspapers from the Bibliotheque nationale du Luxembourg, with newly released >99% verified gold-standard annotations, and cross-dataset tests on Fraktur and Antiqua lines, show that all neural models achieve low error rates (~2% CER), making computational efficiency the main differentiator. Mamba-based models maintain competitive accuracy while halving inference time and exhibiting superior memory scaling (1.26x vs 2.30x growth at 1000 chars), reaching 6.07% CER at the severely degraded paragraph level compared to 5.24% for DAN, while remaining 2.05x faster. We release code, trained models, and standardized evaluation protocols to enable reproducible research and guide practitioners in large-scale cultural heritage OCR available at https://github.com/MarcoPerson/ssm-ocr-benchmark.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。