ACMMM2016_UnitBox

ACMMM2016_UnitBox

來自專欄人臉檢測4 人贊了文章

曠視科技2016-08的一篇目標檢測文章,在fddb上stoa;

spotlight:

1 提出了iou loss,將bbox四個頂點的回歸統一成一個iou loss unit,比基於l2 loss的四個頂點獨立回歸在準確率上更加好,收斂也更快;

2 提出了unitbox,基於iou loss,在FDDB上得到了stoa;

3 通過iou loss,unitbox在多尺度圖像上訓練,測試時只需要single-scale image one pass;

不足:

1 訓練輸入為三個同原圖尺度的圖像,雖然confidence score heatmap與bbox heatmap可以根據gt方便生成,但對比目標檢測僅需要原圖+gt bbox,也是挺麻煩的;

2 unitbox並未強調自己僅僅一個人臉檢測器,而是通用目標檢測器,但沒有在pascal voc等數據集上測試效果;

3 論文中還是有很多細節講的不清楚,自己也有很多沒了解的細節,因為沒公布源碼,所以也沒法知道答案;

ABSTRACT

我們提出了iou loss,對比傳統bbox L2 loss將bbox坐標獨立預測,我們將bbox預測作為一個整體(introduce a novel Intersection over Union (IoU) loss function for bounding box prediction, which regresses the four bounds of a predicted box as a whole unit);基於iou loss和全卷積網路(deep fully convolutional networks),我們提出了unitbox,在應對目標尺度和外觀變化表現出了較好的魯棒性,且收斂快( shows robust to objects of varied shapes and scales, and converges fast);unitbox在fddb上sota til 2016.08

1. INTRODUCTION

目標檢測一般分兩步:

1 定位目標---object localization (where the object is);

2 目標框分類識別;---visual recognition (what the object looks like)

現階段目標檢測分三步:

step1:從圖像中獲取region proposals;(region proposals are extracted as object candidates from a given image)

step2:proposals過CNN提特徵,用於識別(objectness)和分類( categorization)

step3:將step1、2提出並篩選的剩餘bbox做更精細的bbox坐標回歸;

以上三步驟,step1提proposal成為了一個瓶頸:早期的ss、edgebox等方法採用目標的低層語義信息,不夠魯棒,而且一般基於滑窗或過分割,好事比較大;

frcnn通過採用rpn提proposals,避免了上述弊端(RPN is trained to predict the bounding boxes of object candidates from the anchor boxes),但rpn中anchor的長寬比、尺度是預定義且不會改變的,對小目標和外形、尺度變化較大的目標性能一般;

densebox使用feature map上每個像素與bbox四條邊的L2距離來回歸一個4維向量,如fig 1(DenseBox utilizes every pixel of the feature map to regress a 4-D distance vector ---- the distances between the current pixel and the four bounds of object candidate containing it),弊端有兩個:1 基於L2 loss,將四個邊框距離的回歸作為四個獨立的坐標回歸;2 densebox訓練是使用固定單尺度,預測時,需要使用圖像金字塔,耗時大;

本文提出了unitbox,基於全卷積網路架構,同時預測bbox坐標和在feature map上直接對每個像素預測分類(It adopts a fully convolutional network architecture, to predict the object bounds as well as the pixel-wise classication scores on the feature maps directly);

unitbox基於iou loss做bbox預測,iou loss確保pred bbox與gt box達到maximal overlap,將bbox回歸作為一個整體(fig 1,The IoU loss directly enforces the maximal overlap between the predicted bounding box and the ground truth, and jointly regress all the bound variables as a whole unit )

優點:預測bbox更准,訓練更快收斂,能handle更大的尺度一變化,一次單尺度前向就可以達到很好的效果(UnitBox is enabled with variable-scale training. It implies the capability to localize objects in arbitrary shapes and scales, and to perform more efficient testing by just one pass on singe scale);

2. IOU LOSS LAYER

介紹unitbox前,先介紹iou loss;

這裡對gt bbox邊框與每個像素距離組成的4維向量作了一個定義,是每個像素點位置到gt bbox四個邊界的相對距離,跟我們在目標檢測裡面的定義有點差異;

2.1 L2 Loss Layer

對L2 loss的定義,但其實fast rcnn、faster rcnn都是基於L1 loss的;

L2 loss兩個弊端:

1 L2 loss對bbox四個坐標的預測是彼此間獨立的,與常識不符;(in L2 loss, the coordinates of a bounding box (in the form of xt, xb, xl, xr) are optimized as four independent variables. This assumption violates the fact that the bounds of an object are highly correlated),這樣會造成pred bbox的某幾個坐標預測得準確,整體bbox卻不準確;如fig 5;

