Skip to main content
QUICK REVIEW

[论文解读] Hamming OCR: A Locality Sensitive Hashing Neural Network for Scene Text Recognition

Bingcong Li, Xin Tang|arXiv (Cornell University)|Sep 23, 2020
Advanced Image and Video Retrieval Techniques参考文献 36被引用 6
一句话总结

Hamming OCR 提出了一种轻量级场景文本识别模型,用基于局部敏感哈希(LSH)的汉明分类器和汉明嵌入替代传统的 softmax 和嵌入层,从而在不依赖词汇表大小的情况下减小模型尺寸。通过使用 LSH 代码进行分类和表征,该方法在标准基准和大规模中文数据集(GBK21K)上实现了具有竞争力的准确率,且分类器仅需 1.22 MB 存储空间,相比标准 softmax 的 32 倍压缩。

ABSTRACT

Recently, inspired by Transformer, self-attention-based scene text recognition approaches have achieved outstanding performance. However, we find that the size of model expands rapidly with the lexicon increasing. Specifically, the number of parameters for softmax classification layer and output embedding layer are proportional to the vocabulary size. It hinders the development of a lightweight text recognition model especially applied for Chinese and multiple languages. Thus, we propose a lightweight scene text recognition model named Hamming OCR. In this model, a novel Hamming classifier, which adopts locality sensitive hashing (LSH) algorithm to encode each character, is proposed to replace the softmax regression and the generated LSH code is directly employed to replace the output embedding. We also present a simplified transformer decoder to reduce the number of parameters by removing the feed-forward network and using cross-layer parameter sharing technique. Compared with traditional methods, the number of parameters in both classification and embedding layers is independent on the size of vocabulary, which significantly reduces the storage requirement without loss of accuracy. Experimental results on several datasets, including four public benchmaks and a Chinese text dataset synthesized by SynthText with more than 20,000 characters, shows that Hamming OCR achieves competitive results.

研究动机与目标

  • 为解决场景文本识别模型中 softmax 和嵌入层在大词汇量(如中文或多语言文本)场景下的高存储成本问题。
  • 在大规模词典场景下,减少模型参数量和存储需求,同时不损失识别准确率。
  • 通过移除前馈网络并应用跨层参数共享,设计一种轻量级 Transformer 解码器。
  • 探索将 LSH 代码用作分类器输出和字符嵌入,以实现高效、可扩展的文本识别。

提出的方法

  • 提出一种基于局部敏感哈希(LSH)的汉明分类器,将每个字符映射到汉明空间中的二进制代码,替代标准的 softmax 层。
  • 通过线性投影和阈值化生成 LSH 代码,并采用多数投票机制以稳定代码表征。
  • 直接将 LSH 代码用作输出嵌入,消除对独立嵌入矩阵的需求,从而减少参数量。
  • 通过移除前馈网络并应用跨层参数共享,提出一种简化的 Transformer 解码器以减少参数量。
  • 采用 MobileNetV2 作为特征编码器,以实现移动端的高效部署。
  • 使用合页损失(hinge loss)进行模型训练,以优化 LSH 投影矩阵以实现准确分类。

实验结果

研究问题

  • RQ1LSH 基于的汉明代码能否在保持准确率的前提下,有效替代场景文本识别中的传统 softmax 和嵌入层?
  • RQ2在中文文本识别等大词汇量场景下,LSH 代码与随机二进制代码的性能相比如何?
  • RQ3在场景文本识别中,LSH 代码的最优长度是多少,以在模型性能和大小之间实现最佳平衡?
  • RQ4与密集矩阵相比,使用 LSH 代码替代分类器和嵌入层可实现多大程度的参数压缩?
  • RQ5通过参数共享并移除前馈网络的简化 Transformer 解码器,在保持识别准确率方面有多高效?

主要发现

  • Hamming OCR 模型在包含两万多个字符的 GBK21K 数据集上达到 82.41% 的准确率,显著优于无法收敛的随机二进制代码。
  • 基于 LSH 的分类器仅需 1.22 MB 存储空间,相比标准 softmax 层在 512 维特征空间和 20,000 类词汇表下所需的 39.1 MB,实现了 32 倍的压缩。
  • 使用 512 位 LSH 代码的模型在 GBK21K 上表现最佳,准确率达 82.39%,且在超过 512 位后性能趋于饱和。
  • 随机二进制代码在 SVT 上达到 84.54% 的准确率,但在 GBK21K 上完全失败,表明大词汇量场景下结构化 LSH 代码的必要性。
  • 采用跨层参数共享并移除前馈网络的简化 Transformer 解码器在减少模型参数的同时,保持了具有竞争力的性能。
  • Hamming OCR 模型在四个公开基准和一个大规模中文数据集上均达到最先进水平,证明了其在大词汇量文本识别中的有效性与高效性。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

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