天天看點

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

本文是CVPR2019 的文章,作者給出了一個很強的人體ReID baseline模型,文中包含了許多ReID訓練技巧并提出一種BNNeck,在Market1500和DukeMTMC-ReID 兩個資料集上達到了目前最好的Rank-1 精度和mAP。

論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》

代碼連結:https://github.com/michuanhaohao/reid-strong-baseline

摘要

    本文探讨了一個簡單而有效的行人再識baseline(ReID)。近年來,基于深度神經網絡的行人再識别(ReID)技術取得了很大的進展,并取得了良好的性能。然而,許多先進的方法設計複雜的網絡結構和連接配接多分支特征。在文獻中,一些有效的訓練技巧在幾篇論文或源代碼中都有簡要的介紹。本文将親自對這些有效的訓練技巧進行收集和評價。通過将這些技巧結合起來,該模型在隻使用全局特征(global feature)的情況下,在Market1501上實作了94.5%的rank-1和85.9%的mAP。我們的代碼和模型在https://github.com/michuanhaohao/reid-strong-baseline。

1 引言

    近年來,基于深度神經網絡的行人再識别(ReID)技術取得了很大的進展,并取得了良好的性能。然而,許多先進的方法設計複雜的網絡結構和連接配接多分支功能。在文獻中,一些有效的訓練技巧或改進在幾篇論文或源代碼中簡要出現。本文将親自收集和評價這些有效的訓練技巧。在所有的訓練技巧的參與下,ResNet50在Market1501[24]上達到94.5%的rank-1準确率和85.9%的mAP。值得一提的是,它通過模型的全局特性實作了如此驚人的性能。

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

圖1所示。不同baseline在Market1501和dukeMTMC-reid資料集上的性能。我們将我們的強baseline與發表在CVPR2018和ECCV2018上的其他baseline進行比較。 

    為了進行比較,我們調查了去年在ECCV2018和CVPR2018上發表的文章。如圖 1 所示。以前的工作大多是在較差的基線上展開的。在Market1501上,23個baselines中隻有兩個baselines的準确度超過了90% rakn-1。四個baseline的rank-1精度甚至低于80%。在DukeMTMC-reID上,所有baselines的精度都沒有超過80%的rank-1或65%的mAP。我們認為一個強有力的baseling對于促進研究的發展是非常重要的。是以,我們用一些訓練技巧修改了标準baseline,以獲得一個強baseline。我們強大baseline的代碼已經開源。

    此外,我們也發現一些作品與其他最好的算法相比是不公平的。具體來說,這些改進主要來自訓練技巧,而不是算法本身。但論文中對訓練技巧的描述過低,以至于讀者忽略了它們。這将使該算法的有效性被誇大。我們建議審稿人在評論學術論文時要考慮這些技巧。

    除了上述原因之外,另一個需要考慮的問題是,工業界更喜歡簡單而有效的模型,而不是在推理階段連接配接許多局部特征(local features)。為了追求更高的精度,學術界的研究人員往往結合多個局部特征,或利用姿态估計或分割模型中的語義資訊。這樣的方法帶來了太多的額外計算。較大的特征也大大降低了檢索的速度。是以,我們希望使用一些技巧來提高ReID模型的能力,并且隻使用全局特征來實作高性能。本文的研究目的如下:

* 我們調查了許多在頂級會議上發表的作品,發現其中大多數都是在較差的baseline上擴充的。

* 對于學術界,我們希望為研究人員提供一個強大的baseline,以實作更高的準确性的行人ReID。

* 對于社群,我們希望向審閱人員提供一些參考資料,了解哪些技巧會影響ReID模型的性能。我們建議,在比較不同方法的性能時,審閱人員需要考慮這些技巧。

