﻿ 对抗样本三元组约束的度量学习算法
«上一篇
 文章快速检索 高级检索

 智能系统学报  2021, Vol. 16 Issue (1): 30-37  DOI: 10.11992/tis.202009050 0

### 引用本文

WANG Xin, GUO Xinyao, WEI Wei, et al. Metric learning algorithm with adversarial sample triples constraints[J]. CAAI Transactions on Intelligent Systems, 2021, 16(1): 30-37. DOI: 10.11992/tis.202009050.

### 文章历史

1. 山西大学 计算机与信息技术学院，山西 太原 030006;
2. 山西大学 计算智能与中文信息处理教育部重点实验室，山西 太原 030006

Metric learning algorithm with adversarial sample triples constraints
WANG Xin 1, GUO Xinyao 1, WEI Wei 1,2, LIANG Jiye 1,2
1. School of Computer and Information Technology, Shanxi University, Taiyuan 030006, China;
2. Key Laboratory of Computational Intelligence and Chinese Information Processing of Ministry of Education, Shanxi University, Taiyuan 030006, China
Abstract: Most of the existing metric learning algorithms with triple constraints use prior knowledge to construct constraints, which restricts the performance of metric learning algorithms to a certain extent. To solve this problem, the metric learning algorithm with adversarial sample triple constraints, named ASTCML, is proposed based on the idea of sample perturbation in adversarial training, in which the adversarial sample is learned near the original sample to construct adversarial triple constraints. The metric learning model is constructed on the basis of adversarial triples and original triples constraints. Experimental results show that the proposed algorithm overcomes the effect of prior knowledge that is problematic for existing fixed constraint methods and improves the classification accuracy. This shows that distinguishing triple constraints that are more difficult to distinguish can improve the performance of the algorithm.
Key words: machine learning    metric learning    triplet constraints    adversarial training    Mahalanobis distance    sample perturbation    convex optimization    gradient descent

1) 通过在三元组中的入侵样本附近学习对抗样本，构造了间隔更小的对抗样本三元组约束；

2) 构造的对抗样本学习优化模型具有闭式解；

3) 实验结果表明提出算法的性能优于代表性的三元组度量学习算法。

1 约束构建的相关算法 1.1 三元组约束构建

1.2 对抗度量学习

AML算法通过对同类样本生成同类彼此相距甚远的对抗样本对，而异类样本生成异类彼此相对较近的对抗样本对来增强算法的鲁棒性。然而，由于需要为每一个二元约束构建对抗样本对，仅用单个参数来控制对抗样本的学习，使其参数难以调整，且构建的对抗样本对绝大多数是无效的。

2 对抗样本三元组约束的度量学习

2.1 模型构建

 $\min \sum\limits_{(i,j,l) \in {\cal{N}}} {{{{d_M}}}({{{x}}_i},{{{{\pi}}} _{il}})} + \alpha \sum\limits_{(i,j,l) \in {\cal{N}}} {{{{d_M}}}({{{{{\pi}}}} _{il}},{{{x}}_l})}$ (1)

 $\begin{array}{l} \min (1 - \mu )\displaystyle\sum\limits_{i,j\sim i} {{{{d_M}}}({{{x}}_i},{{{x}}_j})} + \mu \displaystyle\sum\limits_{i,j\sim i} {\displaystyle\sum\limits_l {(1 - {y_{il}}){\xi _{ijl}}} } \\ \;\;\;\;{\rm{s.t.}}\;\;\;{{{d_M}}}({{{x}}_i},{{{\pi}}_{il}}) - {{{d_M}}}({{{x}}_i},{{{x}}_j}) \geqslant 1 - {\xi _{ijl}}\geqslant 0\\ \;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\;\; {{M}}\geqslant 0 \end{array}$ (2)

