Shape Robust Text Detection with Progressive Scale Expansion Network 論文閱讀

論文地址:https://arxiv.org/pdf/1806.02559.pdf

Abstract

The challenges of shape robust text detection lie in two aspects: 1) most existing quadrangular bounding box based detectors are difficult to locate texts with arbitrary shapes, which are hard to be enclosed perfectly in a rectangle; 2) most pixel-wise segmentation-based detectors may not separate the text instances that are very close to each other. To address these problems, we propose a novel Progressive Scale Expansion Network (PSENet), designed as a segmentation-based detector with multiple predictions for each text instance. These predictions correspond to different kernels produced by shrinking the original text instance into various scales. Consequently, the final detection can be conducted through our progressive scale expansion algorithm which gradually expands the kernels with minimal scales to the text instances with maximal and complete shapes. Due to the fact that there are large geometrical margins among these minimal kernels, our method is effective to distinguish the adjacent text instances and is robust to arbitrary shapes. The state-of-the-art results on ICDAR 2015 and ICDAR 2017 MLT benchmarks further confirm the great effectiveness of PSENet. Notably, PSENet outperforms the previous best record by absolute 6.37% on the curve text dataset SCUT-CTW1500. Code will be available in https://github.com/whai362/PSENet.

任意文本檢測面臨的挑戰主要表現在兩個方面:
1)現有的基於四邊形邊界框的檢測器難以定位任意形狀的文本,難以將文本完美地封裝在矩形中;
2)大多數基於像素分段的檢測器可能無法將非常接近的文本實例分開。

爲了解決這些問題,我們提出了一種新型的漸進比例擴張網絡(PSENet),它被設計成一個基於分段的檢測器,對每個文本實例進行多個預測。這些預測對應於通過將原始文本實例縮小到不同的範圍而產生的不同內核。因此,最終的檢測可以通過我們的漸進比例擴張算法進行,該算法將最小尺度的內核逐步擴展到最大和完整形狀的文本實例。由於這些最小核之間存在較大的幾何邊界,因此我們的方法能夠有效地區分相鄰的文本實例,並且對任意形狀具有魯棒性。ICDAR 2015和ICDAR 2017 MLT基準測試的最新結果進一步證實了PSENet的巨大有效性。值得注意的是,PSENet在SCUT-CTW1500曲線文本數據集上的性能比之前的最佳記錄絕對高6.37%。代碼將在https://github.com/whai362/PSENet中提供。

1 Introduction

Recently, natural scene text detection has attracted extensive attention for its numerous applications, such as scene understanding, product identification, automatic driving and target geolocation. However, due to the large variations in foreground texts and background objects, and the diverse text variabilities in shapes, colors, fonts, orientations and scales, along with the extreme illumination and occlusion, text detection in natural scene is still faced with considerable challenges.

近年來,自然場景文本檢測因其在場景理解、產品識別、自動駕駛、目標定位等方面的廣泛應用而受到廣泛關注。然而,由於前景文本和背景對象變化較大,文本在形狀、顏色、字體、方向和尺度上的多樣性,以及極端的光照和遮擋,自然場景中的文本檢測仍然面臨着相當大的挑戰。

Nevertheless, great progress has been made in recent years with the amazing development of Convolutional Neural Networks (CNNs) [6, 10, 22]. Based on bounding box regression, a list of methodologies [8, 9, 12, 17, 19, 23, 26, 29, 30] has been proposed to successfully locate the text targets in forms of rectangles or quadrangles with certain orientations. Unfortunately, these frameworks cannot detect the text instances with arbitrary shapes (e.g., the curve texts), which also often appear in natural scenes (see Fig. 1 (b)). Naturally, semantic segmentation-based methods can be taken into consideration to explicitly handle the curve text detection problems. Although pixel-wise segmentation can extract the regions of arbitrary-shaped text instances, it may still fail to separate two text instances when they are relatively close, because their shared adjacent boundaries will probably merge them together as one single text instance (see Fig. 1 ©).
然而,近年來隨着卷積神經網絡(Convolutional Neural Networks, CNNs)的驚人發展,卷積神經網絡已經取得了很大的進步[6,10,22]。在bounding box 迴歸的基礎上,提出了一系列方法[8、9、12、17、19、23、26、29、30]來成功定位具有一定方向的矩形或四邊形文本目標。不幸的是,這些框架無法檢測任意形狀的文本實例(例如曲線文本),這些文本實例也經常出現在自然場景中(參見圖1 (b))。自然,可以考慮基於語義分段的方法來顯式處理曲線文本檢測問題。雖然像素分割可以提取任意形狀文本實例的區域,但是當兩個文本實例相對較近時,仍然可能無法分離,因爲它們共享的相鄰邊界可能會將它們合併爲一個文本實例(見圖1 ©)。

