[論文筆記] Faster R-CNN


Posted by Ivan Fang on 2021-06-17

Paper Information

Introduction

  • 現今的 object detector 都是先用 region proposal method 提出 region 後,在用 region-based CNN 去預測 bounding box 與 object class。然而,region proposal method 常常成為 object detector 的效能瓶頸。例如 R-CNN 中的 Selective Search 處理一張圖片就要花上 2 秒,與 real-time 的目標相差甚遠。
  • 因此,作者提出 Region Proposal Networks (RPN) 來當作 region proposal method。RPN 的輸入為 region-based CNN 的 feature maps,輸出為 objectness scores 與 object proposals。也就是說 region-based CNN 與 region proposal method 共享同一份 feature maps。
  • RPN 是一個 fully convolutional networks (FCN) 並且可以 end-to-end 的訓練。
  • 有了 RPN,region proposal 的時間可以從 Selective Search 的 2 秒降到 10 毫秒。

Faster R-CNN

  • 如 Figure 2 所示,Faster R-CNN 由 RPN 與 classifier (Fast R-CNN) 兩部分組成。RPN 掃過 image 後,會產生多個 region proposals,然後在根據 region proposals 切出對應的 feature maps 的部份。最後將切出的 feature maps 丟進 Fast R-CNN 做最後的處理,提出 bounding boxes。

  • RPN 架構如 Figure A 所示。在這篇論文中,作者選用了 ZF-Net (與 VGG-16) 作為 RPN 中的 CNN 網路。

    • image 經過 ZF-Net 後,會得到 $13 \times 13 \times 256$ 的 feature maps。
    • 再將這個 feature maps 經過一層 $3 \times 3$ 的 conv. layer,一樣得到 $13 \times 13 \times 256$ 的 feature maps。
    • 最後將 feature maps 分別送入兩個 $1 \times 1$ 的 conv. layer,cls. layer 與 reg. layer。
      • cls. layer 用於分類該 grid 上有無 object。reg. layer 用於回歸 region proposal 的中心座標、寬高 $(x, y, w, h)$。
      • cls. layer 的 filter 數為 $2K$。reg. layer 的 filter 數為 $4K$。
      • $K$ 表示每個 grid 上的 anchor 數。 Figure A: RPN 架構圖。
  • 總共用了 9 種 anchor box ($K = 9$):

    • 3 scales:128、256、512 pixels
    • 3 rations:(1:1)、(2:1)、(1:2)
  • 此外,作者還實驗了不同組合的 anchor box 的效能,如 Table 8 所示。

  • Loss Function of RPN:
    $$
    L({p_i}, {t_i}) = \frac{1}{N_{cls}} \sum_{i} L_{cls}(p_i, p_{i}^{*}) + \lambda \frac{1}{N_{reg}} \sum_{i} p_{i}^{*} L_{reg}(t_i, t_{i}^{*})
    $$

    • $i$:index of an anchor in a mini-batch。
    • $p_i$:第 $i$ 個 anchor box 偵測該 grid 上有物件的機率。
    • $p_{i}^{*}$:第 $i$ 個 anchor box 所在的 grid 上是否有物件。有則 $p_{i}^{*}=1$,否則 $p_{i}^{*}=0$。
    • $t_i$:第 $i$ 個 anchor box 的 $(x, y, w, h)$ 的預測偏誤。
    • $t_i^*$:第 $i$ 個 anchor box 的 $(x, y, w, h)$ 的真實偏誤。
    • $N_{cls}$:mini-batch size
    • $N_{reg}$:number of anchor locations
    • $\lambda$:balancing parameter,這裡設 10。
  • bounding box regression 中 4 個參數的定義如下:
    • $x, x_a, x^*$:predicted box、anchor box、ground truth box。
    • $y, w, h$ 的定義同上
  • $L_{reg}$ 的定義如下 (smooth L1):

  • Faster R-CNN 的訓練方式:

    1. 單獨訓練 RPN (CNN 有先預訓練在 ImageNet 上)。
    2. 利用 RPN 提出的 proposal 單獨訓練 Fast R-CNN (CNN 有先預訓練在 ImageNet 上)。
    3. 固定 Fast R-CNN 的 weights 訓練 RPN。
    4. 固定 RPN 的 weights 訓練 Fast R-CNN。

Experiments & Results

  • Faster R-CNN 在 Pascal VOC 2007 的訓練結果如 Table 2 所示。

My Point of View

雖然 Faster R-CNN 是在 2015 年提出,距今 (2020) 也有 5 年的時間了,但還是有很多人在用。例如 MCAN (2019 VQA Challange Winner)。可見 Faster R-CNN 非常重要。


#cv #Object Detection







Related Posts

MTR04_0714

MTR04_0714

Is the End of Data Analysis Near? The Impact of Code Interpreter, the New Feature of GPT-4

Is the End of Data Analysis Near? The Impact of Code Interpreter, the New Feature of GPT-4

Custom Hook 來自己寫一個  hook 吧!

Custom Hook 來自己寫一個 hook 吧!


Comments