阅读小结Deep Metric Learning via Lifted Structured Feature Embedding

原作者的github code:https://github.com/rksltnl/Deep-Metric-Learning-CVPR16

What:

这是一篇讲图像retrieval的工作,其实也可以用运用于细力度(finegrain)的分类问题。也就是通过一张图片去搜索相关图片。比较直观的问题在于图像的传统问题

-类内差异 (比如同一物体在不同pose下的照片,可能一点都不像) -类间相似(比如不同物体在同一pose下的照片,反倒是很像)

然后比较diao的地方是,zero-shot learning没有学习过,直接test(和以前我们常用的vgg模型提取特征的感觉一样,先在一个大数据集上统计学习了一下,随后应用到了新问题上的感觉)


Motivation:

1.传统的分类算法克服不了 多分类(由于模型复杂度和分类数量相关,会过于复杂)和数据bias(比如某一类数据特别少的问题)

2.metric learning可以克服第二个问题,因为学到的是每一类的general concept,所以数据少也能学。

3.deeplearning可以克服第一个问题。但deeplearning在类内差异做的比较好,类间相似不能take full advantage(其实softmax loss有类间差异,因为分母有所有的类)

4.提出的算法lift每个batch中的差异从O(m)到O(m^2),设计了一个新的loss目标。

在摘要中写到:

In this paper, we describe analgorithm for taking full advantage of the training batchesin the neural network trainingby lifting the vector of pair-wise distances within the batch to the matrix of pairwisedistances.  

说到底就是要更discriminative!


Review:首先我们回顾一下几个东西:

1.contrast embeding

作者给出了一个公式:input是一对数据xi和xj


y是这一对的groundtruth,比方说xi,xj是不是同一类,那么y就对应的是0或者1.

f()是xi和xj的运算(比如把x输入神经网络,取出fc层的结果,这么一个函数)

D是f(xi)和f(xj)的欧式距离。那么优化这个loss,min(J),当xi和xj是同一类的时候,yij是1,那么Dij应该越小越好;如果不是同一类,yij是0,Dij应该约大越好。


2.triplet loss


这次输入为三元组{xa,xp,xn}

xa和xp是同一类,和xn不同类。所以Dap应该越小越好,Dan越大越好。所以也是优化min(J)


然后下面是一张有趣的图,说明了作者Lift与前两种的不同。(前两种loss在刻画关系上是不足的)




对应的Loss如下:




先看下面的公式:

后一项为数据i,j之间的距离,

前一项为数据i最难区分的k和数据j最难区分的数据l的距离中较大者。。(比较绕,但看公式比较容易明白,找最难分辨的一条边,而之前triplet loss固定了这条边)


所以

1.每次train的时候都是最难的边或者说pair(容易混淆的两个东西)

2.利用了整的minibatch的信息而不是固定pair

相当于O(m)变为了现在的O(m^2)pairs 一个完全图


一般来说,接下去,我们写了一个矩阵运算,就是 (x1-x2)^2 = x1^2+x2^2-2x1x2 以矩阵的形式表达,然后每次求一下最close的negative是谁就好了。

但作者又提出说,batch是随机切的,那么信息是有限的。大多数情况下,minibatch中没有那些最难的。

所以作者没有使用random的batch,而是采用随机的取出一些positive pair,然后动态的找他们最难的边(因为模型也在调整)。


然后为了防止过拟合将max函数换成log和exp(依旧是增函数)