To address these problems, in this paper, we propose a novel instance segmentation network, namely,Progressive Scale Expansion Network (PSENet). There are two advantages of the proposed PSENet.
針對這些問題,本文提出了一種新的實例分割網絡,即漸進比例擴張網絡(PSENet)。提出的PSENet有兩個優點。
Firstly, as a segmentation-based method, PSENet is able to locate texts with arbitrary shapes. Secondly, we put forward a progressive scale expansion algorithm, with which the closely adjacent text instances can be identified successfully (see Fig. 1 (d)). Specifically, we assign each text instance with multiple predicted segmentation areas. For convenience, we denote these segmentation areas as kernels in this paper and for one text instance, there are several corresponding kernels. Each of the kernels shares the similar shape with the original entire text instance, and they all locate at the same central point but differ in scales. To obtain the final detections, we adopt the progressive scale expansion algorithm. It is based on Breadth-First-Search (BFS) and is composed of 3 steps: 1) starting from the kernels with minimal scales (instances can be distinguished in this step); 2) expanding their areas by involving more pixels in larger kernels gradually; 3) finishing until the largest kernels are explored.
首先,作爲一種基於分段的方法,PSENet能夠對任意形狀的文本進行定位。其次,我們提出了一種漸進比例擴張算法,利用該算法可以成功地識別出相鄰的文本實例(見圖1 (d))。具體來說,我們爲每個文本實例分配多個預測的分割區域。爲了方便起見,本文將這些分割區域表示爲內核,對於一個文本實例,有幾個相應的內核。每個內核的形狀都與原始的整個文本實例相似,它們都位於相同的中心點,但是大小不同。
爲了得到最終的檢測結果,我們採用了漸進比例擴張算法。它基於廣度優先搜索(BFS),由3個步驟組成:
1)從規模最小的內核開始(實例可在此步驟中區分);
2)通過在更大的內核中逐漸包含更多的像素來擴展它們的區域;
3)直到最大的內核被開發出來。
在這裏插入圖片描述
圖1:不同方法的結果,最好以彩色顯示。
(a)爲原始圖像。
(b)爲基於邊界框迴歸方法的結果,紅色框幾乎覆蓋了綠色框中一半以上的上下文,檢測結果令人失望。
©是語義分割的結果,由於邊界像素部分相連,將3個文本實例誤認爲1個實例。
(d)是我們提出的PSENet的結果,它成功地區分和檢測了4個獨特的文本實例。

The motivations of the progressive scale expansion are mainly of four folds. Firstly, the kernels with minimal scales are quite easy to be separated as their boundaries are far away from each other. Therefore, it overcomes the major drawbacks of the previous segmentation-based methods; Secondly, the largest kernels or the complete areas of text instances are indispensable for achieving the final precise detections; Thirdly, the kernels are gradually growing from small to large scales, and thus the smoonth surpervisions would make the networks much easier to learn; Finally, the progressive scale expansion algorithm ensures the accurate locations of text instances as their boundaries are expanded in a careful and gradual manner.
漸進的比例擴張的動因主要有四方面:
首先,最小尺度的核由於邊界距離較遠,很容易被分離。因此,它克服了以往基於分段的方法的主要缺點;
其次,最大的內核或完整的文本實例區域對於實現最終的精確檢測是必不可少的;
第三,網絡的核逐漸從小尺度向大尺度發展,因此,smoonth超視域使得網絡的學習更加容易;
最後,漸進比例擴張算法保證了文本實例的精確位置,因爲文本實例的邊界被小心而漸進地擴展。

