文字识别模型介绍
文字识别,即给定一张文本图片,识别出图中所含文字并输出对应字符串。
本模型用于通用场景(不包含手写场景)的文字识别任务。
欢迎使用!
模型描述
本模型主要包括两个主要部分,统一卷积与自注意力机制的主干网络和Enhanced CTC loss(增加Center loss优化相似字符误识别问题),模型训练过程中,使用自蒸馏策略,识别模型结构如下图:
模型测试接结果
在公开中文数据集Benchmarking-Chinese-Text-Recognition上训练并测试,结果如下表所示:
Model | Scene | Web | Document |
SAR | 62.5 | 54.3 | 93.8 |
TransOCR | 63.3 | 62.3 | 96.9 |
MaskOCR-base | 73.9 | 74.8 | 99.3 |
OFA-OCR | 82.9 | 81.7 | 99.1 |
CNCV-OCR | 77.28 | 78.44 | 99.42 |
与 OFA-OCR 模型对比优势:
- 在保持精度较高的同时,推理速度快,显存占用少,模型实用性高,在A10机器上耗时(s)对比如下:
模型 | batch 1 | batch 16 | batch 32 | batch 64 |
OFA-OCR | 0.2534 | 2.1695 | 4.052 | out-memory |
CNCV-OCR | 0.021 | 0.0510 | 0.0982 | 0.2185 |
- 使用CTC解码,对长文本识别效果好;
期望模型使用方式以及适用范围
本模型主要用于给输入图片输出图中文字内容,具体地,模型输出内容以字符串形式输出。用户可以自行尝试各种输入图片。具体调用方式请参考代码示例。
- 注:输入图片应为包含文字的单行文本图片。其它如多行文本图片、非文本图片等可能没有返回结果,此时表示模型的识别结果为空。
#
模型可视化效果 以下为模型的可视化文字识别效果。
TODO
模型局限性以及可能的偏差
- 模型是在中文数据集上训练的,在其他语言或其他场景的数据上有可能产生一定偏差,请用户自行评测后决定如何使用。
- 当前版本在python3.7的CPU环境和单GPU环境测试通过,其他环境下可用性待测试。
相关论文以及引用
@misc{li2022uniformer,
title={UniFormer: Unifying Convolution and Self-attention for Visual Recognition},
author={Kunchang Li and Yali Wang and Junhao Zhang and Peng Gao and Guanglu Song and Yu Liu and Hongsheng Li and Yu Qiao},
year={2022},
eprint={2201.09450},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
@article{ShiBY17,
author = {Baoguang Shi and
Xiang Bai and
Cong Yao},
title = {An End-to-End Trainable Neural Network for Image-Based Sequence Recognition
and Its Application to Scene Text Recognition},
journal = {{IEEE} Trans. Pattern Anal. Mach. Intell.},
volume = {39},
number = {11},
pages = {2298--2304},
year = {2017}
}
@article{chen2021benchmarking,
title={Benchmarking Chinese Text Recognition: Datasets, Baselines, and an Empirical Study},
author={Chen, Jingye and Yu, Haiyang and Ma, Jianqi and Guan, Mengnan and Xu, Xixi and Wang, Xiaocong and Qu, Shaobo and Li, Bin and Xue, Xiangyang},
journal={arXiv preprint arXiv:2112.15093},
year={2021}
}
评论