* 對于行業,我們希望提供一些有效的技巧,以獲得更好的模型,而不需要太多的額外計算。

    幸運的是,在一些論文或開源項目中已經出現了許多有效的訓練技巧。我們收集了許多技巧,并在ReID資料集上對每個技巧進行評估。經過大量的實驗,我們選擇了六個技巧來介紹本文。其中一些是我們設計或修改的。我們将這些技巧添加到一個廣泛使用的baseline中,以得到修改後的baseline,該baseline在Market1501上實作了94.5%的rank-1和85.9%的mAP。此外,我們發現不同的作品選擇不同的圖像size和batch size的數量,作為補充,我們也探讨了它們對模型性能的影響。綜上所述,本文的貢獻總結如下:

    1) 我們為ReID收集了一些有效的訓練技巧。其中,我們設計了一種新的neck結構,稱為BNNeck。此外,我們還對兩個廣泛使用的資料集評估了每個技巧的改進。

    2)  我們提供了一個強大的ReID baseline,在Market1501上實作了94.5%和85.9%的mAP。值得注意的是,這些結果是用ResNet50 backbone提供的全局特性得到的。據我們所知,這是全局特征親自獲得的最佳性能。

    3)作為補充,我們評估了圖像size和batch size數量對ReID模型性能的影響。

2 标準Baseline

    我們遵循廣泛使用的開放源碼作為我們的标準baseline。标準baseline的backbone為ResNet50[5]。在訓練階段,pipeline包括以下步驟:

1,我們在ImageNet上初始化帶有預訓練參數的ResNet50,并将全連接配接層的次元更改為N, N表示訓練資料集中的行人身份數。

2,我們随機抽取每個人的P個身份和K個圖像作為訓練樣本。最後batch-size B = P*K。本文設P = 16, K = 4。

3,我們将每個圖像的大小調整為256 *128像素,并将調整後的圖像填充10個像素,填充值為0。然後随機裁剪成256 *128的矩形圖像。

4,每幅圖像水準翻轉的機率為0.5。

5,每個圖像被解碼成32位浮點原始像素值在[0,1]。然後分别減去0.485、0.456、0.406,再除以0.229、0.224、0.225,對RGB通道進行歸一化。

6,該模型輸出ReID特征為 f 和 ID 預測 logits p。

7,ReID特征 f 用于計算triplet loss[6]。采用ID預測logits p計算交叉熵損失。triplet loss的margin設為0.3。(附:想廖俊傑跟多關于triplet loss的話,可以看我之前的部落格:《triplet loss詳解和pytorch實作》)

8,采用Adam方法對模型進行優化。初始學習率設定為0.00035,在第40個epoch和第70個epoch分别降低0.1。總共有120個訓練epoches。

3 訓練Tricks

   本節将親自介紹一些有效的訓練技巧。大多數這樣的技巧都可以在不改變模型架構的情況下在标準baseline上擴充。圖2 (b)為本節中出現的訓練政策和模型架構。

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

                                                                   圖 1. 标準baseline 和我們修改的baseline pipelines

3.1 warmup 學習率

    學習率對ReID模型的性能有很大的影響。标準baseline最初以較大且恒定的學習率進行訓練。在[2]中,為了獲得更好的性能,使用warmup政策提升網絡。在實踐中,如圖3所示,我們設定10個epoch線性增加學習速率,從3.5*10^-5到 3.5*10^-4。然後,學習速率分别在第40個epoch和第70個epoch,從3.5*10^-5 衰減到3.5*10^-6。在epoch t  處的學習速率lr(t)計算為:

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

3.2 随機擦除增強

    在行人ReID中,人在圖像有時被其他物體遮擋。為了解決遮擋問題,提高ReID模型的泛化能力,Zhong等人[27]提出了一種新的資料增強方法——随機擦除增強(REA)。在實踐中,在一個mini-batch中的圖像 I ,它以

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

的機率随機擦除、以

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

的機率保持不變。然後,REA在圖像 I 中随機選擇一個大小為

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

的矩形區域

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

,并用随機值擦除其像素。假設圖像 I 和區域

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

的面積分别為

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

,我們将

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

表示為擦除矩形區域的面積比。此外,區域

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

的縱橫比在 r1 和 r2 之間随機初始化。為了确定一個唯一的區域,REA随機初始化一個點

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

。如果

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

并且

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

,設區域

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

為標明的矩形區域。否則,我們重複上述過程,直到選擇合适的

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

。在標明的擦除區域

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

中,将

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

