Skip to main content
QUICK REVIEW

[论文解读] TrOCR: Transformer-based Optical Character Recognition with Pre-trained Models

Minghao Li, Tengchao Lv|arXiv (Cornell University)|Sep 21, 2021
Handwritten Text Recognition Techniques参考文献 41被引用 77
一句话总结

TrOCR 使用端到端 Transformer 基于 OCR,利用预训练的图像和文本 Transformer,在印刷文本、手写文本和场景文本上实现无 CNN 主干或外部语言模型的最先进结果。

ABSTRACT

Text recognition is a long-standing research problem for document digitalization. Existing approaches are usually built based on CNN for image understanding and RNN for char-level text generation. In addition, another language model is usually needed to improve the overall accuracy as a post-processing step. In this paper, we propose an end-to-end text recognition approach with pre-trained image Transformer and text Transformer models, namely TrOCR, which leverages the Transformer architecture for both image understanding and wordpiece-level text generation. The TrOCR model is simple but effective, and can be pre-trained with large-scale synthetic data and fine-tuned with human-labeled datasets. Experiments show that the TrOCR model outperforms the current state-of-the-art models on the printed, handwritten and scene text recognition tasks. The TrOCR models and code are publicly available at \url{https://aka.ms/trocr}.

研究动机与目标

  • 激励利用预训练视觉与语言模型的端到端 OCR。
  • 提出一个不含 CNN 的 Transformer 架构用于图像到文本的转录。
  • 证明在大规模合成数据上的预训练能改善下游 OCR 任务。
  • 在印刷文本、手写文本和场景文本基准上展示最先进的性能。

提出的方法

  • 使用预训练的图像 Transformer 作为编码器处理输入图像的 384x384 补丁。
  • 使用预训练的文本 Transformer 作为解码器,通过编码器-解码器注意力生成词片段标记。
  • 用 DeiT/BEiT 预训练模型初始化编码器,使用 RoBERTa/MiniLM 变体初始化解码器。
  • 在大规模合成数据上进行两阶段预训练,然后在下游任务上微调。
  • 对输出进行 BPE 和 SentencePiece 分词,不依赖于特定任务 vocab。
  • 使用束搜索(束宽度 10)推断,生成最终的词片段序列。

实验结果

研究问题

  • RQ1在不使用 CNN 的 Transformer 编码器-解码器架构是否可以在印刷文本、手写文本和场景文本上实现具有竞争力的 OCR 精度?
  • RQ2与 CNN/RNN 基线相比,预训练的图像与文本 transformer 对 OCR 性能的影响如何?
  • RQ3在合成数据上的两阶段预训练如何影响下游 OCR 基准?
  • RQ4使用预训练的 Transformer 解码器进行 OCR 时,是否需要外部语言模型?

主要发现

模型精确率召回率F1
TrOCR_LARGE (SROIE)96.5996.5796.58
TrOCR_BASE (SROIE)96.3796.3196.34
  • TrOCR 采用 BEiT 编码器和 RoBERTa-LARGE 解码器,在基准测试中表现出色,超越了 CNN/RNN 基线。
  • 在 SROIE 上,TrOCR-LARGE 达到 F1 为 96.58(表格显示 96.59 的 precision,96.57 的 recall)。
  • 在 IAM 手写数据集上,TrOCR-LARGE 实现 CER 为 2.89,超过了若干基于 CNN/RNN 的方法。
  • 在场景文本基准上,TrOCR 模型在通过合成数据和基准数据微调后,建立了五项新的最先进结果,覆盖八个实验。
  • 对比变体表明预训练的图像 Transformer(BEiT)和大解码器(RoBERTa-LARGE)能带来最佳性能。
  • 推理速度方面,TrOCR-SMALL 在显著更少参数的情况下提供了有利的准确性与速度权衡。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。