To show the effectiveness of our proposed PSENet, we conduct extensive experiments on three competitive benchmark datasets including ICDAR 2015 [13], ICDAR 2017 MLT [27] and SCUTCTW1500 [18]. Among these datasets, SCUT-CTW1500 is explicitly designed for curve text detection, and on this dataset we surpass the previous state-of-the-art result by absolute 6.37%. Furthermore, the proposed PSENet achieves better or at least comparable performance on the ordinary quadrangular text datasets: ICDAR 2015 and ICDAR 2017 MLT, when compared with the existing state-of-the-art methods.

爲了證明我們提出的PSENet的有效性,我們對ICDAR 2015[13]、ICDAR 2017 MLT[27]和SCUTCTW1500[18]三個具有競爭力的基準數據集進行了廣泛的實驗。在這些數據集中,SCUT-CTW1500是專門爲曲線文本檢測而設計的,在該數據集上,我們以絕對6.37%的優勢超過了之前的最先進的結果。此外,與現有的最先進的方法相比,本文提出的PSENet在普通四邊形文本數據集ICDAR 2015和ICDAR 2017 MLT上實現了更好的性能,或者至少可以與之媲美。
The main contributions of this paper are as follows:

  • We propose a novel Progressive Scale Expansion Network (PSENet) which can precisely detecttext instances with arbitrary shapes.
  • We propose a progressive scale expansion algorithm which is able to accurately separate the textinstances standing closely to each other.
  • Our proposed PSENet significantly surpasses the state-of-the-art methods on the curve text detectiondataset SCUT-CTW1500. Furthermore, it also achieves competitive results on the regular quadrangular text benchmarks: ICDAR 2015 and ICDAR 2017 MLT.

該文章主要貢獻如下:

  • 提出了一種新型的漸進比例擴張網絡(PSENet),它可以精確地檢測任意形狀的文本實例。
  • 提出了一種漸進比例擴張算法,該算法能夠準確地分離相鄰的文本實例
  • 我們提出的PSENet算法明顯超過了SCUT-CTW1500曲線文本檢測數據集的最新方法。在常規四邊形文本基準上:ICDAR 2015和ICDAR 2017 MLT也取得了比較好的結果。

2 Related Work

Text detection has been an active research topics in computer vision for a long period of time. [15, 29] successfully adopted the pipelines of object detection into text detection and obtained good performance on horizontal text detection. After that, [8, 9, 12, 17, 23, 30] took the orientation of text line into consideration and made it possible to detect arbitrary-oriented text instances. Recently,[19] utilized corner localization to find suitable irregular quadrangles for text instances. The detection manners are evolving from horizontal rectangle to rotated rectangle and further to irregular quadrangle. However, besides the quadrangular shape, there are many other shapes of text instances in natural scene. Therefore, some researches began to explore curve text detection and obtained certain results. [18] tried to regress the relative positions for the points of a 14-sided polygon. [31] detected curve text by locating two end points in the sliding line which slides both horizontally and vertically. A fused detector was proposed in [1] based on bounding box regression and semantic segmentation. However, since their current performances are not very satisfied, there is still a large space for promotion in curve text detection, and the detectors for arbitrary-shaped texts still need more explorations.

文本檢測一直是計算機視覺領域的一個活躍研究課題。[15,29]成功地將目標檢測應用到文本檢測中,在水平文本檢測中取得了良好的性能。之後,[8、9、12、17、23、30]考慮了文本行方向,使得檢測任意方向的文本實例成爲可能。最近,[19]利用角定位爲文本實例找到合適的不規則四邊形。檢測方式由水平矩形演變爲旋轉矩形,進而演變爲不規則四邊形。然而,在自然場景中,除了四邊形外,還有許多其他形狀的文本實例。因此,一些研究開始探索曲線文本檢測,並取得了一定的成果。[18]試圖還原一個14邊多邊形各點的相對位置。[31]通過在水平和垂直滑動的滑動線上定位兩個端點來檢測曲線文本。提出了一種基於邊界盒迴歸和語義分割的[1]融合檢測器。但是,由於它們目前的性能還不是很理想,曲線文本檢測還有很大的提升空間,任意形狀文本的檢測器還需要進一步的探索。

