Focal loss分析

1)Class imbalance問題的提出

Focal loss的提出就是問了解決Class imbalance問題,在兩階段目標檢測算法中,這一問題是通過兩階段級聯與啓發式採樣策略解決的(Class imbalance is addressed in R-CNN-like detectors by a two-stage cascade and sampling heuristics)。在proposal階段,候選物體位置被快速的降低到一個較小的數量(例如1-2K),篩選掉大部分的背景採樣(The proposal stage (e.g., Selective Search [35], EdgeBoxes [39], DeepMask [24, 25], RPN [28]) rapidly narrows down the number of candidate object locations to a small number (e.g., 1-2k), filtering out most background samples)。在第二階段,啓發式的採樣方法,例如固定的前景與背景比例(1:3)或者在線難例挖掘,用於保持前景與背景物體數量的平衡。(In the second classification stage, sampling heuristics, such as a fixed foreground-to-background ratio (1:3), or online hard example mining (OHEM) [31], are performed to maintain a manageable balance between foreground and background)。

正相反,單階段檢測器必須處理一個大得多的物體位置候選集,這個候選集通常是在整副圖片上採樣得到的(In contrast, a one-stage detector must process a much larger set of candidate object locations regularly sampled across an image)。通常,單階段檢測器可能給出~100K個候選位置,這些位置非常密集同時包含不同的空間位置、尺度與比例。(In practice this often amounts to enumerating ∼100k locations that densely cover spatial positions, scales, and aspect ratios)然而,類似的啓發式採樣方法可能也會被應用,但他們是效率低下的,因爲訓練過程仍然被容易分類的背景物體主導(While similar sampling heuristics may also be applied, they are inefficient as the training procedure is still dominated by easily classified background examples.)。這一效率低下的問題是目標檢測中的典型問題,通常使用bootstrapping或難例挖掘等技術解決(This inefficiency is a classic problem in object detection that is typically addressed via techniques such as bootstrapping [33, 29] or hard example mining [37, 8, 31])。

類別不平衡問題導致兩個問題:(This imbalance causes two problems:)(1)訓練過程效率低下,因爲大部分是簡單反例(easy negatives),簡單反例對於學習過程沒有作用;((1) training is inefficient as most locations are easy negatives that contribute no useful learning signal;)簡單反例可能壓垮(overwhelm)訓練過程並且導致模型的退化。((2) en masse, the easy negatives can overwhelm training and lead to degenerate models.)

上面論文中的幾段內容其實主要提出兩方面問題

1)類別不平衡問題是單階段檢測器的問題,兩階段檢測器沒有這個問題。

2)簡單反例(easy negatives)纔是影響訓練過程的主要因素。

因此《Focal Loss for Dense Object Detection》這篇文章針對單階段檢測器中的類別不平衡問題提出一種新的損失函數Focal loss,當然Focal loss不僅能解決單階段檢測器中的類別不平衡,類別不平衡問題均可以嘗試採用這一方法解決。

直接借用文章中的圖片,可以看到如果γ等於0,則與cross entropy相等,隨着γ的增加,loss隨之下降。此處的下降有兩方面作用:

1)當某個物體分類錯誤並且pt較小時,調製因子接近於1,損失函數並沒有什麼影響,這也就意味着被錯誤分類的物體的損失函數基本保持不變,仍能有效的用於網絡訓練。當pt趨近於1時,調製因子接近於0,較爲容易分類的物體的損失函數也就基本趨近於0。

2)參數γ可以有效地降低被明確分類的物體的權重。這也就意味着被錯誤分類的物體的重要性在提高。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章