1. 程式人生 > >細粒度分類-車輛分類

細粒度分類-車輛分類

Embedding Label Structures for Fine-Grained Feature Representation
CVPR 2016

首先get到了關於image understanding常見的四個名詞,困擾了我好久:

  • classification 分類
  • detection 檢測
  • segmentation 分割
  • retrieval 檢索

再關於網路模型的有:

  • identification –>分類學習(i.e. Softmax With Loss)
  • verification –>度量(相似度)學習(i.e. Contrastive Loss)

重點

To obtain the fine-grained feature representation, a potential solution is to incorporate similarity constraints (e.g. contrastive information [9] or triplets [26, 7])

為了獲得細粒度特徵表示,需要加入相似性約束,即需要度量學習。

Although the features learned from triplet constraints are effective at discovering similar instances, its classification accuracy may be inferior to the fine-tuned deep models that emphasize on the classification loss, as demonstrated in our experiments. In addition, the convergence speed using such constraints is usually slow.

這部分說明了度量學習的一些弊端:儘管可以有效發現相似例項,但是相比強調分類損失的模型而言,分類精度較差,再者,收斂速度慢。原因也很顯然,因為度量學習給的監督資訊少(similar or dissimilar constraints vs a specific label among C classes)。
Comparison of the convergence rate on the Stanford car dataset:
Comparison of the convergence rate on the Stanford car dataset.

Different from the pairwise contrastive loss [9] that forces the data of the same class to stay close with a fixed margins, the triplet loss allows certain degrees of intra-class variance.

這裡說明了Pairwise Contrastive Loss 與Triplet Loss的區別,都屬於度量學習,但Triplet Loss可以允許一定程度的類間差別,這可以從Contrastive Loss的定義得到,如果同一類的兩張圖片(即標籤為相似),則一定有損失,除非二者特徵空間的距離為零!

文章的創新點

  1. Embed Label Structures,這部分又分為兩類:hierarchical labels and shared attributes。這些都是針對多標籤的資料而言,理解不同層次的相似。

這裡論文擴充套件了triplet loss(ranking loss 的最簡單形式),比如下圖:
這裡寫圖片描述
三元組變成四元組(ri;p+i;pi;ni),可以簡單理解p+i為完全相似的樣本(粗粒度和細粒度標籤都相同),pi為部分相似(只粗粒度標籤相同),ni為不相似樣本(粗粒度標籤都不同)。滿足:

D(ri;p+i)+m1<D(ri;pi)+m2<D(ri;ni)
m1>m2>0
實際操作還是拆成兩個三元組(ri;p+i;pi)(ri;pi;ni)。具體見論文。
這裡寫圖片描述

第二篇Deep Relative Distance Learning Tell the Difference Between Similar Vehicles
CVPR 2016
這篇文章做的是例項級別的車輛識別/搜尋問題,相比於車輛模型(Vehicle Model)的識別更有挑戰性。一般的,車輛識別可以通過識別車牌號來實現,不過這裡是從是視覺角度來區分車輛的。主要借鑑Person re-Identification,但是不能直接應用到車輛識別中,因為相同模型的車輛外觀幾乎相同(文中提到通過一些marks來區分這些車輛,比如一些裝飾物,總之還是可以區分的…),所以在區別不同模型的同時,還要區分同一模型中不同的車輛。
綜上作者提出了Mixed Difference Network Structure這樣一個多工模型:
這裡寫圖片描述
上面的分支做車輛模型的分類(Softmax),所以Fc7得到的是車輛模型級別的特徵;下面的分支做Deep Relative Distance Learning(相對距離學習,即度量學習),所以Fc7_2得到的是例項級別的特徵;最終的Fc8綜合了這兩個級別的特徵。
背後的想法也很直觀:判斷兩張車輛圖片是否是同一個車,首先從車輛模型(Fc7)上判斷,如果不同,自然不是同一輛車,如果相同,則需使用例項特徵(Fc7_2)進一步判斷。

文章的創新點

1.發現了傳統的Triplet Loss 的缺陷,並進行了改進,提出Coupled Clusters Loss
2.製作了大規模車輛資料庫VehicleID

這裡記錄下,為什麼在Triplet Loss之前都會對特徵進行L2範數歸一化的操作:是為了防止損失函式很容易超過0 。

Triplet Loss 輸入有三張圖片,其中兩張圖片屬於同一類,另一張屬不同類。需要在同一類的兩張圖片中選擇一張作為Anchor,所以同樣三張圖片會有兩種不同的輸入方式:
這裡寫圖片描述
而Triplet Loss 的作用是maximize the relative distance between the matched pair and the mismatched pair. 所以左邊的輸入方式會產生損失值,從而得到矯正。而右邊滿足了損失函式的條件,不會產生損失,也就不會反向傳播,對網路沒有任何幫助,但是會造成錯誤。

關於如何改進直接參考論文吧。