Part I Metric Searching in a Nutshell Overview 3 1. FOUNDATIONS OF METRIC SPACE SEARCHING 5 1 The Distance Searching Problem 6 2 The Metric Space 8 3 Distance Measures 9 3.1 Minkowski Distances 10 3.2 Quadratic Form Distance 11 3.3 Edit Distance 12 3.4 Tree Edit Distance 13 3.5 Jaccard’s Coefficient 13 3.6 Hausdorff Distance 14 3.7 Time Complexity 14 4 Similarity Queries 15 4.1 Range Query 15 4.2 Nearest Neighbor Query 16 4.3 Reverse Nearest Neighbor Query 17 4.4 Similarity Join 17 4.5 Combinations of Queries 18 4.6 Complex Similarity Queries 18 5 Basic Partitioning Principles 20 5.1 Ball Partitioning 20 5.2 Generalized Hyperplane Partitioning 21 5.3 Excluded Middle Partitioning 21 5.4 Extensions 21 6 Principles of Similarity Query Execution 22 6.1 Basic Strategies 22 6.2 Incremental Similarity Search 25 7 Policies for Avoiding Distance Computations 26 7.1 Explanatory Example 27 7.2 Object-Pivot Distance Constraint 28 7.3 Range-Pivot Distance Constraint 30 7.4 Pivot-Pivot Distance Constraint 31 7.5 Double-Pivot Distance Constraint 33 7.6 Pivot Filtering 34 8 Metric Space Transformations 35 8.1 Metric Hierarchies 36 8.1.1 Lower-Bounding Functions 36 8.2 User-Defined Metric Functions 38 8.2.1 Searching Using Lower-Bounding Functions 38 8.3 Embedding Metric Space 39 8.3.1 Embedding Examples 39 8.3.2 Reducing Dimensionality 40 9 Approximate Similarity Search 41 9.1 Principles 41 9.2 Generic Algorithms 44 9.3 Measures of Performance 46 9.3.1 Improvement in Efficiency 46 9.3.2 Precision and Recall 46 9.3.3 Relative Error on Distances 48 9.3.4 Position Error 49 10 Advanced Issues 50 10.1 Statistics on Metric Datasets 51 10.1.1 Distribution and Density Functions 51 10.1.2 Distance Distribution and Density 52 10.1.3 Homogeneity of Viewpoints 54 10.2 Proximity of Ball Regions 55 10.3 Performance Prediction 58 Contents ix 10.4 Tree Quality Measures 60 10.5 Choosing Reference Points 63 2. SURVEY OF EXISTING APPROACHES 67 1 Ball Partitioning Methods 67 1.1 Burkhard-Keller Tree 68 1.2 Fixed Queries Tree 69 1.3 Fixed Queries Array 70 1.4 Vantage Point Tree 72 1.4.1 Multi-Way Vantage Point Tree 74 1.5 Excluded Middle Vantage Point Forest 75 2 Generalized Hyperplane Partitioning Approaches 76 2.1 Bisector Tree 76 2.2 Generalized Hyperplane Tree 77 3 Exploiting Pre-Computed Distances 78 3.1 AESA 78 3.2 Linear AESA 79 3.3 Other Methods 80 4 Hybrid Indexing Approaches 81 4.1 Multi Vantage Point Tree 81 4.2 Geometric Near-neighbor Access Tree 82 4.3 Spatial Approximation Tree 85 4.4 M-tree 87 4.5 Similarity Hashing 88 5 Approximate Similarity Search 89 5.1 Exploiting Space Transformations 89 5.2 Approximate Nearest Neighbors with BBD Trees 90 5.3 Angle Property Technique 92 5.4 Clustering for Indexing 94 5.5 Vector Quantization Index 95 5.6 Buoy Indexing 97 5.7 Hierarchical Decomposition of Metric Spaces 97 5.7.1 Relative Error Approximation 98 5.7.2 Good Fraction Approximation 98 5.7.3 Small Chance Improvement Approximation 98 5.7.4 Proximity-Based Approximation 99 5.7.5 PAC Nearest Neighbor Search 99 x SIMILARITY SEARCH Part II Metric Searching in Large Collections of Data Overview 103 3. CENTRALIZED INDEX STRUCTURES 105 1 M-tree Family 105 1.1 The M-tree 105 1.2 Bulk-Loading Algorithm of M-tree 109 1.3 Multi-Way Insertion Algorithm 112 1.4 The Slim Tree 113 1.4.1 Slim-Down Algorithm 114 1.4.2 Generalized Slim-Down Algorithm 116 1.5 Pivoting M-tree 118 1.6 The M
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Layumi1993

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值