1. 程式人生 > >商湯提出解偶檢測中分類和定位分支的新方法TSD,COCO 51.2mAP | CVPR 2020

商湯提出解偶檢測中分類和定位分支的新方法TSD,COCO 51.2mAP | CVPR 2020

> 目前很多研究表明目標檢測中的分類分支和定位分支存在較大的偏差,論文從sibling head改造入手,跳出常規的優化方向,提出TSD方法解決混合任務帶來的內在衝突,從主幹的proposal中學習不同的task-aware proposal,同時結合PC來保證TSD的效能,在COCO上達到了51.2mAP   來源:曉飛的演算法工程筆記 公眾號 **論文: Revisiting the Sibling Head in Object Detector** ![](https://upload-images.jianshu.io/upload_images/20428708-b0f0fdfc6afd4e19.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) * **論文地址:[https://arxiv.org/abs/2003.07540](https://arxiv.org/abs/2003.07540)** # Introduction *** ![](https://upload-images.jianshu.io/upload_images/20428708-eaff18dab1cee84f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)   經典RoI-based定位演算法使用sibling head(2-fc)對proposal同時進行分類和迴歸,由於任務的本質不同,分類任務和定位任務是完全不同的,關注的特徵也不一樣,如圖1所示。分類任務往往需要平移不變性,而定位任務則需要平移可變性。 ![](https://upload-images.jianshu.io/upload_images/20428708-2eeb46ca41a2f4b9.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)   具體屬性的表現如公式10所示,$\forall_{\varepsilon}, IoU(P+\varepsilon,\mathcal{B})\ge T$,$T$為IoU閾值,$f$為共用的特徵提取器。因此,共用的特徵提取器以及相同的proposal都是目標檢測學習的主要障礙。   與以往的方法不同,論文觀察到限制定位演算法的根本問題在於分類分支和定位分支在空間維度上存在偏差,不是通過設計特徵提取器或更好的結構能解決的。因此,論文提出TSD方法,從空間維度和特徵提取兩方面同時對分類任務和定位任務進行拆解,並且結合精心設計的漸進約束(PC)幫助學習。   論文的貢獻如下: * 深入探討RoI-based檢測演算法中混合任務帶來的障礙,並揭示限制檢測效能的瓶頸 * 提出TSD(task-aware spatial disentanglement)解決混合任務的衝突,能夠學習到task-specific特徵表達能力 * 提出PC(progressive constraint)來擴大TSD和sibling head間的效能間隔 * 在COCO和OpenImage上驗證了有效性,單模型最高可達51.2mAP # Methods *** ![](https://upload-images.jianshu.io/upload_images/20428708-95751b7fd394c3fa.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)   如圖2所示,在訓練時,TSD和原來的結構共存,定義主幹輸出的預測框為$P$,TSD輸出最終的定位結果$\hat{D}_r$和最終的分類結果$\hat{D}_c$,原sibling head輸出的結果為$D$,GT為$\mathcal{B}$,類別為$y$ ### TSD (task-aware spatial disentanglement) ![](https://upload-images.jianshu.io/upload_images/20428708-53e04b1c396398e5.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)   經典的Faster RCNN基於$P$同時最小化預測框的分類誤差和損失誤差,如公式1,$\mathcal{H}_1(\cdot)=\{f(\cdot),\mathcal{C}(\cdot)\}$,$\mathcal{H}_2(\cdot)=\{f(\cdot),\mathcal{R}(\cdot)\}$,$f(\cdot)$為特徵提取,$\mathcal{C}(\cdot)$和$\mathcal{H}(\cdot)$為分別從特徵進行分類和定位的預測函式。由於分類和定位所用到的特徵不太一樣,一些研究將特徵提取拆分為$f_c$和$f_r$,儘管這樣的拆分能帶來一些提升,但任務混合在空間上的內在衝突仍然潛在(分類和定位所需的bbox其實不一樣) ![](https://upload-images.jianshu.io/upload_images/20428708-1dad7fc7ed320c46.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)   為了解決這個潛在的問題,TSD直接在空間上對分類和定位進行分解,如公式2,從原預測框$P$中預測出分類框$\hat{P}_c = \tau_c(P, \Delta C)$以及定位框$\hat{P}_r = \tau_r(P, \Delta R)$,$\Delta C$為pointwise的形變,$\Delta R$為proposal-wise的變化,具體如圖2(b)所示。然後再通過不同的特徵提取和head進行分類和定位的預測,$\mathcal{H}_1^D(\cdot)=\{f_c(\cdot),\mathcal{C}(\cdot)\}$,$\mathcal{H}_2^D(\cdot)=\{f_r(\cdot),\mathcal{R}(\cdot)\}$。由於分解了分類和定位的預測區域,TSD能夠學習task-aware的特徵表達。 ### TSD learning ![](https://upload-images.jianshu.io/upload_images/20428708-b701884567ea33d2.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) ![](https://upload-images.jianshu.io/upload_images/20428708-6efb1e390476edc1.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)   對於定位,使用三層全連線$\mathcal{F}_r$來生成proposal-wise變化$\Delta R\in \mathbb{R}^{1\times 1\times 2}$用於將$P$轉換為$\hat{P}_r$,每層的輸出為$\{256, 256, 2\}$,$\gamma$為預設的調節標量。$\tau_r$的計算如公式4,即將$P$進行整體移動,新點的值使用雙線性插值計算,使得$\Delta R$可微。 ![](https://upload-images.jianshu.io/upload_images/20428708-219824a51163c0e0.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) ![](https://upload-images.jianshu.io/upload_images/20428708-17ab90198f971d41.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)   對於分類,將規則的$P$變形為不規則的$\hat{P}_c$,$\mathcal{F}_c$為三層全連線層,每層的輸出為$\{256, 256, k\times k\times 2\}$,為了減少引數,首層全連線與$\mathcal{F}_r$共用。$\Delta C\in \mathbb{R}^{k\times k\times 2}$為pointwise的x座標和y座標變化,$k\times k$為池化後特徵$\hat{F}_c$的大小,根據公式6使用$\Delta C$生成池化後的特徵圖$\hat{F}_c$,這裡的池化操作跟Deformable Convolution的一樣。$|G(x,y)|$為畫素總數,具體大小跟池化前後的特徵圖大小有關,$(p_x, p_y)$為區域中的座標,$\mathcal{F}_B(\cdot)$為雙線性插值,使$\Delta C$可導。 ### Progressive constraint   在訓練階段,使用公式1對TSD和sibling head進行聯合訓練,此外還設計了漸進約束(progressive constraint, PC)來輔助TSD的學習,如圖2(c)。 ![](https://upload-images.jianshu.io/upload_images/20428708-ce34b96996221ed1.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)   對於分類分支,PC如公式7,$\mathcal{H}(y|\cdot)$為$y$類的置信度,$m_c$約預設的間隔,$|\cdot|_{+}$類似於ReLU函式,即約束TSD的預測置信度需要比sibling head至少高$m_r$,否則即學習不夠,產生損失 ![](https://upload-images.jianshu.io/upload_images/20428708-19d477f2c1e8c27b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)   對於定位分支,PC如公式8,$\hat{\mathcal{B}}$為原方式的最終預測結果,$\hat{\mathcal{B}}_D$為TSD轉換後的最終預測結果,僅對正樣本進行計算,即約束TSD的預測結果的IoU需要比sibling head至少高$m_r$ ![](https://upload-images.jianshu.io/upload_images/20428708-b723a3149f134854.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)   最終的損失函式為公式9,結合了所有的損失,推理的時候把sibling head分支和PC去掉。   論文在此處提出的約束方法很好,但是會存在一個問題,若sibling head學習充分了,留給TSD的提升空間本身就小於間隔,這樣產生的損失顯然有些不合理,所以是否在這種情況應該調整間隔,在可提升空間和預設間隔之間去個最小值。 # Experiments *** ### Ablation studies * ##### Task-aware disentanglement ![](https://upload-images.jianshu.io/upload_images/20428708-10bc00a6ed52ecef.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) ![](https://upload-images.jianshu.io/upload_images/20428708-314ed379c11bec4a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)   這裡對比了TSD與不同的分解策略,比如$D_{s8}$即從stride為8的特徵圖開始分解。 * ##### Joint training with sibling head $\mathcal{H}_*$ ![](https://upload-images.jianshu.io/upload_images/20428708-e3429036fba6e459.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) * ##### Effectiveness of PC ![](https://upload-images.jianshu.io/upload_images/20428708-2fb2f0d6e93e962d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) * ##### Derived proposal learning manner for $\mathcal{H}_*^D$ ![](https://upload-images.jianshu.io/upload_images/20428708-0f5c2f34ebee3995.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) * ##### Delving to the effective PC ![](https://upload-images.jianshu.io/upload_images/20428708-0e0695e526128161.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) ### Applicable to variant backbones ![](https://upload-images.jianshu.io/upload_images/20428708-cbc02ca2094a539e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)   基於Faster R-CNN + TSD替換不同主幹網路的結果 ### Applicable to Mask R-CNN ![](https://upload-images.jianshu.io/upload_images/20428708-0975de31b2ef0856.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) ### Generalization on large-scale OpenImage ![](https://upload-images.jianshu.io/upload_images/20428708-97257cb0d5b3f6ac.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) ### Comparison with state-of-the-Arts ![](https://upload-images.jianshu.io/upload_images/20428708-5beb98ca59731700.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) ### Analysis and discussion * ##### Performance in different IoU criteria ![](https://upload-images.jianshu.io/upload_images/20428708-6f0d62264baf9c56.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) * ##### Performance in different scale criteria ![](https://upload-images.jianshu.io/upload_images/20428708-5d2a7ccbe99b89b0.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) * ##### What did TSD learn ![](https://upload-images.jianshu.io/upload_images/20428708-0690bcdd3ca4c04d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)   從圖5可以看出,TSD的定位能夠學習不易迴歸的邊界,而分類則專注於區域性特徵以及目標的上下文資訊,這裡的點為區域$G(x,y)$轉換後的中心點 # Conclusion ***   目前很多研究表明目標檢測中的分類分支和定位分支存在較大的偏差,論文從sibling head改造入手,跳出常規的優化方向,提出TSD方法解決混合任務帶來的內在衝突,從主幹的proposal中學習不同的task-aware proposal,同時結合PC來保證TSD的效能,在COCO上達到了51.2mAP       > 如果本文對你有幫助,麻煩點個贊或在看唄~ 更多內容請關注 微信公眾號【曉飛的演算法工程筆記】 ![work-life balance.](https://upload-images.jianshu.io/upload_images/20428708-7156c0e4a2f49bd6.png?imageMogr2/auto-orient/strip%7CimageView2/2