Fast Exact Search in Hamming Space with Multi-Index Hashing

来源:互联网 发布:淘宝家具店排名 编辑:程序博客网 时间:2024/05/22 10:38

2016年9月22日

Introduction 

•最早发表在CVPR2012,后被PAMI2014收录.
•提出目的:在汉明编码空间中,完全搜索出k个汉明最近邻,使得存储高效,运行速度大幅度提高。目前k-nn问题,除了穷举式搜索,没有更好的办法。Multi-indexhashing (多分段索引哈希)算法:

(1)次线性时间,(2)存储高效,(3)便于实现

•思想:对于一个二值码h,一共有q位,将它分为m段。

(1)在搜索k-nn的时候先把问题转化为搜索汉明距离.

(2)搜索汉明距离可以转化为搜索每段的汉明距离,然后将m段的查询结果合并得到候选集

(3)最后在候选集中删除汉明距离大于r的结果

Tow problem

•在汉明空间上的r-neighborsof query

•K-NN query

Define

•r-neighbors

  如果一个二值码g是查询二值码的r-neighbors,当且仅当g与查询二值码最多有r位不同。

r-neighbor search

•给定一个二值码数据库 ,在中找出所有满足r-neighbors的q

Tackle r-neighbor 

•使用二值编码 建立一个hash表,这样相同的二值码就会hash到同一个hashbuckets里。
•在所有的hashbuckets里面检查哪些与查询g的索引距离在r内。

IntuitiveMethod

•假定二值码是q位,所有的hashbuckets的个数是2^q,那么要检查与待查询二值码距离在r内的不同的hashbuckets 的个数是:


随着r的增大,L(q,r)急剧增大。这种方法只有在小的搜素半径和短的编码下才具有使用性。

Multi-Index hashing

•把二值码分解成互不重叠的m块,每一块有s位。
•采用分而治之的思想,在每一块中分别找出汉明距离在r^′内的二值码作为候选二值码,最后把所有块的候选二值码组合在一起,剔除最终汉明距离大于r的二值码。

Tow proposition

•Proposition1:

•Proposition2:

MIH forr-neighbor Search

•每一个子串二值码块建立一个hashtable

r-neighbor检索操作(查询二值码为g

•检索费用取决于两个因素:

  (1)numberof lookups

    那些要搜索的buckets的个数

  (2)numberof candidatestested

•With alarge number of lookupsone canminimize the number of extraneous candidates

取决于子串的长度s. hash buckets 中的二值码子串都是完全一样的。如果一个buckets是在要检索的buckets,那么这个buckets里的所有二值码都是候选的。长度s得到hashbuckets 的个数是2^s,数据库中待查询的二值码总共有n个,假设二值码是均匀分布的,那么每个hashbuckets中二值码的个数平均是n/2^s.那么一个子串中所有候选的个数就是lookups* n/2^s.


Cost的上界取决于s

Choosing an Effective Substring Length

search ratio r/q
plotscost as a function of substring lengths, for240-bit codes, different database sizesn, anddifferentsearchratio.


Complexity



k-NEAREST NEIGHBOR SEARCH


EXPERIMENTS




Multi-Index Hashingvs.LinearScanMulti-Index Hashingvs.LinearScan



Substring Optimization

前面说的子串划分是很简单的子串划分,效果等价于对每一位随机分配到一个子串中。
•改进:对随机分配进行优化。

     方法:

(1)Initial:A random bit is assigned to the first substring

(2)a bit is assigned to substringj,which is maximally correlated with the bit assigned to substring j− 1. 到这一步,每一个substring中都有1个bits.

(3)repeat :

An unused bit is assigned to substring j, if the maximum correlation between that bit and other bits already assigned to substring jisminimal.

This approach significantlydecreases the correlation between bits withina single substring. This should make the distribution ofcodes within substrings buckets more uniform, andthereby lower the number of candidates  within a given search radius.


Futurework

•usemulti-index hashing and then only use an symmetric distancewhen culling candidates. Thepotential for more interestingand effective methods isyet anotherpromising avenue for future work.
abetter approach consists of maximizing the entropy of the entrieswithin
each substring hash table, thereby making the distribution of substrings asuniform as possible. However, this entropic approach is left to futurework.


0 0