2 L2 loss對bbox的坐標沒有做正則化,導致對大目標的檢測效果會比小目標好(given two pixels, one falls in a larger bounding box while the other falls in a smaller one, the former will have a larger effect on the penalty than the latter, since the L2 loss is unnormalized. This unbalance results in that the CNNs focus more on larger objects while ignore smaller ones. );

提到了densebox,Densebox通過訓練階段固定輸入圖像patches的尺度,可以達到正則化L2 loss的目的(因為都變成同一個尺度了,相當於做了正則化處理),但在預測階段卻需要處理多尺度的圖像金字塔,耗時就大了;

2.2 IoU Loss Layer:Forward

直接講了iou loss的定義:

PS:算IOU的方式很獨特,可以結合fig 1算一下;

x~:對於一個像素(i,j),必須落在一個有效的object bbox里,才會進一步計算iou loss,那麼此有效的object bbox指gt bbox還是pred bbox?我覺得是gt bbox;

因為0 < iou < 1,所以L = -ln(iou)本質上是對輸入iou的交叉熵損失:可以將iou當做從伯努利分布中的隨機採樣,且p(IoU = 1) = 1;那麼iou的交叉熵損失可表示為: L = -pln(IoU) - (1 - p)ln(1 - IoU) = -ln(IoU);---- 我看的略微有點迷糊,希望大神進一步講解

優點:

1 L2 loss將四個坐標分開獨立優化,iou loss將bbox的優化變為一個整體,因此可以得到更準確的bbox prediction;

2 正因為0 < iou < 1,忽略了每個bbox的尺度,因此可以訓練時就不用crop各種patch將尺度歸一化,直接使用原圖 or multi-scale訓練都可,模型就已經掌握了處理多尺度的能力,預測階段就只需要在單尺度圖像上完成即可;

2.3 IoU Loss Layer: Backward

公式也不算很難,我就直接貼圖了:

對照Algorithm1,很容易推導(3)、(4)、(5)、(6);

公式7也ok;

公式(3)、(4)希望predict bbox預測得盡量小(其實不應該翻譯成小,應該是盡量與gt bbox匹配)

公式(5)、(6)希望pred bbox與gt iou越大越好,整體上就可以對目標函數做更好的優化;最小化IoU loss,相當於最大化intersection area以及predicted box儘可能適配的ground truth

3. UNITBOX NETWORK

基於iou loss,我們提出了unitbox:一個pixel-wise的目標檢測網路;如fig 2;

unitbox主幹網採用vgg16,去掉最後兩層全連接,使用兩個全卷積分支,分別用來預測pixel-wise bbox(fig 2分支下)、分類得分(fig 2分支上);---- we remove the vgg fc layers and add two branches of fully convolutional layers to predict the pixel-wise bounding boxes and classication scores, respectively;

訓練:unitbox需要三個同樣大小的輸入(In training, UnitBox is fed with three inputs in the same size):

1 原圖(the original image);

2 置信熱度圖,用於表徵每個像素是否在gt bbox之內(the confidence heatmap inferring a pixel falls in a target object (positive) or not (negative));

3 bbox熱度圖,用於表徵每個落入gt bbox內像素到gt bbox邊框距離(the bounding box heatmaps inferring the ground truth boxes at all positive pixels.);----我是根據fig 2這麼翻譯的,沒法理解引文到底是個什麼意思;

對於fig 2分支上,分類得分(也即是否是人臉的分類置信得分),在vgg stage4的512channel上連接三個層:

layer1:512 x 3 x 3 x 1,stride=1,將feature map變為channel=1;

layer2:一個線性插值的上採樣layer2,將layer1 feature map縮放成原始圖像尺度;

layer3:一個crop layer3將feature map與原始圖像對齊(因為有卷積、pooling、padding等操作;layer2上採樣不一定能確保feature map與原始圖像size完全一致);

經過以上操作,得到一個與原始圖像尺度一致的1-channel feature map,然後使用sigmoid交叉熵損失來回歸生成的置信熱度圖;---- sigmoid cross-entropy loss to regress the generated condence heatmap;

對於fig 2分支下,為預測bbox heatmap,我們在vgg stage-5使用類似的三層堆疊操作,不同之處在於layer1:512 x 3 x 3 x 4,stride=1,relu確保預測的bbox熱度圖非負;進而通過使用iou loss做邊框回歸;

分支上、下的兩個loss通過加權平均做最後的優化;

unitbox要點

