图像检索:CNN对Hash组算法的颠覆

参看论文:Liu H, Wang R, Shan S, et al. Deep Supervised Hashing for Fast Image Retrieval[C]. computer vision and pattern recognition, 2016: 2064-2072.

会议水平:CVPR2016

供稿单位:中科院计算所 (中科院计算所、自动化所都是做图像处理的神一样的单位,各种CVPR、各种姿势)

1.导读

自从孪生网络又被大家捡起来哪一天(2014),就注定了和匹配相关领域的不平静,无论是图像检索、立体匹配还是基于最佳匹配的跟踪,孪生网络及其衍生分支网络正在一点点颠覆几乎所有的经典算法。由Haomiao Liu报道的深度监督哈希算法短短一年多就收获了134的引用量,大部分的相关工作都是在该基础之上开展的,所以很有必要研究。

Hash,就是把任意长度的输入通过散列算法变换成固定长度的输出,该输出就是散列值。这种转换是一种压缩映射,也就是,散列值的空间通常远小于输入的空间,不同的输入可能会散列成相同的输出,所以不可能从散列值来确定唯一的输入值。简单的说就是一种将任意长度的消息压缩到某一固定长度的消息摘要的函数。

2. 摘要及目标

为了在大数据上开发高效的图像检索算法,作者提出了一种新的Hashing方法用于学习图像紧密的二值编码。在图像检索领域,尽管图像的形貌变化带来非常大的挑战,但是利用CNN学习一个鲁棒性的图像表达为解决这个挑战带来了曙光。这边文章就是利用CNN来学习高相似紧凑的二值编码形式,也就是原文作者提到的深度监督Hashing。特别的,作者设计了CNN结构,利用一对图像输入,输出判别分类。(现在看来似乎很简单,但放在16年,确实不容易)。作者精心设计了损失函数,用于最大化判别性能。

Our goal is to learn compact binary codes for imagessuch that: (a) similar images should be encoded to similar binary codes in Hamming space, and vice versa; (b) the binary codes could be computed efficiently。

Our method first trains the CNN using image pairs and the corresponding similarity labels. (创新点来了,鼻祖...)
 

以下几句真是写出了艺术啊...

While the complex image appearance variations still pose a great challenge to reliable retrieval, in light of the recent progress of Convolutional Neural Networks (CNNs) in learning robust image representation on various vision tasks, this paper proposes a novel Deep Supervised Hashing (DSH) method to learn compact similarity-preserving binary code for the huge body of image data.

尽管复杂的图像形貌变化对图像检索而言是一个巨大的挑战,得益于最近卷机神经网络在各种视觉问题学习鲁棒性性的图像表达的进展, 我们提出一种新的深度监督hashing方法用于学习紧凑相似的二值编码信息。


To this end, a loss function iselaborately designed to maximize the discriminability of the output space by encoding the supervised information from the input image pairs, and simultaneously imposing regularization on the real-valued outputs to approximate the desired discrete values.

最后,精心设计的损失函数去最大化编码信息的输出空间,这些监督信息是从图像对中学习到的,同时对输出施加正则化,让输出迫近离散值(金标准标签)。
 

Extensive experiments on two large scale datasets CIFAR-10 and NUS-WIDE show the promising performance of our method compared with the state-of-the-arts

Comment:我发现CVPR的审稿委员会就喜欢the promising performance 和 the state-of-the-arts 这两个词;吹得过分的和太过谦虚的被拒稿了。

3. 方法及细节

Figure 1. The network structure used in our method. The network consists of 3 convolution-pooling layers and 2 fully connected layers. The filters in convolution layers are of size 5 × 5 with stride 1 (32, 32, and 64 filters in the three convolution layers respectively), and pooling over 3 × 3 patches with stride 2. The first fully connected layer contains 500 nodes, and the second (output layer) has k (the code length) nodes. The loss function is designed to learn similarity-preserving binary-like codes by exploiting discriminability terms and a regularizer. Binary codes are obtained by quantizing the network outputs of images.

图1. 作者方法中的网络框架。这个网络包含3个卷积-池化层 和 两个全连接层。

3.1 损失函数设计

The loss function is designed to pull the network outputs of similar images together and push the outputs of dissimilar ones far away, so that the learned Hamming space can well approximate the semantic structure of images.

设计的损失函数驱动网络对相同的图像输出距离很近,对不同图像输出距离很远。
To avoid optimizing the nondifferentiable loss function in Hamming space, the network outputs are relaxed to real values, while simultaneously a regularizer is imposed to encourage the real-valued outputs to approach the desired discrete values.
为了避免在hamming空间优化不可微分的损失函数,网络输出轻松转为实数值,同时采用了正则化,使得实数值输出更加贴近离散值{-1, +1}.

Comment:我之前也在思考,为什么在hamming空间存在不可微分的情况,其实做着这样描述是非常保守的。粗鲁一点就是K长度的Hamming二值编码,你告诉我怎么设计金标准?怎么设计损失函数?怎么进行求偏导数,误差传播?如果对这个问题陷入了深思,那就别扯了,直接把二值编码变成实数值就好了,这个原理就相当于在最后一层加载了一个全连接层,而这个全连接层刚好只有一个神经元,只此而已。

b1,b2是一对图象输入。y是标签,y=0表示相似,也 表示不相似。Dh是两个二值编码矢量的hamming距离。m>0是一个margine值。前一项惩罚相似图像对,后一项惩罚不相似图像对

为了便于设计反向传播,作者用了L2-norm:

这里重点看第三项,该项最大的一个好处在于对特征的紧凑型进行了约束,如果特征很稀疏,那么该项惩罚值很大。

这个求偏导过程也就很顺利:

3.2 应用细节

1. 所有的卷积层作者都利用了ReLU进行调整

2.During training, the batch size is set to 200, momentum to 0.9, and weight decay to 0.004. The initial learning rate is set to 10-3 and decreases by 40% after every 20,000 iterations (150,000 iterations in total). The margin m in Eqn.(4) is heuristically set to m = 2k to encourage the codes of dissimilar images to differ in no less than k2 bits.

Comment:这里要说明一点,作者发表这篇文章的时候,BatchNorm还没有广泛应用,后来有人进做了一点点的结构更改,性能取得了非常大的提升。

4. 结果

We attribute the promising retrieval performance of DSH to three aspects: First, the coupling of non-linear feature learning and hash coding for extracting task-specific image representations; Second, the proposed regularizer for reducing the discrepancy between the real-valued network output space and the desired Hamming space; Third, the online generated dense pairwise supervision for well describing the desired Hamming space.

Comment:写这篇文章主要是因为他是开山之作。以我们现在的观点审视作者的这段话,其实性能这么好并不是因为损失函数多厉害,在线训练多出色。就是卷积的效益太强了! 后面也有人把损失函数简单的换成了L2-norm,结构上裁剪全连接层,使得网络变得很轻,性能更好。所以,对于计算机视觉领域,基于数据驱动的特征提取器,才是核心。

猜你喜欢

转载自blog.csdn.net/shenziheng1/article/details/81360279