3 Proposed Method

In this section, we first introduce the overall pipeline of the proposed Progressive Scale Expansion Network (PSENet). Next, we present the details of progressive scale expansion algorithm, and show how it can effectively distinguish the adjacent text instances. Further, the way of generating label and the design of loss function are introduced. At last, we describe the implementation details of PSENet.
在本節中,我們首先介紹所提議的漸進比例擴張網絡(PSENet)的總體結構。接下來,我們詳細介紹了漸進式比例擴張算法,並展示了它如何有效地區分相鄰的文本實例。進一步介紹了標籤的生成方法和損失函數的設計。最後介紹了PSENet的實現細節。

3.1 Overall Pipeline

在這裏插入圖片描述
我們總體結果的說明。左邊的部分是由FPN[16]實現的。右側爲特徵融合和逐步尺度擴展算法。
有關FPN:
https://blog.csdn.net/u014380165/article/details/72890275
https://blog.csdn.net/quincuntial/article/details/80152314

3.1 Overall Pipeline

在這裏插入圖片描述
所提出的PSENet的總體結構如圖2所示。受FPN[16]的啓發,我們將低級特徵映射與高級特徵映射連接起來,從而得到了四個級聯的特徵映射。這些映射在F中進一步融合爲了編碼各種接受視圖的信息。直觀地說,這種融合很可能促進具有不同規模的內核的生成。然後將特徵圖F投影到n個分支中,得到多個分割結果S1;S2;:::;Sn。每個Si都是在一定範圍內所有文本實例的一個分割掩碼。不同分割掩模的尺度由超參數決定,超參數將在第3.3節中討論。在這些掩碼中,S1給出了尺度最小的文本實例的分割結果,最小核數),Sn表示原始分割掩碼(即最大內核)。在得到這些分割掩碼後,我們使用漸進尺度展開算法將S1中的所有實例內核逐步展開到Sn中的完整形狀,最終得到的檢測結果爲R。

3.2 Progressive Scale Expansion Algorithm

在這裏插入圖片描述
圖3:逐步縮放算法的實現過程。CC是指查找連接組件的功能。EX表示尺度展開算法。
(a)、(e)和(f)分別爲S1、S2和S3。(b)爲初始連接組件。
©和(d)是擴張的結果。(g)顯示擴展的說明。(g)中的紅色框表示衝突像素。

在這裏插入圖片描述
在這裏插入圖片描述
如圖1 ©所示,基於分段的方法很難將相鄰的文本實例分離出來。爲了解決這一問題,我們提出了漸進尺度展開算法。下面是一個生動的例子(見圖3),它解釋了遞進尺度展開算法的過程,其核心思想來自廣度優先搜索(BFS)算法。在例子中,我們有3個分割結果S = S1;S2;S3g(見圖3 (a), (e), (f))。首先,基於最小核映射S1(見圖3 (a)), 4個不同的連通分量C = c1;c2;c3;c4可以被找到,作爲初始化。圖3 (b)中不同顏色的區域分別表示這些不同的連通分量。到目前爲止,我們已經擁有了所有文本實例的中心部分(即,最小內核)檢測到。然後,我們通過合併S2和S3中的像素逐步擴展檢測到的內核。兩種尺度展開的結果分別如圖3 ©和圖3 (d)所示。最後,我們提取圖3 (d)中不同顏色標記的連接組件作爲文本實例的最終預測。

在這裏插入圖片描述
漸進的比例擴張如圖3 (g)所示,擴張基於廣度優先搜索算法,該算法從多個內核的像素開始,迭代地合併相鄰文本像素。注意,在展開過程中可能會出現像素衝突,如圖3 (g)中的紅色框所示。在我們的實踐中,處理衝突的原則是,在先到先得的基礎上,混淆的像素只能被一個單一的內核合併。由於採用了漸進的擴展過程,這些邊界衝突不會影響最終的檢測和性能。算法1總結了尺度展開算法的具體內容。僞碼中,T;P是中間結果。Q是一個隊列。Neighbor(.)表示p的相鄰像素。GroupByLabel(.)是按標籤對中間結果進行分組的函數。Si[q] = True表示Si中像素q的預測值屬於文本部分。