1 unitbox中,confidence score的預測分支在vgg stage4之後,bbox坐標的預測分支在vgg stage5之後;這樣做的原因是因為作為一個iou loss unit,bbox回歸預測比confidence score預測需要更大的感受野;直覺上,bbox預測依賴於confidence score熱度圖,因此通過從confidence score熱度圖上獲取可以預測的bbox坐標,可以將bbox分支預測視為自底向上的路子;(the bounding boxes of objects could be predicted from the condence heatmap. In this way, the bounding box branch could be regarded as a bottom-up strategy, abstracting the bounding boxes from the condence heatmap;)-----沒懂講的是什麼;

2 unitbox比densebox快,10+FPS;

3 fig 2中置信度得分和bbox坐標預測共享了部分卷積層(stage1-3),如果彼此間不共享權重,完全分開訓練,性能會更好;(無實驗無真相)

有了confidence和bbox熱度圖,以人臉檢測為例:基於confidence score熱度圖,設置一個閾值篩選判定為有人臉的像素;再在每個像素上通過一個中心點為該像素的橢圓匹配之,進一步求取這些像素的bbox;(firstly we fit the faces by ellipses on the thresholded confidence heatmaps. Since the face ellipses are too coarse to localize objects, we further select the center pixels of these coarse face ellipses and extract the corresponding bounding boxes from these selected pixels. )----有很多不明白之處:

1 橢圓大小如何確定?不同人臉大小不一,如何選擇一個普適的初始化橢圓大小?還是根據bbox heatmap尋找對應pixel的bbox坐標作為橢圓橫縱軸?如果是,既然都有了bbox了,那還要橢圓幹什麼?

2 confidence heatmap上肯定有多個像素的置信度高於閾值,不需要進一步做NMS去除冗餘bbox么?

雖然操作簡單,但bbox定位相當之準確,如fig 3:

4. EXPERIMENTS

基於imagenet上預訓練的vgg16在wider face上做finetune,lr特別低,10 - 8,非常小,無數據增強操作;

4.1 Effectiveness of IoU Loss

fig 4(a) unitbox-L2指的是使用L2 loss進行訓練(lr更小,10 -13),可以發現unitbox(使用iou loss)不僅訓練更快收斂(fig4(a)中迭代次數更少),而且miss rate更低(fig4(a)藍色線);fig4(b)中,fddb的roc曲線上,unitbox表現也更好;

在尺度變化較大的圖像上測試(fig5,60~960 pixel,圖像金字塔),可以得到以下結論:

1 L2 loss處理尺度尺度變化上效果沒有iou loss好;

2 L2 loss可以預測部分坐標準確,但因為坐標預測是獨立進行,很難全部準確;iou loss卻可以很好的解決該問題;

3 在960pixel image上,L2 loss預測人臉失敗,但unitbox卻表現非常好;

4.2 Performance of UnitBox

fig 6 unitbox通過fig 2中兩個分支不共享參數地分開訓練(train an unshared UnitBox detector to further improve the detection performance,實驗的真相),取得了sota,且在VGA解析度的圖像上達到了12fps;

5. CONCLUSIONS

1 提出了iou loss用於bbox預測,iou loss將目標候選框的bbox回歸預測作為一個整體,而非四個坐標分開預測(the IoU loss layer regresses the bounding box of an object candidate as a whole unit, rather than four independent variables);

2 unitbox不僅預測更準確,而且收斂也快;

3 基於iou loss的unitbox在fddb上取得了stoa;

論文參考

1 ACMMM2016_UnitBox:An Advanced Object Detection Network

總結,很多細節不是很清晰,以下引用自CSDN:blog.csdn.net/zimenglan

問題:

1 IoU loss需要對four coordinates進行歸一化么?還是直接回歸真實坐標?----據我的理解,應該該是真實坐標;

2 訓練測試時的輸入大小是多少?----需要看源碼才行了,paper里沒說;

3 IoU loss適合圖像只有很少物體的情況么,如<2?----同疑問,如果多個gt bbox相交,confidence score heatmap和bbox heatmap中per-pixel值需要累加嗎?如果累加了,那又如何區分是per-pixel像素值是對應的哪個gt bbox呢?

4 IoU loos可以擴展多多類上么(論文里只有bg和face)?----同疑問,沒有pascal voc、coco等數據集上的評估;

5 測試時,speed的瓶頸是哪部分?----感覺網路其實還是比較淺的,因為沒有rpn,也不需要圖像金字塔,不知道慢在哪,跟原始圖像size有關係?

6 對於cls-net和det-net,可以多接幾個層么?----應該可以吧,性能就不知道如何了;

7 在生成ground truth 的confidence map和coordinate maps時,怎麼處理overlap的ground truths?-----同問題三,十分疑惑;


推薦閱讀:

TAG:計算機視覺 | 深度學習DeepLearning | Face曠視科技 |