論文閱讀 CVPR 2019 — Deformable ConvNets v2: More Deformable, Better Results

該論文以 Deformable ConvNets v1 為基礎,擴展其 Deformable convolution layer 的數量,並加入調幅機制 ( Modulation mechanism ) 進行改良,再進一步以 Feature mimicking 的手法改善其準確度,使神經網路具備更強大的變形能力。

Ken Huang
人工智慧,倒底有多智慧?
10 min readOct 16, 2021

--

論文連結:
《 Deformable ConvNets v2 : More Deformable, Better Results 》

作者:

Zhu, Xizhou, et al. “Deformable convnets v2: More deformable, better results.” Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2019.

Introduction

在物件辨識與偵測任務上,幾何物體會有比例 、姿勢、視角和部份變形等情況的多樣性,是該任務的主要挑戰。

目前 SOTA 的作法是採用 Deformable Convolutional Networks ( DCNv1 ) 作為解決之道。主要是利用 Deformable convolution & Deformable RoIpooling 等模組,使模型可以去適應/擬合物件的結構,並提昇整體的準確度。

為理解這個 Deformable ConvNets,作者們在 PASCAL VOC 和 COCO 等資料集上,對視野域的變化進行可視化做觀察,並發現其覆蓋情況有超過物件的現象,並認為應該有更優的作法。

而該論文的主要目標是提出比 DCNv1 擁有更強 Deformable convolution 學習能力的 Deformable ConvNets v2 ( DCNv2 ),作法上有 2 個特色:

  1. 拓展整體架構上使用 Deformable convolution layer 的數量,使採樣的範圍可以更廣。
  2. 調幅機制 ( Modulation mechanism ) 可使模型不僅學習到偏移量,也會根據學到的特徵振幅 ( Amplitude ) 做調整。

上述的改良會使模型有能力在空間分佈與樣本間的相互影響關係更多樣。

Analysis of Deformable ConvNet Behavior

前述提及可視化分析一共有 3 種不同的方式:

  1. Effective receptive fields:
    根據 Gradient 計算視野域內不同位置上的響應強度,檢視不同像素對神經網路節點的影響
  2. Effective sampling locations:
    將採樣的 Location 結合 Gradient 資訊分析每個地方的所貢獻的強度
  3. Error-bounded saliency regions:
    參考近期 Image saliency 的相關研究,設定 Error bound 觀察神經網路節點 Support 的區域

這分析的 Baseline 是 Faster R-CNN + ResNet50 ( with aligned RoIpooling ),資料集是用 COCO,相關的可視化結果如下:( 各組內由上自下是前述的 2. 、1. 和 3. )

Zhu, Xizhou, et al. “Deformable convnets v2: More deformable, better results.” Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2019. Figure 1 (a).

一般的 Convolution 可根據 Image content 改變重現時的強度,並同時學到一些幾何上的變化。

Zhu, Xizhou, et al. “Deformable convnets v2: More deformable, better results.” Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2019. Figure 1 (b).
Zhu, Xizhou, et al. “Deformable convnets v2: More deformable, better results.” Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2019. Figure 1 (c).

而 Deformable convolution 可以更好地適應 Image content,將注意力聚焦在前景的物件上,適應物件的幾何特徵,並幫助模型做出更好的判斷。

More Deformable ConvNets

該論文改良的作法主要分為以下 2 個方向:

1. Stacking More Deformable Conv Layers

DCN 在 v1 的時候,基本上是以 ResNet-50 為基礎,並在 conv5 的 Stage 替換一般的 Convolution 為 Deformable convolution。

而該論文的作法則是在 conv3、conv4、conv5 都做替換,藉此增強模型作到 Deformable convolution 的能力。

2. Modulated Deformable Modules

另一個強化 DCN 的方法是調幅機制 ( Modulation mechanism ),這使 Deformable convolution 除了學會偏移量 ( Offset )之外,還能在不同位置上調整特徵的振幅 ( Amplitudes ) 。對應的公式如下:

K 表示採樣的地方;w_k 表示權重;p_k 表示偏移量;x(p) 是輸入特徵圖 x 上的位置 p;y(p) 則是對應位置 p 的輸出。

其中的 ∆p_k 和 ∆m_k 是學習出來的偏移量 ( Offset ) 調幅純量 ( Modulation scalar ) 。而 RoIpooling 也有類似的設計:

R-CNN Feature Mimicking

Zhu, Xizhou, et al. “Deformable convnets v2: More deformable, better results.” Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2019. Figure 2.

該論文也觀察了 per-RoI detection head 的狀態,並發現在 RoI 之外的 Image content 可能會影響特徵抽取的過程,並干擾最終預測結果。

作者們參考了相關的 Feature mimicking 論文,並採用下方的訓練架構:

Zhu, Xizhou, et al. “Deformable convnets v2: More deformable, better results.” Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2019. Figure 3.

由於 R-CNN 學出的特徵會更專注在物件上,作者們善用 Cosine similarity 定義出 Mimic loss:

fRCNN(b) 和 fFRCNN(b) 分別是經過不同 R-CNN 和 Faster R-CNN 的特徵重現﹔cos( ) 就是 Cosine similarity。

讓模型在訓練過程可以有 R-CNN 的成效,但在推論的時候仍只用 Faster R-CNN 的部份,所以並不會造成額外運算量。

Experiments

該論文的實驗採用 COCO 2017 資料集,Baseline 是選用 Faster R-CNN 和 Mask R-CNN,Backbone 是在 ImageNet 上預訓練過的 ResNet-50 。

Enriched Deformation Modeling

相比於 Baseline ,該論文的改法可以接近的運算成本提升準確度,而加入調幅機制 ( Modulation mechanism ) 則可使其成效更進一步的提升。

R-CNN Feature Mimicking

Zhu, Xizhou, et al. “Deformable convnets v2: More deformable, better results.” Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2019. Table 2.

這邊的 FG、BG 指的是 ForeGround & BackGround,而只針對 FG 進行 Feature mimicking 是比要有效的。

Application on Stronger Backbones

另外該論文也有將 Backbone 換成更深的 ResNet-101 和 ResNext-101:

Zhu, Xizhou, et al. “Deformable convnets v2: More deformable, better results.” Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2019. Table 3.

結果就是改善的幅度有更明顯。

--

--

Ken Huang
人工智慧,倒底有多智慧?

在網路上自學的過程中,體會到開放式資源的美好,希望藉由撰寫文章記錄研究所的學習過程,同時作為回饋網路世界的一種方式。Email : kenhuang2019iii@gmail.com ,如果有任何問題都歡迎與我聯繫。