楊建偉,嚴振華,王彩玲




摘? 要: 為了提高無監督嵌入學習對圖像特征的判別能力,提出一種基于深度聚類的無監督學習方法。通過對圖像的嵌入特征進行聚類,獲得圖像之間的偽類別信息,然后最小化聚類損失來優化網絡模型,使得模型能夠學習到圖像的高判別性特征。在三個標準數據集上的圖像檢索性能表明了該方法的有效性,并且優于目前大多數方法。
關鍵詞: 無監督學習; 嵌入學習; 深度聚類
中圖分類號:TP391? ? ? ? ? 文獻標識碼:A? ? ?文章編號:1006-8228(2022)01-19-03
Unsupervised feature embedding learning via deep clustering
Yang Jianwei1, Yan Zhenhua2, Wang Cailing1
(1. School of Automation of Nanjing University of Posts and Telecommunications, Nanjing, Jiangsu, 210023, China;
2. Wuerth Electronic Tianjin Co,.ltd.)
Abstract: In order to improve the ability of unsupervised embedding learning to distinguish image features, an unsupervised method based on deep clustering is proposed. By clustering the embedded features of images, the pseudo category information between images is obtained, and then the clustering loss is minimized to optimize the network model, so that the model can learn the high discriminant features of images. The performance of image retrieval on three standard data sets shows that the proposed method is effective and better than most of the current methods.
Key words: unsupervised learning; embedding learning; deep clustering
0 引言
深度嵌入學習旨在利用深度神經網絡從圖像中學習一種具有判別性的低維嵌入特征,這種嵌入特征具有兩種屬性。①正集中:屬于同一類別的樣本的嵌入特征應當彼此靠近。②負分離:屬于不同類別的樣本的嵌入特征應當盡可能的彼此遠離[1-5]。隨著深度學習的快速發展,監督嵌入學習在許多計算機視覺任務上展現出了優異的表現,如圖像檢索[6-8],人臉識別[9],目標跟蹤[10]以及行人重識別[11-12]等。為了獲得更好的性能表現,監督嵌入學習需要依賴于大規模標記數據。然而,為不同的視覺任務收集和標注大規模數據集耗費了大量的人力物力,尤其對于細粒度圖像數據集的標注,更是需要領域內的專家才能完成。因此,以無監督的方式直接、自動地對圖像進行特征學習是一項非常重要而又富有挑戰性的任務,且已經成為機器學習和計算機視覺領域的研究熱點。
無監督嵌入學習要求學習到的嵌入特征之間的相似性與輸入樣本的視覺相似性或類別關系保持一致。MOM[13]是最早被提出的用于無監督嵌入學習的方法,它以完全無監督的形式在流形空間中挖掘正負樣本。然而,這種方法嚴重依賴于網絡的初始化表征。AND[14]通過挖掘最近鄰樣本來改善樣本之間的相似性,但是,最近鄰挖掘會不可避免的引入錯誤樣本。最近,基于實例監督的方法在無監督嵌入學習中流行起來。例如,ISIF[15]和PSLR[16]把每個樣本實例及其增強之后的樣本看成是一個單獨的類,不同的實例看成是負樣本,在Softmax函數上直接優化實例特征。然而,這類方法只能提供有限的監督信號,并且容易使模型發生過擬合現象。
本文為無監督嵌入學習提出了一種深度聚類框架,通過對圖像嵌入特征進行聚類,從而獲得圖像之間的偽類別信息,然后最小化聚類損失來優化網絡模型,從而達到正集中和負分離的目的。在三個標準數據集上做了大量的實驗,結果表明本文提出的方法提高了模型對圖像的判別能力,性能優于目前大多數方法。
1 深度聚類
給定一個無標注的圖像集合[X={x1,x2,…,xn}],我們的目標是訓練一個特征提取網絡[fθ(?)],該網絡將輸入圖像[xi]映射成一個具有高判別性的嵌入特征[fθ(xi)∈Rl],其中[θ]是網絡參數,[l]是特征維度。所有的特征都被[l2]規范化,即[||fθ(xi)||=1]。良好的嵌入特征需要滿足正集中和負分離兩個特點。
在監督嵌入學習中,通常采用在ImageNet[17]上預訓練的網絡作為特征提取網絡,原因在于它能提供良好的監督信號。我們的思想是利用這種信號將嵌入空間的特征聚成[k]個類。第一步,從嵌入空間[Rl]中任選一個特征[fθ(xi)]作為第一個初始化中心。第二步,為了避免空類,盡量選擇與已有的[m]個中心距離較遠的特征作為下一個中心,采用歐式距離表示為:
[D(i)=minfθ(xi)-cj2,? ?j=1, 2, …, m]? ⑴
因此,一個特征被選為下一個中心的概率為:
[P(i)=D(i)2i=1nD(i)2] ⑵
第三步,重復第二個步驟直到選擇出[k]個中心[C=c1,c2,…,ck]。通過解決以下問題來共同學習一個[l×k]的中心矩陣[C]和圖像的偽標簽[yi]:
[minC∈Rl×k1ni=1nminyi∈{0,1}kfθ(xi)-Cyi22]
[s.t.? ? yΤi1k=1] ⑶
從而,得到了一組最優的類中心[C*]和偽標簽[y*i]。
在嵌入特征空間中,我們希望類內樣本特征是緊湊的,并且類和類之間有很大的間隔。因此,對于任一特征[fθ(xi)],找到與之距離最近的類中心,記為[c+],它們之間的距離記為[d+=fθ(xi)-c+2],接著找到與之距離第二近的類中心,記為[c-],它們之間的距離記為[d-=fθ(xi)-c-2]。如果比值[d+/d-]越小,則特征更具有判別力。因此,聚類損失定義為:
[Lc=1Ni=1nfθ(xi)-c+2fθ(xi)-c-2]? ⑷
在訓練過程中,網絡和圖像特征逐步更新,聚類中心每20 Epochs 更新一次。
2 實驗
2.1 數據集介紹
本文采用CUB200[18],Cars196[19]和SOP[20]三個標準數據集來評估所提出的方法。CUB200是一個包含200個類別的鳥類圖像數據集,其中前100個類用來訓練,剩余100個類用來測試。Cars196是一個包含196個類別的汽車類圖像數據集。其中前98個類用來訓練,其余98個類用來測試。SOP是一個包含22634個類別的大規模產品數據集,其中前11318個類別用來訓練,其余11316個類別用來測試。
2.2 實驗設置
實驗采用在ImageNet上預訓練后的GoogLeNet[21]作為特征提取網絡,并對網絡進行微調。在網絡的全局池化層之后加上一個512維的全連接層作為輸出層。在訓練階段,所有圖像被裁剪為227*227大小;在測試階段,每個圖像被中心裁剪之后作為測試輸入。使用0.9動量的Adma優化器[22]并將權重衰減設置為0.0005。對于聚類模塊,為CUB200和Cars196設置100個聚類中心,為SOP設置10000個聚類中心。整個網絡在NVIDIA GeForce RTX 2080Ti GPUs上訓練,采用圖像檢索表現R@K作為標準的評估度量。
2.3 實驗結果
表1至表3列舉了在CUB200,Cars196和SOP三個數據集上的定量結果,可以看出,我們提出的方法在三個基準上的表現整體優于其他方法。另外,在表3中可以看到,我們的方法在R@1精度指標下超過最新的方法7.2%,進一步說明了所提方法在大規模數據集上的有效性。
3 結束語
本文提出了一種基于深度聚類的無監督嵌入學習方法,該方法通過對圖像特征進行聚類,從而獲得圖像間的偽類別信息,然后最小化聚類損失函數,使得網絡模型輸出具有高判別性的圖像特征。在三個標準數據集上的實驗結果表明,本文提出的方法有效地改善了無監督嵌入學習能力,并且其性能優于目前大多數方法。
參考文獻(References):
[1] Manmatha R, Wu C, Smola A, et, al. Sampling matters in deep embedding learning[C] // IEEE International Conference on Computer Vision (ICCV),2017:2859-2867
[2] Song H, Xiang Y, Jegelka S, and Savarese S, et, al. Deep metric learning via lifted structured feature embedding [C] //IEEE Conference on Computer Vision and Pattern Recognition (CVPR),2016:4004-4012
[3] Wang X, Han X, Huang W, et, al. Multi-similarity loss with general pair weighting for deep metric learning [C] // IEEE Conference on Computer Vision and Pattern Recognition (CVPR),2019:5022-5030
[4] Zhou T, Fu H, Gong C, et, al. Multi-mutual consistency induced transfer subspace learning for human motion segmentation[C] //IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR),2020:10277-10286
[5] Li T, Liang Z, Zhao S, et, al. Self-learning with rectification strategy for human parsing [C] // IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR),2020
[6] Woo S, Park J, Lee J, et, al. Learning descriptors for object recognition and 3d pose estimation [C] // IEEE Conference on Computer Vision and Pattern Recognition (CVPR),2015:3109-3118
[7] He X, Zhou Y, Zhou Z, et, al. Triplet-center loss for multi-view 3d object retrieval [C] // IEEE Conference on Computer Vision and Pattern Recognition(CVPR),2018:1945-1954
[8] Grabner A, Roth P, Lepetit V. 3d pose estimation and 3d model retrieval for objects in the wild [C] // IEEE Conference on Computer Vision and Pattern Recognition (CVPR),2018:3022-3031
[9] Wen Y, Zhang K, Li Z, et, al. A discriminative feature learning approach for deep face recognition [C] // European Conference on Computer Vision (ECCV),2016:499-515
[10] Tao R, Gavves E, Smeulders A. Siamese instance search for tracking [C] // IEEE Conference on Computer Vision and Pattern Recognition (CVPR),2016:1420-1429
[11] Yu R, Dou Z, Bai S, et, al. Hard-aware point-to-set deep metric for person re-identification [C] // European Conference on Computer Vision (ECCV),2018:188-204
[12] Hermans A, Beyer L Leibe B. In defense of the triplet loss for person re-identification[EB/OL].arXiv preprint arXiv:1703.07737,2017
[13] Iscen A, ToliaS G, Avrithis Y, et, al. Mining on manifolds: metric learning without labels [C] // IEEE Conference on Computer Vision and Pattern Recognition (CVPR),2018:7642-7651
[14] Huang J, Dong Q, Gong S, et, al. Unsupervised deep learning by neighbourhood discovery [C] // ACM International Conference on Machine Learning (ICML),2018:7642-7651
[15] Ye M, Zhang X, Yuen P, et, al. Unsupervised embedding learning via invariant and spreading instance feature [C] // IEEE Conference on Computer Vision and Pattern Recognition (CVPR),2019:6210-6219
[16] Ye M, Shen J. Probabilistic structural latent representa-tion for unsupervised embedding [C] // IEEE Conference on Computer Vision and Pattern Recognition (CVPR),2020:5457-5466
[17] Deng J, Dong W, Socher R, et, al. A large-scale hierarchical image database [C] // IEEE Conference on Computer Vision and Pattern Recognition (CVPR),2009:248-255
[18] Wah C, Branson S, Welinder P, et, al. Caltech-UCSD birds 200[R]. California Institute of Technology,2010
[19] Krause J, Stark M, Deng J, et, al. 3D object representations for fine-grained categorization [C] // IEEE International Conference on Computer Vision Workshops (ICCVW),2013:554-561
[20] Khosla A, Jayadevaprakash N, Yao B, et, al. Novel dataset for fine-grained image categorization[C]//IEEE Conference on Computer Vision and Pattern Recognition (CVPR),2011
[21] Szegedy C, Liu W, Jia Y, et al. Going deeper with convolutions [C] // IEEE Conference on Computer Vision and Pattern Recognition (CVPR),2015
[22] Kingma D P, Ba J. Adam: a method for stochastic optimization[EB/OL]. arXiv preprint arXiv:1412.6980,2015