Label Assignment in Object Detection
label assignment是目標檢測中非常重要的問題,這裡我們先調研了目標檢測中主流模型label assignment的方式,然後對此做了一個簡單總結。
label assignment就是要對目標檢測中的anchor box或者anchor point打上label,是positive、negative還是ignore。這裡面有兩個挑戰,一個挑戰是negative非常多,容易導致樣本不均衡問題;另一個挑戰是判定標準只能經驗性地設定,然後透過實驗結果來驗證,基本是一個trial and error的過程。
這裡提到的論文見github連結。
背後的邏輯
歸納和演繹是科學研究中運用得較為廣泛的邏輯思維方法。馬克思主義認識論認為,一切科學研究都必須運用到歸納和演繹的邏輯思維方法。人類認識活動,總是先接觸到個別事物,而後推及一般,又從一般推及個別,如此迴圈往復,使認識不斷深化。歸納就是從個別到一般,演繹則是從一般到個別。
論文調研相當於歸納,根據總結則可以進行演繹。就像門捷列夫在十九世紀歸納各種已知元素的性質而製作出元素週期表,並藉此基本成功預測了當時尚未發現的、位於週期表空位中元素的相當一部分性質。
對於label assignment這個問題,我們調研和總結之後,就可以理清各個方法的異同與優劣,同時可以指明後續的研究方向。
Survey
Faster RCNN/SSD/RetinaNet
grid cell中有多個anchor
透過anchor與GT框之間的IoU判定是positive、negative還是ignore
比如RetinaNet裡面,IoU低於0。4為negative,高於0。5為positive,其他為ignore
YOLO
grid cell中有多個anchor
YOLOv2
首先透過GT框的中心計算得到對應的grid cell
然後計算GT框與該grid cell中anchor的IoU
選擇其中IoU最大的anchor做為positive
計算GT與該grid cell預測proposal的IoU
IoU大於0。6的proposal對應的anchor為ignore
其他anchor為negative
YOLOv3
對於每個proposal
計算其與所有GT框的IoU,如果最大的IoU大於0。7,則該proposal對應的anchor為ignore
對於每個GT框
計算其與所有anchor之間IoU(將x、y置為0,僅保留w、h的值),取IoU最大的anchor為positive(對應的grid cell,透過GT框中心計算得到)
其他anchor為negative
FCOS
grid cell中沒有anchor
對於每一層feature map,將其中每個grid cell對應回原圖,對應回去之後如果落在某個GT框內,則該grid cell為positive,如果同時落在多個GT框內,選擇面積小的GT框與該grid cell對應
其餘grid cell為negative
沒有ignore
FreeAnchor
每個gird cell中有多個anchor
透過anchor與GT框之間的IoU判定positive、negative、ignore
低於0。6的anchor為negative
對於每個GT框,根據IoU大小進行降序排序,選擇top 50的anchor為候選positive
計算候選positive anchor對應的loss(包含分類loss和框迴歸loss),loss最小的anchor即為positive(類似OHEM)
positive和negative以外的anchor為ignore
AutoAssign
grid cell中沒有anchor
對於每一層feature map,將其中每個grid cell對應回原圖,對應回去之後如果落在某個GT框內,則該grid cell既為positive,也為negative(類似label smoothing);positive的權重透過attention的方式來學,negative的權重透過該grid對應的proposal與所有GT框之間最大的IoU確定,即IoU越大,negative權重越小,反之,negative權重越大
其餘grid cell為negative
沒有ignore
Summary
有無模型的反饋
無(即label assignment過程與模型前向無關)
GT與anchor bbox的IoU(Faster RCNN、SSD、RetinaNet)
落在GT內的grid cell(YOLO、FCOS)
有(即模型前向會參與label assignment過程)
分類
針對negative
OHEM
同時考慮positive和negative
focal loss
框迴歸
針對ignore
YOLO
分類和框迴歸
針對positive
FSAF
FreeAnchor
Learning from Noisy Anchors for One-stage Object Detection
hard or soft label assignment
hard label assignment
Faster RCNN、YOLO、SSD、RetinaNet、FCOS
soft label assignment
AutoAssign
SAPD
可以看到,有模型反饋和soft label assignment是一個趨勢。