2.2 优化问题求解

 ${{{{\text{π}}}} _{il}} = \frac{1}{{\alpha + 1}}{{{{x}}}_i} + \frac{\alpha }{{\alpha + 1}}{{{{x}}}_l}, (i,j,l) \in {\cal{N}}$ (3)

 $\begin{split} {{L}} =& (1 - \mu )\displaystyle\sum\limits_{i,j \sim i} {{{{d}}_{{M}}}({{{x}}_i},{{{x}}_j})} + \\ &\mu \displaystyle\sum\limits_{i,j \sim i} {\displaystyle\sum\limits_l {(1 - {y_{il}}){{[1 + {{{d}}_{{M}}}({{{x}}_i},{{{x}}_j}) - {{{d}}_{{M}}}({{{x}}_i},{{{{{\pi}} }}_{il}})]}_ + }} } \end{split}$ (4)

 $\begin{split} \dfrac{{\partial {{L}}}}{{\partial {{M}}}} =& (1 - \mu )\displaystyle\sum\limits_{i,j \sim i} {{{{X}}_{ij}}} + \\ &\mu \displaystyle\sum\limits_{(i,j,l) \in {\cal J}} {{{{X}}_{ij}} - \left( {\left( {{{\left( {\dfrac{\alpha }{{\alpha + 1}}} \right)}^2} - 1} \right){{[\xi _{ijl}^{{\rm{ori}}}]}_ + } + 1} \right){{{X}}_{il}}} \end{split}$ (5)

1) 根据式(5)计算梯度 $\nabla {{{G}}_{{t}}}$

2) 更新梯度 ${{{M}}_{t + 1}} = {{{M}}_t} - \lambda \nabla {{{G}}_{{t}}}$

3) 将 ${{{M}}_{t + 1}}$ 进行分解，得到 ${{U}},{{{V}}_ + }$

4) ${{{M}}_{t + 1}} = {{{U}}^{\rm{T}}}{{{V}}_ + }{{U}}$

5) 直到收敛。

3 实验分析

3.1 实验数据与设计

3.2 实验结果与分析

3.3 参数的灵敏度分析

3.4 收敛性分析

 Download: 图 3 不同 $\mu$ 下的分类精度 Fig. 3 Classification accuracy under different $\mu$ values
 Download: 图 4 不同 $\beta$ 下的分类精度 Fig. 4 Classification accuracy under different $\beta$ values
 Download: 图 5 损失值变化情况 Fig. 5 Change of loss value on different data sets
