深度学习
  • 前言
  • 第一章:经典网络
    • ImageNet Classification with Deep Convolutional Neural Network
    • Very Deep Convolutional Networks for Large-Scale Image Recognition
    • Going Deeper with Convolutions
    • Deep Residual Learning for Image Recognition
    • PolyNet: A Pursuit of Structural Diversity in Very Deep Networks
    • Squeeze-and-Excitation Networks
    • Densely Connected Convolutional Networks
    • SQUEEZENET: ALEXNET-LEVEL ACCURACY WITH 50X FEWER PARAMETERS AND <0.5MB MODEL SIZE
    • MobileNet v1 and MobileNet v2
    • Xception: Deep Learning with Depthwise Separable Convolutions
    • Aggregated Residual Transformations for Deep Neural Networks
    • ShuffleNet v1 and ShuffleNet v2
    • CondenseNet: An Efficient DenseNet using Learned Group Convolution
    • Neural Architecture Search with Reinforecement Learning
    • Learning Transferable Architectures for Scalable Image Recognition
    • Progressive Neural Architecture Search
    • Regularized Evolution for Image Classifier Architecture Search
    • 实例解析:12306验证码破解
  • 第二章:自然语言处理
    • Recurrent Neural Network based Language Model
    • Learning Phrase Representations using RNN Encoder-Decoder for Statistical Machine Translation
    • Neural Machine Translation by Jointly Learning to Align and Translate
    • Hierarchical Attention Networks for Document Classification
    • Connectionist Temporal Classification : Labelling Unsegmented Sequence Data with Recurrent Neural Ne
    • About Long Short Term Memory
    • Attention Is All you Need
    • BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding
  • 第三章:语音识别
    • Speech Recognition with Deep Recurrent Neural Network
  • 第四章:物体检测
    • Rich feature hierarchies for accurate object detection and semantic segmentation
    • Spatial Pyramid Pooling in Deep Convolutional Networks for Visual Recognition
    • Fast R-CNN
    • Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks
    • R-FCN: Object Detection via Region-based Fully Convolutuional Networks
    • Mask R-CNN
    • You Only Look Once: Unified, Real-Time Object Detection
    • SSD: Single Shot MultiBox Detector
    • YOLO9000: Better, Faster, Stronger
    • Focal Loss for Dense Object Detection
    • YOLOv3: An Incremental Improvement
    • Learning to Segment Every Thing
    • SNIPER: Efficient Multi-Scale Training
  • 第五章:光学字符识别
    • 场景文字检测
      • DeepText: A Unified Framework for Text Proposal Generation and Text Detection in Natural Images
      • Detecting Text in Natural Image with Connectionist Text Proposal Network
      • Scene Text Detection via Holistic, Multi-Channel Prediction
      • Arbitrary-Oriented Scene Text Detection via Rotation Proposals
      • PixelLink: Detecting Scene Text via Instance Segmentation
    • 文字识别
      • Spatial Transform Networks
      • Robust Scene Text Recognition with Automatic Rectification
      • Bidirectional Scene Text Recognition with a Single Decoder
      • multi-task learning for text recognition with joint CTC-attention
    • 端到端文字检测与识别
      • Reading Text in the Wild with Convolutional Neural Networks
      • Deep TextSpotter: An End-to-End Trainable Scene Text Localization and Recognition Framework
    • 实例解析:字符验证码破解
    • 二维信息识别
      • 基于Seq2Seq的公式识别引擎
      • Show and Tell: A Neural Image Caption Generator
      • Show, Attend and Tell: Neural Image Caption Generation with Visual Attention
  • 第六章:语义分割
    • U-Net: Convolutional Networks for Biomedical Image Segmentation
  • 第七章:人脸识别
    • 人脸检测
      • DenseBox: Unifying Landmark Localization with End to End Object Detection
      • UnitBox: An Advanced Object Detection Network
  • 第八章:网络优化
    • Batch Normalization
    • Layer Normalization
    • Weight Normalization
    • Instance Normalization
    • Group Normalization
    • Switchable Normalization
  • 第九章:生成对抗网络
    • Generative Adversarial Nets
  • 其它应用
    • Holistically-Nested Edge Detection
    • Image Style Transfer Using Convolutional Nerual Networks
    • Background Matting: The World is Your Green Screen
  • Tags
  • References
由 GitBook 提供支持
在本页
  • 前言
  • 1. Deep TextSpotter解析
  • 1.1 全卷积网络
  • 1.2 候选区域提取
  • 1.3 双线性插值
  • 1.4 文本识别
  • 1.5 NMS
  • 总结

这有帮助吗?

  1. 第五章:光学字符识别
  2. 端到端文字检测与识别

Deep TextSpotter: An End-to-End Trainable Scene Text Localization and Recognition Framework

上一页Reading Text in the Wild with Convolutional Neural Networks下一页实例解析:字符验证码破解

最后更新于4年前

这有帮助吗?

tags: Deep TextSpotter, OCR, YOLOv2, STN, CTC

前言

Deep TextSpotter的创新点并不多,基本上遵循了传统OCR或者物体检测的两步走的流程(图1),即先进行场景文字检测,再进行文字识别。在这个算法中,检测模块基于,识别模块基于,损失函数则使用了精度的。这几个算法在当时都是state-of-the-art的,因此其效果达到了最优也不难理解。这三个知识点已分别在本书的第四章,第五章和第二章进行了解析,算法细节可参考具体内容或者阅读论文。这里不在对上面三个算法的细节再做重复,只会对Deep TextSpotter的流程做一下梳理和解释。

