【論文速讀】XiangBai_TIP2018_TextBoxes++_A Single-Shot Oriented Scene Text Detector


XiangBai_TIP2018_TextBoxes++_A Single-Shot Oriented Scene Text Detector

作者和代碼

Minghui Liao, Baoguang Shi, Xiang Bai, Senior Member, IEEE

caffe檢測torch7識別代碼

關鍵詞

文字檢測、多方向、SSD、四個點、one-stage、開源

方法亮點

  • 把原本只能做水平的TextBoxes改為可以預測任意四邊形的多方向文本檢測
  • 除了常規的分類、回歸損失,還增加了四邊形的最外接矩形的回歸損失(增加監督信息量)

方法概述

本文方法是對TextBoxes(水平文字檢測)進行改進,用於多方向文字檢測。和SSD一樣,該方法是one-stage的端到端模型,測試時只需運行網絡+NMS即可得到檢測結果(傾斜矩形或者任意四邊形)。

方法主要改進點有:

第一,預測的目標從水平框的$(x, y, w, h)$ 變成了任意四邊形$(x_1, y_1, x_2, y_2, x_3, y_3, x_4, y_4)$ 或 傾斜矩形$(x1, y1, x2, y2, h)$;

第二,回歸損失除了增加oriented-text的位置regression loss,還增加了包含oriented-text的boundingBox(最小外接正矩形)的regression loss;

方法細節

網絡結構

網絡結構如下,VGG-16的前13層 + 10個額外卷積層 + 6個Text-box層 = 29層(和TextBoxes類似,FPN結構)

Fig. 2: The architecture of TextBoxes++, a 29-layer fully convolutional network including 13 layers from VGG-16 followed by 10 extra convolutional layers, and 6 Text-box layers connected to 6 intermediate convolutional layers. Each location of a text-box layer predicts an n dimensional vector for each default box consisting of the text presence scores (2 dimensions), horizontal bounding rectangles offsets (4 dimensions), and rotated rectangle bounding box offsets (5 dimensions) or quadrilateral bounding box offsets (8 dimensions). A non-maximum suppression is applied during test phase to merge the results of all 6 text-box layers. Note that “#c” stands for the number of channels.

Default box

(實際是水平的default box,以下為方便可視化后面預測的 ${q}$ or ${r}$ 故配圖使用傾斜框)

預測四邊形和傾斜矩形

下圖Fig.3中,黃色實線框為oriented bounding boxes ${q}$ or ${r}$ ,綠色實線框為minimum horizontal bounding rectangles ${b}$,綠色虛線框為對應match的default box。

Fig. 3: Illustration of the regression (red arrows) from a matched default box (green dashed) to a ground truth target quadrilateral (yellow) on a 3 × 3 grid. Note that the black dashed default box is not matched to the ground truth. The regression from the matched default box to the minimum horizontal rectangle (green solid) containing the ground truth quadrilateral is not shown for a better visualization.

predict的${b} $,{q}$ , ${r}$ 與default box的regression shift計算公式如下(下標為0表示是default box的相應值)

其他細節點
  • default box的aspect ratio從1,2,3,5,7 換成1,2,3,5,$\frac{1}{2}$,$\frac{1}{3}$,$\frac{1}{5}$

  • vertical offset和textBoxes一樣(豎直的step更小,更dense一些而已)

Fig. 4: Vertical offsets of default boxes on a 3×3 grid. Black (resp. yellow) dashed bounding boxes are normal default boxes (resp. default boxes with vertical offsets). Note that only the default boxes of appropriate aspect ratio are shown for better visualization.

  • text-box layer的convolutional filter從$15$變成$35$

  • 如何統一四邊形的四個點的順序?

    簡單說,首先算出四個點的最外接正矩形$G_b = (b_1, b_2, b_3, b_4)$, 正矩形有top-left點的概念(最左上角點)。然后依次算出$G_q = (q_1, q_2, q_3, q_4)$的四個點和$G_b$的四個點的歐氏距離(都按順時針或者逆時針方式連接點),求出使得歐氏距離和最小的時對應的$G_q$的點順序即為最終四個點的關系(此時,第一個點可以認為是top-left點)。如下圖所示,左圖比右圖距離和更小,故采用左圖的點順序關系。

  • 使用$(x, y, w, h, \theta)$還是$(x_1, y_1, x_2, y_2, h)$?

    使用$\theta$具有數據集的偏向性(某些數據集可能水平文字比較多,$\theta$普遍比較小,那么模型學出來的$\theta$也比較小),而采用$(x_1, y_1, x_2, y_2, h)$方式則會避免該問題。

    However, due to the bias of the dataset, there is usually an uneven distribution on θ, which may make the model dataset-dependent.

  • 在data augmentation時,除了用Jaccard overlap作為crop的標准外(小目標僅用IOU會導致小目標可能占了全圖比例過大?),增加object overlap標准來判斷是否crop。->個人認為,其實是增加一個指標/參數,控制目標在整張圖中的比例不至於過大。

Fig. 5: Data augmentation by random cropping based on Jaccard overlap (a-b) and object coverage constraints (c-d). Images in (b) and (d) are the corresponding resized crops.

  • 訓練的前期可以用小的scale,后期用大的scale,可以加速

  • NMS加速

    先使用四邊形的boundingBox來做NMS_bb(速度更快),閾值可取大如0.5。再在剩下的四邊形做NMS_polygon,閾值可取小一些如0.2。

  • 檢測+識別的綜合打分

    $s_d = 0.6,s_r = 0.005$,使用指數更平滑,檢測+識別取平均更好。

實驗結果

  • ICDAR13

  • ICDAR15

  • COCO-Text

  • 速度

總結與收獲

這篇和其他水平轉傾斜方法進行改進的文章相比,細節介紹的比較有趣,增加boundingbox的regression loss思路也很直觀(監督信息越多,效果應該是會越好)。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM