Skip to main content
QUICK REVIEW

[论文解读] A Revisit of Hashing Algorithms for Approximate Nearest Neighbor Search

Deng Cai|arXiv (Cornell University)|Dec 22, 2016
Advanced Image and Video Retrieval Techniques参考文献 48被引用 19
一句话总结

本文通過提出一種新型的分組漢明排序方法,重新探討近似最近鄰搜索(ANNS)的哈希算法。令人驚訝的是,當代碼長度延長至1,024或2,048位時,基於隨機投影的局部敏感哈希(LSH)在多個數據集上表現優於十種先進的數據相關哈希算法,挑戰了先前認為新方法更優的說法。

ABSTRACT

Approximate Nearest Neighbor Search (ANNS) is a fundamental problem in many areas of machine learning and data mining. During the past decade, numerous hashing algorithms are proposed to solve this problem. Every proposed algorithm claims outperform other state-of-the-art hashing methods. However, the evaluation of these hashing papers was not thorough enough, and those claims should be re-examined. The ultimate goal of an ANNS method is returning the most accurate answers (nearest neighbors) in the shortest time. If implemented correctly, almost all the hashing methods will have their performance improved as the code length increases. However, many existing hashing papers only report the performance with the code length shorter than 128. In this paper, we carefully revisit the problem of search with a hash index, and analyze the pros and cons of two popular hash index search procedures. Then we proposed a very simple but effective two level index structures and make a thorough comparison of eleven popular hashing algorithms. Surprisingly, the random-projection-based Locality Sensitive Hashing (LSH) is the best performed algorithm, which is in contradiction to the claims in all the other ten hashing papers. Despite the extreme simplicity of random-projection-based LSH, our results show that the capability of this algorithm has been far underestimated. For the sake of reproducibility, all the codes used in the paper are released on GitHub, which can be used as a testing platform for a fair comparison between various hashing algorithms.

研究动机与目标

  • 在公平且全面的條件下,重新評估流行哈希算法在近似最近鄰搜索(ANNS)中的性能。
  • 解決先前哈希論文中缺乏全面評估的問題,特別是代碼長度有限(通常<128位)以及依賴效率低下的MATLAB漢明排序。
  • 提出一種新的兩級哈希索引結構與分組漢明排序搜索程序,以實現不同哈希算法之間的公平且高效的比較。
  • 在相同條件下,將基於隨機投影的LSH與最前沿的ANNS方法(包括基於樹、量化和圖的方法)進行基準測試。
  • 透過GitHub提供可重現的開源測試平台,以實現未來哈希算法的公平基準測試。

提出的方法

  • 提出兩級哈希索引結構,以提升搜索效率與比較的公平性。
  • 引入分組漢明排序方法,通過聚合多個哈希表的結果來提升召回率,而不增加代碼長度。
  • 將原始基於MATLAB的LSH實現轉換為優化後的C++代碼(命名為RPLSH),以實現公平的性能比較。
  • 採用系統化的評估框架,使用召回率與代碼長度、召回率與搜索時間的曲線圖,針對大規模數據集(SIFT1M、GIST1M)進行評估。
  • 所有算法均使用相同硬體與單執行緒執行,以確保公平比較。
  • 使用調校過的參數,將RPLSH與五個成熟的ANNS庫(FALCONN、FLANN、Annoy、FAISS、KGraph)進行比較,以實現高召回率。

实验结果

研究问题

  • RQ1當在公平且全面的條件下評估時,基於隨機投影的LSH是否仍能與現代數據相關哈希算法競爭?
  • RQ2當代碼長度超過常見的128位時,哈希算法的性能如何隨長度增加而變化?
  • RQ3在評估中,漢明排序與哈希桶搜索這兩種哈希索引搜索方法,哪一種能提供更好的性能與公平性?
  • RQ4當正確實現時,簡單且數據無關的算法(如基於隨機投影的LSH)是否能超越複雜且數據相關的哈希算法?
  • RQ5在高召回率水平下,RPLSH與其他最前沿的ANNS方法(如基於樹、量化和圖的方法)在召回率與速度方面如何比較?

主要发现

  • 當代碼長度增加至1,024或2,048位時,基於隨機投影的LSH(RPLSH)在SIFT1M與GIST1M上均表現最佳,優於其他十種哈希算法。
  • 在SIFT1M上,RPLSH實現最高召回率(超過99%),在低召回率水平下排名第二;在GIST1M上,當召回率超過90%時,RPLSH表現最佳。
  • RPLSH顯著優於另一個基於LSH的方法FALCONN,原因在於其採用分組漢明排序,而非多表哈希桶搜索。
  • 基於樹的方法(FLANN、Annoy)在低維數據上表現良好,但在高維數據上性能下降;而FAISS(乘積量化)因近似原因無法實現高召回率。
  • 在高召回率下,基於圖的方法KGraph在GIST1M上被RPLSH超越,這與「LSH本質上緩慢或不準確」的說法相矛盾。
  • 本研究證明,大多數哈希算法的性能會隨著代碼長度增加而提升,但許多先前的研究因任意設置代碼長度上限而未探討此現象。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。