4 结束语

 [1] QIAN Qi, JIN Rong, ZHU Shenghuo, et al. Fine-grained visual categorization via multi-stage metric learning[C]//2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR). Boston, USA, 2015: 3716–3724. (0) [2] GAO Yue, WANG Meng, JI Rongrong, et al. 3-D object retrieval with hausdorff distance learning[J]. IEEE transactions on industrial electronics, 2014, 61(4): 2088-2098. DOI:10.1109/TIE.2013.2262760 (0) [3] HOI S C H, LIU W, CHANG S F. Semi-supervised distance metric learning for collaborative image retrieval[C]//2008 IEEE Conference on Computer Vision and Pattern Recognition. Anchorage, AK, USA, 2008: 1–7. (0) [4] HOI S C H, LIU W, LYU M R, et al. Learning distance metrics with contextual constraints for image retrieval[C]//2006 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR'06). New York, NY, USA, 2006: 2072–2078. (0) [5] DONG Yanni, DU Bo, ZHANG Liangpei, et al. Hyperspectral target detection via adaptive information-theoretic metric learning with local constraints[J]. Remote sensing, 2018, 10(9): 1415. DOI:10.3390/rs10091415 (0) [6] DONG Yanni, DU Bo, ZHANG Liangpei. Target detection based on random forest metric learning[J]. IEEE journal of selected topics in applied earth observations and remote sensing, 2015, 8(4): 1830-1838. DOI:10.1109/JSTARS.2015.2416255 (0) [7] DONG Yanni, DU Bo, ZHANG Lefei, et al. Local decision maximum margin metric learning for hyperspectral target detection[C]//2015 IEEE International Geoscience and Remote Sensing Symposium (IGARSS). Milan, Italy, 2015: 397–400. (0) [8] HU Junlin, LU Jiwen, YUAN Junsong, et al. Large margin multi-metric learning for face and kinship verification in the wild[C]//12th Asian Conference on Computer Vision. Singapore, Singapore, 2015: 252–267. (0) [9] LU Rui, WU Kailun, DUAN Zhiyao, et al. Deep ranking: triplet MatchNet for music metric learning[C]//2017 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP). New Orleans, USA, 2017: 121–125. (0) [10] XING E P, NG A Y, JORDAN M I, et al. Distance metric learning, with application to clustering with side-information[C]//Proceedings of the 15th International Conference on Neural Information Processing Systems. Cambridge, MA, USA, 2002: 521–528. (0) [11] YING Yiming, LI Peng. Distance metric learning with eigenvalue optimization[J]. The journal of machine learning research, 2012, 13(1): 1-26. (0) [12] DAVIS J V, KULIS B, JAIN P, et al. Information-theoretic metric learning[C]//Proceedings of the 24th International Conference on Machine Learning. Corvallis, Oregon, USA, 2007: 209–216. (0) [13] ZADEH P H, HOSSEINI R, SRA S. Geometric mean metric learning[C]//Proceedings of the 33rd International Conference on Machine Learning. New York, NY, USA, 2016: 2464–2471. (0) [14] OMARA I, ZHANG Hongzhi, WANG Faqiang, et al. Metric learning with dynamically generated pairwise constraints for ear recognition[J]. Information, 2018, 9(9): 215. DOI:10.3390/info9090215 (0) [15] WEINBERGER K Q, BLITZER J, SAUL L. K. Distance metric learning for large margin nearest neighbor classification[M]. WEISS Y, SCHÖLKOPF B, PLATT J. Advances in Neural Information Processing Systems. Cambridge, MA: MIT Press, 2006: 1473–1480. (0) [16] WEINBERGER K Q, SAUL L K. Distance metric learning for large margin nearest neighbor classification[J]. The journal of machine learning research, 2009, 10: 207-244. (0) [17] 杨柳, 于剑, 景丽萍. 一种自适应的大间隔近邻分类算法[J]. 计算机研究与发展, 2013, 50(11): 2269-2277. YANG Liu, YU Jian, JING Liping. An adaptive large interval nearest neighbor classification algorithm[J]. Journal of computer research and development, 2013, 50(11): 2269-2277. DOI:10.7544/issn1000-1239.2013.20120356 (0) [18] SONG Kun, NIE Feiping, HAN Junwei, et al. Parameter free large margin nearest neighbor for distance metric learning[C]//The 31st AAAI Conference on Artificial Intelligence. San Francisco, USA, 2017: 2555–2561. (0) [19] LIU Meizhu, VEMURI B C. A robust and efficient doubly regularized metric learning approach[C]//12th European Conference on Computer Vision. Florence, Italy, 2012: 646–659. (0) [20] LE CAPITAINE H. Constraint selection in metric learning[J]. Knowledge-based systems, 2018, 146(15): 91-103. (0) [21] PERROT M, HABRARD A. Regressive virtual metric learning[C]//Advances in Neural Information Processing Systems. Montréal, Canada, 2015: 1810–1818. (0) [22] WANG Faqiang, ZUO Wangmeng, ZHANG Lei, et al. A kernel classification framework for metric learning[J]. IEEE transactions on neural networks and learning systems, 2015, 26(9): 1950-1962. DOI:10.1109/TNNLS.2014.2361142 (0) [23] ZUO Wangmeng, WANG Faqiang, ZHANG D, et al. Distance metric learning via iterated support vector machines[J]. IEEE transactions on image processing, 2017, 26(10): 4937-4950. DOI:10.1109/TIP.2017.2725578 (0) [24] MEI Jiangyuan, LIU Meizhu, KARIMI H R, et al. LogDet divergence-based metric learning with triplet constraints and its applications[J]. IEEE transactions on image processing, 2014, 23(11): 4920-4931. DOI:10.1109/TIP.2014.2359765 (0) [25] CHEN Shuo, GONG Chen, YANG Jian, et al. Adversarial metric learning[C]//Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence. Stockholm, Sweden, 2018: 2021–2027. (0)