Skip to main content
QUICK REVIEW

[논문 리뷰] Cosine Similarity Search with Multi Index Hashing.

Sepehr Eghbali, Ladan Tahvildari|arXiv (Cornell University)|2016. 09. 14.
Advanced Image and Video Retrieval Techniques참고 문헌 42인용 수 4
한 줄 요약

이 논문은 해밍 거리와 코사인 유사도 간의 수학적 관계를 활용하여 대규모 이진 코드 데이터셋에서 빠르고 정확한 코사인 유사도 검색을 가능하게 하는 다중색인 해싱 방법을 제안한다. 해시 테이블 버킷의 순차적 탐색을 유도하는 방법으로, 전수 검색과 LSH와 같은 근사 방법에 비해 수배수의 속도 향상을 달성하면서도 최소 K개의 유사한 항목을 정확히 검색한다.

ABSTRACT

Due to rapid development of the Internet, recent years have witnessed an explosion in the rate of data generation. Dealing with data at current scales brings up unprecedented challenges. From the algorithmic view point, executing existing linear algorithms in information retrieval and machine learning on such tremendous amounts of data incur intolerable computational and storage costs. To address this issue, there is a growing interest to map data points in large-scale datasets to binary codes. This can significantly reduce the storage complexity of large-scale datasets. However, one of the most compelling reasons for using binary codes or any discrete representation is that they can be used as direct indices into a hash table. Incorporating hash table offers fast query execution; one can look up the nearby buckets in a hash table populated with binary codes to retrieve similar items. Nonetheless, if binary codes are compared in terms of the cosine similarity rather than the Hamming distance, there is no fast exact sequential procedure to find the $K$ closest items to the query other than the exhaustive search. Given a large dataset of binary codes and a binary query, the problem that we address is to efficiently find $K$ closest codes in the dataset that yield the largest cosine similarities to the query. To handle this issue, we first elaborate on the relation between the Hamming distance and the cosine similarity. This allows finding the sequence of buckets to check in the hash table. Having this sequence, we propose a multi-index hashing approach that can increase the search speed up to orders of magnitude in comparison to the exhaustive search and even approximation methods such as LSH. We empirically evaluate the performance of the proposed algorithm on real world datasets.

연구 동기 및 목표

  • 이진 코드로 표현된 대규모 데이터셋에서 코사인 유사도를 사용해 쿼리에 가장 유사한 K개의 항목을 효율적으로 찾는 도전 과제를 해결한다.
  • 표준 해시 테이블 조회로는 효율적으로 계산할 수 없지만 해밍 거리의 경우 가능하므로, 코사인 유사도가 표준 해시 테이블 조회로 효율적으로 계산될 수 없는 한계를 극복한다.
  • 이진 코드를 사용하여 코사인 유사도 기준으로 빠르고 정확한 K-근접 이웃 검색을 가능하게 하는 방법을 개발한다.
  • 대규모 정보 검색 및 머신러닝 시스템에서 계산 비용과 저장 복잡도를 감소시킨다.
  • 정확성을 유지하면서도 전수 검색과 기존의 근사 방법(LSH 등)에 비해 상당한 속도 향상을 달성한다.

제안 방법

  • 해시 테이블 내에서 효율적인 버킷 탐색을 안내하기 위해 해밍 거리와 코사인 유사도 간의 이론적 관계를 수립한다.
  • 검색 커버리지와 효율성을 향상시키기 위해 이진 코드를 다수의 해시 테이블로 매핑하는 다중색인 해싱 구조를 설계한다.
  • 코사인 유사도-해밍 거리 이중성에 기반하여 탐색할 해시 테이블 버킷의 순서를 유도함으로써, 전수 비교 없이도 빠른 검색을 가능하게 한다.
  • 유도된 버킷 탐색 순서를 활용하여 쿼리와 코사인 유사도 기준으로 가장 가까운 K개의 이진 코드를 체계적으로 검색한다.
  • 이진 코드의 구조와 기하학적 성질을 활용하여 유사도 검색 중 전체 데이터셋 스캔을 피한다.
  • 사전에 계산된 버킷 순서를 사용하여 후보를 최소한의 계산으로 검색할 수 있는 쿼리 처리 파이프라인을 구현한다.

실험 결과

연구 질문

  • RQ1해밍 거리와 코사인 유사도 간의 관계를 활용하여 이진 코드에 대한 빠르고 정확한 검색 절차를 설계할 수 있는가?
  • RQ2전수 검색 없이도 해시 테이블 조회만으로 코사인 유사도 기준 정확한 K-근접 이웃 검색이 가능한가?
  • RQ3제안된 다중색인 해싱 방법은 전수 검색과 LSH 기반 접근 방식에 비해 속도와 정확도 측면에서 어떻게 비교되는가?
  • RQ4제안된 방법은 정확성을 유지하면서도 실제 대규모 데이터셋에 대해 효율적으로 스케일업할 수 있는가?
  • RQ5검색 속도와 정확도를 극대화하기 위해 탐색할 해시 테이블 버킷의 최적 순서는 무엇인가?

주요 결과

  • 제안된 방법은 대규모 이진 코드 데이터셋에서 코사인 유사도 검색 시 전수 검색에 비해 수배수의 속도 향상을 달성한다.
  • LSH와 같은 근사 방법과 달리, 코사인 유사도 기준으로 최소 K개의 유사한 항목을 정확히 검색할 수 있다.
  • 해밍 거리와 코사인 유사도 간의 이중성을 활용함으로써, 쿼리당 필요한 해시 테이블 프로브 수를 감소시킨다.
  • 실제 데이터셋에 대한 실험적 평가 결과, 제안된 접근 방식이 전수 검색과 LSH 모두보다 쿼리 속도 측면에서 뛰어나다는 것이 확인되었다.
  • 다중색인 해싱 구조는 다수의 독립적인 해시 테이블을 통해 유사도가 높은 항목을 검색할 확률을 높임으로써 검색 효율성을 향상시킨다.
  • 계산 비용을 크게 감소시키면서도 높은 검색 정확도를 유지함으로써, 대규모 응용 분야에 적합한 솔루션이 된다.

더 나은 연구,지금 바로 시작하세요

논문 읽기부터 검토까지, 연구 시간을 획기적으로 줄여보세요.

카드 등록 없음 · 무료 플랜 제공

이 리뷰는 AI가 만들고, 인간 에디터가 검토했습니다.