基于深度學(xué)習(xí)的行人重識別網(wǎng)絡(luò)(Person Re-identification with Deep Learning )

Aligned-Reid神經(jīng)網(wǎng)絡(luò)是一個復(fù)雜的類人腦神經(jīng)網(wǎng)絡(luò)。在培訓(xùn)階段,需要考慮同時考慮多幅圖像的全局及局部特征。其中對于局部特征提出了創(chuàng)新性的水平切割方法。為了實(shí)現(xiàn)這個過程,我們需要將圖像水平分割,計(jì)算各部分的局部特征,然后將兩張切割后的圖片的局部特征從上到下一一進(jìn)行對應(yīng)計(jì)算,尋找兩張圖片之間的最小距離。 本文在原有的Reid方法的基礎(chǔ)上,進(jìn)一步優(yōu)化損失函數(shù)。使用center loss, 重點(diǎn)改善了圖像分類中的類間距離,提高了圖像分類的質(zhì)量。同時,該方法彌補(bǔ)了三元組損失只考慮相對距離的不足,將網(wǎng)絡(luò)性能在一定程度內(nèi)范圍提高。

Abstract

The Aligned Reid neural network is a complex network for person re

-identification. In the training stage, it needs to consider the global and local features of multiple images at the same time. The processing of local features is ery innovative in the Reid field. To implement this process, we need to cut the mage horizontally and compute the local features of each part. Based on this step, we propose a new method to improve the performance. When computing the distance between two images, it is necessary to find the shortest distance between the two images by one-to-one correspondence of the cut local images according to the characteristics. ? ? ? ? ? ?

Based on the original Aligned Reid method, this dissertation further optimizes the evaluation of the loss function. We use the center loss method, which focuses on the inter-class distance in image classification, to improve the SoftMax loss result used to obtain the global features. At the same time, this method makes up for the disadvantage of the triple loss method which only considers the relative distance, and improves the network performance to a certain extent.?

Keywords: Aligned Reid, Triplet Loss, Center Loss, SoftMax Loss, Local Feature?

網(wǎng)絡(luò)結(jié)構(gòu)(Network structure )

在整個網(wǎng)絡(luò)架構(gòu)進(jìn)入部署階段后,我們輸出只全局特征作為輸入圖像的最終輸出。然而,在訓(xùn)練階段,我們將網(wǎng)絡(luò)模型分析得到的全局特征和局部特征結(jié)合起來,得到更好的網(wǎng)絡(luò)權(quán)重參數(shù),如圖所示。 在最終的訓(xùn)練模型中,首先對數(shù)據(jù)進(jìn)行預(yù)處理,將圖像集進(jìn)行數(shù)據(jù)處理并調(diào)整統(tǒng)一大小。然后,我們在數(shù)據(jù)擴(kuò)充后將圖像發(fā)送到模型進(jìn)行處理。 訓(xùn)練模型中使用的CNN網(wǎng)絡(luò)是resnet50神經(jīng)網(wǎng)絡(luò),但是因?yàn)樽鳛橛?xùn)練對象的圖像經(jīng)過了一系列的預(yù)處理,網(wǎng)絡(luò)對其特征具有獨(dú)特的結(jié)構(gòu)要求,所以有必要重建最后兩層網(wǎng)絡(luò)結(jié)構(gòu),確保網(wǎng)絡(luò)結(jié)構(gòu)的相關(guān)參數(shù)與我們預(yù)期網(wǎng)絡(luò)結(jié)構(gòu)一致。因此網(wǎng)絡(luò)的最后兩層被修改為:

(argpool) ArgPool2d(kernel_ size = 7 , stride = 1 , padding = 0)

(fc) Linear(in_ feature = 2048 , out_ feature = 1000 , bias = True)?

對于模型末尾的卷積層,我們直接進(jìn)行全局池化,得到圖像全局特征圖像特征(大小為(32,2048,8,4))。之后為了得到局部特征,我們再次將全局特征在水平方向上再次池化, 從每一行特征中提取一個局部特征(大小為(32,2048,1,1)),最后得到一幅圖像的全局特征和局部特征。圖像的最終全局特征由兩部分組成,首先是基于三元組損失函數(shù)計(jì)算全局特征的結(jié)果。之后利用中心損失優(yōu)化了SoftMax損失的計(jì)算結(jié)果,減小了分類結(jié)果的類內(nèi)間距。然后我們把這兩種損失相加得到最終的全局損失。局部損失則通過對水平分割后的特征進(jìn)行一個由上而下的動態(tài)匹配過程得到。最終三個損失相加得到網(wǎng)絡(luò)的損失函數(shù):

??????????? ???????? = ?????????????? ???????? + \???????????? ???????? ??????????? ? ???????????? ???????? + ?????????????? ?????????

在困難樣本的挖掘中,仍然使用全局特征進(jìn)行挖掘,這是因?yàn)榕c局部特征相比、全局特征的處理比較快,并且沒有明顯的結(jié)果差異。

局部特征獲取詳解(Local loss—Aligned Reid )

在這個過程中我們已經(jīng)將圖片水平分割并且進(jìn)行池化得到局部feature map,接下來重要的一步就是將兩張圖片之間的特征進(jìn)行匹配,其過程如圖所示, 顯示了一次從上到下的動態(tài)對齊過程,虛線代表第一次匹配而實(shí)線代表最終匹配的切片:

我們定義兩幅圖像之間的距離是從點(diǎn)(1,1)到點(diǎn) (H,H)在路徑圖矩陣中的最短路徑之和,找尋路徑的過程如下所示:

其計(jì)算公式如下:

最終結(jié)果

與人類精度對比

與其他網(wǎng)絡(luò)結(jié)果對比

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容