在這裏插入圖片描述

需要 Kernels: C, Segmentation Result(分割結果): Si
保證: Scale Expanded Kernels(比例擴張內核): E
在這裏插入圖片描述

1: function EXPANSION(C, Si) 尺度擴張函數
2: T(中間結果) P(中間結果) Q (隊列) 置空
3: for循環:對於每一個ci屬於C(Kernels)
4: T =T ∪{f符合(p,label)屬於ci的像素,標籤)}
P =P ∪{符合(像素,標籤)屬於ci的像素}
5: Enqueue(Q; ci) // 所有 ci中元素 進入隊列 Q
6: 結束for循環 end for
7: while當 Q 不爲空 do
8: (p; label) =Q中所有元素出隊列
9: if 存在q 屬於Neighbor§ 並且 q 不屬於P and Si[q] = True(Si[q] = True表示Si中像 素q的預測值屬於文本部分。)then
10: T =T ∪{(像素,標籤)屬於ci}
P =P ∪{q}
11: Enqueue(Q; (q; label)) // (q; label) 進去隊列 Q
12: end if
13: end while
14: E = GroupByLabel(T) 按標籤對中間結果進行分組
15: return E
16: end function

3.3 Label Generation

在這裏插入圖片描述
收縮 填充
圖4:標籤生成的說明。
(a)包含d、pi和pn的註釋。
(b)顯示原始文本實例。
©顯示不同核尺度的分割掩碼。

在這裏插入圖片描述
如圖2所示,PSENet產生分割結果(如S1;S2;:::;Sn)具有不同的核尺度。因此,在訓練過程中也需要不同核尺度下的真實值(ground truths)。在我們的實踐中,通過收縮原始文本實例,可以簡單而有效地執行這些基本真值標籤。圖4 (b)中帶藍色邊框的多邊形表示原始文本實例,對應的是最大的分割標籤掩碼(見圖4 ©中最右邊的圖)。爲了得到圖4 ©中依次縮小的掩模,我們利用Vatti裁剪算法[28]將原始多邊形pn縮小di像素,得到縮小後的多邊形pi(見圖4 (a))。然後,將每個收縮後的多邊形pi轉換成一個0/1的二進制掩碼,用於分割標籤ground truth。我們將這些地面真值圖表示爲G1;G2;:::;Gn。從數學上講,如果我們將比例考慮爲ri,則pn與pi之間的邊際di可以計算爲
在這裏插入圖片描述
比例ri Area計算面積 Perimeter計算周長
在這裏插入圖片描述
m是最小的比例,值在[0,1]
比例的數值(即r1;r2;:::;rn)由兩個超參數n和m決定,它們從m線性增加到1。

3.4 Loss Function

在這裏插入圖片描述
在這裏插入圖片描述

學習PSENet,損失函數可以表示爲:
在這裏插入圖片描述
Lc Ls分別表示完整文本實例和收縮文本實例的損失
拉姆達平衡了Lc Ls的重要性

通常情況下文本實例通常只佔極小的區域,這使得當使用二進制交叉熵[2]時,預測網絡對非文本區域的偏倚。受[20]的啓發,我們在實驗中採用了骰子係數。骰子係數D(Si;Gi)在公式4。

在這裏插入圖片描述
Si,x,y 像素(x,y)在分割結果Si中的值
Gi,x,y 像素(x,y)在真實值Gi中的值
此外,還有許多類似於文本筆畫的模式,如fences、lattices,等。因此,爲了更好地區分這些模式,我們在訓練過程中採用了Online Hard Example Mining (OHEM) [[24]到Lc。

Lc主要對文本和非文本區域進行分割。讓我們考慮一下由OHEM是M,因此Lc可以寫成

在這裏插入圖片描述
Ls是收縮文本實例的損失。由於它們被完整文本實例的原始區域所包圍,爲了避免一定的冗餘,我們忽略了分割結果Sn中非文本區域的像素。因此,Ls可以表述爲
在這裏插入圖片描述
這裏,W是一個掩碼,它忽略了Sn中非文本區域的像素,Sn;x;y表示像素(x,y)在Sn中的值

3.5 Implementation Details

在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章