中的每個像素分别賦給圖像 I 的均值。

    在本研究中,我們将超參數設為p = 0.5;0.02 < Se < 0.4;r1 = 0.3;r2 = 3.33。一些例子如圖4所示。

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

                             圖4。随機消除增強的抽樣例子。第一行顯示了五個原始訓練圖像。處理後的圖像顯示在第二行。  

3.3 标簽平滑

    ID embedding (IDE)[25]網絡是person ReID的基本baseline。IDE的最後一層是一個全連接配接層,輸出圖像的 ID 預測logits。隐藏神經元大小等于行人數N 。給定一個圖像,我們定義 y 為ground-truth ID标簽,

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

為類别 i 的ID 行人logits。交叉熵損失計算為:

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

    由于分類的類别是由人的ID決定的,本文将這種損失函數稱為ID loss。

    然而,由于測試集的人id沒有出現在訓練集中,是以可以将行人ReID看作是一次性的學習任務,是以防止ReID模型對訓練 id 進行過拟合非常重要。在[17]中提出的标簽平滑(LS)是一種廣泛用于防止分類任務過拟合的方法。它将

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

結構改為:

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

(作者舉了個例子,加入原始的label是[0,0,1,0,0,0],平滑參數設定為0.1,則平滑之後的label就會變成[0.02,0.02,0.9,0.02,0.02,0.02],計算損失時由交叉熵換回原始的相對熵。經過标簽平滑之後,網絡的過拟合程度也會被抑制一點。)

 (筆者注:但在其他部落格中,标簽平滑不是這樣定義的:y' = (1 - epsilon)*y + epsilon/N。(即,假設N= 5為五分類,樣本真實标簽為 y = [0,0,1,0,0],epsilon = 0.1(平滑參數)。 y' 即作者論文中的 qi,為 :y' = (1-0.1)*[0,0,1,0,0] + 0.1/5  = 0.9 * [0,0,1,0,0] + 0.02 = [0,0,0.9,0,0] + 0.02 = [0.02,0.02,0.92,0.02,0.02])。

    其中

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

為一個小常數,鼓勵模型不要太相信訓練集。在本研究中,

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

設為0.1。當訓練集不是很大時,LS可以顯著提高模型的性能。

3.4 最後一步(Last stride)

    更高的空間分辨率總是豐富了特征的粒度。在[16]中,Sun等删除了主幹網絡中的最後一次空間下采樣操作,以增加feature map的大小。為了友善起見,我們将骨幹網絡中的最後一個空間下采樣操作表示為最後一步(last  stride)。ResNet50的最後一步設定為2。當輸入256*128幅圖像時,ResNet50的主幹輸出空間大小為8*4的feature map。如果将最後一步由2步變為1步,我們可以得到一個空間更大的feature map(16*8),這種操作隻會增加非常小的計算成本,并且不需要額外的訓練參數。然而,更高的空間分辨率帶來了顯著的改善。

3.5 BNNeck

    大多數工作都是将ID loss和triplet loss結合起來訓練ReID模型。如圖5(a)所示,在标準baseline中,ID loss和triplet loss限制了相同的特征 f,但這兩種loss的目标在嵌入空間(embedding space)上不一緻。

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

                                                     圖 5. 标準neck和我們設計的BNneck之間的比較 

    如圖6(a)所示,ID loss構造多個超平面,将嵌入空間劃分為不同的子空間。每個類的特征分布在不同的子空間中。在這種情況下,對于推理階段的ID loss優化模型,餘弦距離比歐氏距離更合适。另一方面,如6(b)所示,triplet loss增強了歐氏空間的類内緊湊性和類間可分性。由于triplet loss不能提供全局最優限制,類間距離有時小于類内距離。一種廣泛使用的方法是将ID loss和triplet loss結合起來訓練模型。這種方法可以讓模型學習到更多有差別的特征。然而,對于嵌入空間中的圖像對,ID loss主要是優化餘弦距離,而triplet loss主要是歐氏距離。如果我們使用這兩個損失同時優化一個特征向量,它們的目标可能是不一緻的。在訓練過程中,一種可能的現象是一種損失減少了,而另一種損失在振蕩甚至增加。

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

圖6。由(a) ID loss、(b)triplet loss、(c) ID +triplet loss、(d) ID +triplet loss+ BNNeck監督的嵌入空間樣本分布的二維可視化。不同顔色的點表示不同類的嵌入(embedding)特征。黃色虛線代表假定的分類超平面。

     為了克服上述問題,我們設計了如圖5(b)所示的BNNeck結構。BNNeck隻在特征層之後(和分類器FC層之前)添加了一個batch normalization(BN)層。将BN層之前的特征表示為

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

,讓

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

通過BN層獲得歸一化特征

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

。在訓練階段,分别用

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

計算triplet loss和 ID loss。normalization平衡了

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

的各個次元。這些特征在超球面附近呈高斯分布。這種分布使得 ID loss更容易收斂。此外,BNNeck減小了對

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

的ID loss限制,ID損失的限制越小,triplet loss越容易同時收斂。第三,normalization保持了屬于同一個人的特征的緊湊分布。

    由于超球面幾乎是關于坐标軸原點對稱的,BNNeck的另一個技巧是消除分類器FC層的偏差(biases)。它限制分類超平面通過坐标軸原點。我們用[4]中提出的kaiming初始化來初始化FC層。

    在推理階段,我們選擇

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

來完成person ReID任務。餘弦距離度量比歐氏距離度量具有更好的性能。實驗結果如表1所示,BNNeck可以大幅度提高ReID模型的性能。

    表 1 在Market1501和DukeMTMC-reid資料集上對不同模型的性能進行了評估。Baseline-S代表第2節中介紹的标準baseline。

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

3.6 Center loss

    tripet loss 的組成:

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

    其中

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

為positive pair和negative pair的特征距離。

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

為triplet loss的margin,[z]+ = max(z,0)。在本文中,

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

設為0.3。但是triplet loss隻考慮

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

的內插補點,忽略了它們的絕對值。例如,當dp = 0.3;dn = 0.5,triplet為0.1。另一種情況下,dp = 1.3;dn = 1.5,triplet loss也是0.1。triplet loss由随機采樣的兩個人id确定。在整個訓練資料集中,很難保證dp < dn。

    center loss[20]同時學習每個類的深度特征中心,并懲罰深度特征與其對應的類中心之間的距離,彌補了triplet loss的缺點。center loss函數表示為:

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

    其中

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

是mini-batch中的第 j 個圖像的标簽。

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

為深度特征的第

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

個類中心。B是batch-size的數量。這個公式有效地描述了類内的變化。将center loss最小化可以增加類内緊湊性。我們的模型總共包括以下三個損失:

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗
Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

是center loss的平衡權重,在我們的實驗中

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

設定為0.0005.

4 實驗結果

    在本節中,我們将在Market1501和dukemtc-reid[11]資料集上評估我們的模型。采用Rank-1精度和平均平均精度(mAP)作為評價名額。我們依次在标準基線上添加tricks,并且不更改任何訓練設定。消融研究的結果顯示,每個trick都能提高性能。為了避免過拟合的誤導,我們還展示了跨域(cross-domain)實驗的結果。

4.1 ,每個trick的影響(同域)

    第2節中引入的标準baseline在Market1501和DukeMTMC-reID上分别實作了87.7%和79.7%的rank-1精度。标準baseline的性能與其他論文中報道的大多數baseline相似。然後,我們将warmup政策、随機擦除增強、标簽平滑、步幅變化、BNNeck和center loss逐一添加到模型訓練過程中。我們設計的BNNeck比其他trick更能提高性能,尤其是DukeMTMC-reID。最後,這些技巧使baseline在Market1501上獲得了94.5%的Rank-1精度和85.9%的mAP。在DukeMTMC-reID上,其精度達到了86.4%的rank-1和76.4%的mAP。在其他工作中,這些訓練tricks将标準baseline的性能提高了10%以上。另外,為了得到這樣的改善,我們隻需要增加一個BN層,不增加訓練時間。

4.2 BNNeck 分析

    在本節中,我們使用歐氏距離度量和餘弦距離度量來評估兩個不同特征(

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

)的性能。所有模型均經過訓練,表2所示無center loss。我們觀察到,對于

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

,餘弦距離度量比歐氏距離度量表現得更好。由于ID loss直接限制了BN層之後的特征,

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

可以被多個超平面清晰地分割。餘弦距離可以測量兩個特征向量之間的夾角,是以餘弦距離度量比歐氏距離度量更适用于

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

。然而,ft接近triplet loss,同時又受到ID loss的限制。兩種度量方法在

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

上實作了類似的性能。

表2. BNNeck的消融研究。f (w/o BNNeck)是baseline,沒有BNNeck。BNNeck包括兩個特征

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

。我們分别用歐氏距離和餘弦離來評價它們的性能。

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

    總體而言,BNNeck顯著提高了ReID模型的性能。在推理階段,我們選擇帶餘弦距離度量的

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

 進行檢索。

4.3 每個trick的影響(跨域)

    為了進一步探讨其有效性,我們還将跨域實驗結果如表3所示。綜上所述,warmup政策、标簽平滑和BNNeck三種方法顯著提高了ReID模型的跨域性能。stride的變化和center loss似乎對表現沒有太大的影響。然而,在跨域ReID任務中,REA會對模型造成危害。特别是,當我們的修改baseline在沒有REA的情況下進行訓練時,它在Market1501和DukeMTMC-reID資料集上的Rank-1精度分别達到41.4%和54.3%。它的性能大大超過了标準baseline的性能。通過對訓練圖像區域的REA mask,可以使模型在訓練域中獲得更多的知識。它會導緻模型在測試領域的性能變差。

    表 3. 在跨域資料集上評估不同模型的性能。M->D表示我們在Market1501上訓練模型,并在DukeMTMC-reid上進行評估。

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

4.4 和最好的方法進行比較

    我們在表4中比較了強baseline與最先進的方法。所有的方法都被分成不同的類型。Pyramid[22]在兩個資料集上實作了驚人的性能。然而,它連接配接了21個不同規模的局部特征(local feature)。如果隻利用全局特征(global feature),則在Market-1501獲得92.8%的rank-1精度和82.1%的mAP。我們強大的baseline在Market1501資料集上可以達到94.5%的Rank-1精度和85.9%的mAP。BFE[1]的性能與我們的強baseline類似。但是它結合了兩個分支的特征。在所有隻使用全局特性的方法中,我們的強baseline在Market1501和DukeMTMC - reid上都比AWTL[12]強10%以上。通過k-倒數重排方法提高性能,我們的方法在Market1501和dukemtc - reid上分别達到了94.1%和89.1%的mAP。據我們所知,我們的baseline在僅使用全局特性的情況下實作了最佳性能。

                                表 4. 和最好的方法的比較。

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

是在推理階段的特征數目。PK表示k-倒數重排方法。

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

5 補充實驗

    我們觀察到,之前的一些工作是用不同數量的batch-size或圖像大小。在本節中,作為補充,我們将探讨它們對模型性能的影

響。

5.1 Batch Size數量的影響

    小mini-batch的triplet loss包括B = p*k張圖像。P和K分别表示不同的人的數量和每個人不同的圖像的數量。一個mini-batch在一個GPU中最多隻能包含128張圖像,是以我們不能用P = 32,K = 6或P = 32,K = 8來做實驗。通過去除center loss,明确了triplet loss與batch size大小的關系。結果如表5所示。然而,目前還沒有具體的結論來證明B對性能的影響。我們觀察到的一個輕微的趨勢是,更大的batch-size有利于模型性能。我們推斷,較大的k則有助于挖掘較硬的positive pair,而較大的P有助于挖掘較硬的negative pair。

                                                         表 5. 不同batch-size數量的ReID模型的性能

Bag of Tricks and A Strong Baseline for Deep Person Re-identification(論文閱讀筆記)論文連結:《Bag of Tricks and A Strong Baseline for Deep Person Re-identification》代碼連結:https://github.com/michuanhaohao/reid-strong-baseline摘要1 引言2 标準Baseline3 訓練Tricks4 實驗結果5 補充實驗

5.2 圖像size的影響

    我們訓練了沒有center loss的模型,設P = 16;K = 4。如表6所示,四個模型在兩個資料集上實作了類似的性能。在我們看來,圖像大小并不是ReID模型性能的一個非常重要的因素。 

繼續閱讀