Deep TextSpotter的一个创新点是将NMS放到了识别之后,使用识别置信度替代了传统的检测置信度。

图1: Deep TextSpotter算法流程

1. Deep TextSpotter解析

1.1 全卷积网络

为什么使用YOLOv2:在YOLOv2的文章中我们讲过,YOLOv2使用了高分辨率的迁移学习提高了网络对高分辨率图像的检测效果,这个能力在端到端的文字检测及识别中非常重要。因为过分的降采样将造成文本区域的识别问题。

全卷积:Deep TextSpotter使用了Global Average Pooling代替全连接实现非线性化,从而使网络成为全卷积网络,原因已多次提及:保留特征向量的位置信息。

1.2 候选区域提取

锚点聚类:Deep TextSpotter将锚点聚了14类,锚点形状见图2。

图2:Deep TextSpotter聚类得到的锚点

样本采样:匹配正负锚点时使用了YOLOv1中介绍的bipartite策略,即只有和Ground Truth的IOU最大的锚点为正样本,其余均为负样本。

1.3 双线性插值

经过YOLOv2得到的检测框的尺寸,角度,比例等都是不同的,为了产生长度固定的特征向量。Faster R-CNN等方法采用的是ROI Pooling,Deep TextSpotter则是使用STN的策略,STN不仅能产生长度固定的特征向量,还能学到图像的仿射变换矩阵,是非常适用于OCR领域的。

这个过程便是双线性插值,不理解的参考我在STN的解释。

在STN中我们讲过其双线性插值是可导的,因此到目前为止该过程是端到端的。

1.4 文本识别

Deep TextSpotter使用的是基于字符序列识别方式,骨干网络使用的是基于图3的全卷积网络。网络支持宽的变长输入,但是高是固定的。图3中的Recurrent Convolution猜测是使用的结构,论文中没有给出注释。

图3:Deep TextSpotter识别部分的全卷积网络

1.5 NMS

总结

由于使用了STN连接检测和识别,Deep TextSpotter是一个真正的端到端模型,所以在训练的过程中,只需要针对分类的loss进行训练。

Deep TextSpotter,算法最核心的部件是STN,但是并没有cite该论文,识别中的RCNN也没cite,进而导致了理解上的困难,这毛病可不好。

Feature Map的尺寸:网络的框架也采样去YOLOv2中在3×33\times33×3卷积中插入1×11\times11×1卷积进行非线性化的结构。对于一张尺寸为W×HW\times HW×H的输入图像,在网络中会通过5个Max Pooling进行降采样,得到尺寸为W32×H32\frac{W}{32} \times \frac{H}{32}32W​×32H​的的Feature Map。在Deep TextSpotter中,每隔20个Epoch会更换一次输入图像的尺寸,尺寸的变化范围是{352,416,480,544,608}\{352,416,480,544,608\}{352,416,480,544,608}

输出向量:Deep TextSpotter的检测部分预测了6个值,它们分别是坐标rxr_xrx​,ryr_yry​,尺寸rwr_wrw​,rhr_hrh​,检测置信度rpr_prp​以及比YOLOv2增加的一个旋转角度rθr_\thetarθ​。其中角度使用了弧度值,即 θ∈(−π2,π2)\theta \in (-\frac{\pi}{2}, \frac{\pi}{2})θ∈(−2π​,2π​)。其它几个预测值则采用了YOLOv2中使用的预测相对值。

NMS:Deep TextSpotter的一个创新点在于并没有这检测完之后就使用NMS,考虑到的一个问题是只覆盖部分文字区域的检测框的置信度有可能高于检测到完整文字区域的置信度要高。在这里,只使用阈值θ=0.1\theta=0.1θ=0.1过滤掉部分置信度非常低的样本。

Deep TextSpotter产生的是长宽比不变,宽度固定位H′=32H'=32H′=32的Feature Map,即对于一个检测到的区域U∈Rw×h×CU\in R^{w\times h \times C}U∈Rw×h×C,其得到的Feature Map的为V∈RwH′h×H′×CV \in R^{\frac{wH'}{h}\times H' \times C}V∈RhwH′​×H′×C。

Feature Map中位置(x′,y′)(x',y')(x′,y′)处的值为:

Vx′,y′c=∑x=1w∑y=1hUx,ycκ(x−Tx(x′))κ(y−Ty(y′))V_{x',y'}^c = \sum^w_{x=1}\sum^h_{y=1}\mathbf{U}_{x,y}^c \kappa(x - \mathcal{T}_x(x')) \kappa(y - \mathcal{T}_y(y'))Vx′,y′c​=x=1∑w​y=1∑h​Ux,yc​κ(x−Tx​(x′))κ(y−Ty​(y′))

其中(x,y)(x,y)(x,y)为检测框中的一点,(x',y')为输出Feature Map上的一点,范围是x′∈[0,wH′h−1],y∈[0,H′−1]x'\in[0, \frac{wH'}{h}-1], y\in[0,H'-1]x′∈[0,hwH′​−1],y∈[0,H′−1]。T(⋅)\mathcal{T}(\cdot)T(⋅)为位置转移函数,应该是仿射变换矩阵。κ(v)=max(0,1−∣v∣)\kappa(v)=max(0,1-|v|)κ(v)=max(0,1−∣v∣)为双线性插值函数。

损失函数使用的是CTC,参考第二章一节,此处不再废话。

在检测中搁置的NMS将在识别完之后在使用,NMS中使用的置信度是识别的置信度,阈值给的是0.50.50.5。

CTC
YOLOv2
STN
CTC