All Projects → JorenSix → Tarsoslsh

JorenSix / Tarsoslsh

Licence: lgpl-3.0
A Java library implementing practical nearest neighbour search algorithm for multidimensional vectors that operates in sublinear time. It implements Locality-sensitive Hashing (LSH) and multi index hashing for hamming space.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Tarsoslsh

Smile
Statistical Machine Intelligence & Learning Engine
Stars: ✭ 5,412 (+2923.46%)
Mutual labels:  nearest-neighbor-search
Ggnn
GGNN: State of the Art Graph-based GPU Nearest Neighbor Search
Stars: ✭ 63 (-64.8%)
Mutual labels:  nearest-neighbor-search
Elastiknn
Elasticsearch plugin for nearest neighbor search. Store vectors and run similarity search using exact and approximate algorithms.
Stars: ✭ 139 (-22.35%)
Mutual labels:  nearest-neighbor-search
Ngt
Nearest Neighbor Search with Neighborhood Graph and Tree for High-dimensional Data
Stars: ✭ 636 (+255.31%)
Mutual labels:  nearest-neighbor-search
Fast Near Duplicate Image Search
Fast Near-Duplicate Image Search and Delete using pHash, t-SNE and KDTree.
Stars: ✭ 54 (-69.83%)
Mutual labels:  nearest-neighbor-search
Gann
gann(go-approximate-nearest-neighbor) is a library for Approximate Nearest Neighbor Search written in Go
Stars: ✭ 75 (-58.1%)
Mutual labels:  nearest-neighbor-search
Lopq
Training of Locally Optimized Product Quantization (LOPQ) models for approximate nearest neighbor search of high dimensional data in Python and Spark.
Stars: ✭ 530 (+196.09%)
Mutual labels:  nearest-neighbor-search
Vald
Vald. A Highly Scalable Distributed Vector Search Engine
Stars: ✭ 158 (-11.73%)
Mutual labels:  nearest-neighbor-search
Awesome Cbir Papers
📝Awesome and classical image retrieval papers
Stars: ✭ 1,114 (+522.35%)
Mutual labels:  nearest-neighbor-search
Knn Matting
Source Code for KNN Matting, CVPR 2012 / TPAMI 2013. MATLAB code ready to run. Simple and robust implementation under 40 lines.
Stars: ✭ 130 (-27.37%)
Mutual labels:  nearest-neighbor-search
Pointcloudutilities
Utilities for point cloud processing. read ply, write ply, search nearest neighbors using octree ...
Stars: ✭ 17 (-90.5%)
Mutual labels:  nearest-neighbor-search
Deep Mihash
Code for papers "Hashing with Mutual Information" (TPAMI 2019) and "Hashing with Binary Matrix Pursuit" (ECCV 2018)
Stars: ✭ 13 (-92.74%)
Mutual labels:  nearest-neighbor-search
Rii
Fast and memory-efficient ANN with a subset-search functionality
Stars: ✭ 96 (-46.37%)
Mutual labels:  nearest-neighbor-search
Milvus
An open-source vector database for embedding similarity search and AI applications.
Stars: ✭ 9,015 (+4936.31%)
Mutual labels:  nearest-neighbor-search
Nanopq
Pure python implementation of product quantization for nearest neighbor search
Stars: ✭ 145 (-18.99%)
Mutual labels:  nearest-neighbor-search
Soundfingerprinting
Open source audio fingerprinting in .NET. An efficient algorithm for acoustic fingerprinting written purely in C#.
Stars: ✭ 554 (+209.5%)
Mutual labels:  nearest-neighbor-search
Annoy
Approximate Nearest Neighbors in C++/Python optimized for memory usage and loading/saving to disk
Stars: ✭ 9,262 (+5074.3%)
Mutual labels:  nearest-neighbor-search
Faiss tips
Some useful tips for faiss
Stars: ✭ 170 (-5.03%)
Mutual labels:  nearest-neighbor-search
Pgann
Fast Approximate Nearest Neighbor (ANN) searches with a PostgreSQL database.
Stars: ✭ 156 (-12.85%)
Mutual labels:  nearest-neighbor-search
Neighbor
Nearest neighbor search for Rails and Postgres
Stars: ✭ 114 (-36.31%)
Mutual labels:  nearest-neighbor-search

h1. TarsosLSH - Locality Sensitive Hashing (LSH) in Java

TarsosLSH is a Java library implementing sub-linear nearest neigbour search algorithms. It contains both an approximate and an exact search algorithm. The first, Locality-sensitive Hashing (LSH) is a randomized approximate search algorithm for a number of search spaces. The second, Multi-index hashing is an exact nearest neigbour search algorithm which is limited to Hamming space.

Locality-sensitive Hashing (LSH), a practical nearest neighbour search algorithm for multidimensional vectors that operates in sublinear time. It supports several Locality Sensitive Hashing (LSH) families: the Euclidean hash family (L2), city block hash family (L1) and cosine hash family. The library tries to hit the sweet spot between being capable enough to get real tasks done, and compact enough to serve as a demonstration on how LSH works.

Multi-index hashing is an exact, sub-linear nearest neighbour search algorithm in hamming space. It is a simple algorithm that seeks a balance between storage space requirements and query performance.

h2. Quickly Getting Started with TarsosLSH

Head over to the "TarsosLSH release repository":http://0110.be/releases/TarsosLSH/ and download the latest "TarsosLSH library":http://0110.be/releases/TarsosLSH/TarsosLSH-latest/TarsosLSH-latest.jar. Consult the "TarsosLSH API documentation":http://0110.be/releases/TarsosLSH/TarsosLSH-latest/TarsosLSH-latest-Documentation/. If you, for some reason, want to build from source, you need "Apache Ant":http://ant.apache.org/ and "git":http://git-scm.com/ installed on your system. The following commands fetch the source and build the library and example jars:

git clone https://[email protected]/JorenSix/TarsosLSH.git
cd TarsosLSH/build
ant  #Builds the core TarsosLSH library
ant javadoc #build the API documentation

When everything runs correctly you should be able to run the command line application, and have the latest version of the TarsosLSH library for inclusion in your projects. Also, the Javadoc documentation for the API should be available in TarsosLSH/doc. Drop me a line (joren _ at _ 0110 _ dot _ be) if you use TarsosLSH in your project. Always nice to hear how this software is used.

The fastest way to get something on your screen is executing this on your command line: @java - jar [email protected] this lets LSH run on a random data set. The full reference of the command line application is included below:

Name
	TarsosLSH: finds the nearest neighbours in a data set quickly, using LSH.
Synopsis     
	java - jar TarsosLSH.jar [options]
Description
	Tries to find nearest neighbours for each vector in the
	query file, using Euclidean (L2) distance by default.
	
	Both dataset.txt and queries.txt have a similar format:
	an optional identifier for the vector and a list of N
	coordinates (which should be doubles).
	
	[Identifier] coord1 coord2 ... coordN
	[Identifier] coord1 coord2 ... coordN
	
	For an example data set with two elements and 4 dimensions:
		
	Hans 12 24 18.5 -45.6
	Jane 13 19 -12.0 49.8
	
	Options are:
		
	-d dataset.txt	
		The dataset with vectors to store in the hash table
	-q queries.txt	
		A list of vectors to query against the stored dataset
	-f cos|l1|l2
		Defines the hash family to use:
			l1	City block hash family (L1)
			l2	Euclidean hash family(L2)
			cos	Cosine distance hash family
	-r radius
		Defines the radius in which near neighbours should
		be found. Should be a double. By default a reasonable
		radius is determined automatically.
	-h n_hashes
		An integer that determines the number of hashes to
		use. By default 4, 32 for the cosine hash family.
	-t n_tables
		An integer that determines the number of hash tables,
		each with n_hashes, to use. By default 4.
	-n n_neighbours
		Number of neighbours in the neighbourhood, defaults to 3.
	-b
		Benchmark the settings.
	--help
		Prints this helpful message.
	
Examples
	Search for nearest neighbours using the l2 hash family with a radius of 500
	and utilizing 5 hash tables, each with 3 hashes.
	
	java -jar TarsosLSH.jar -f l2 -r 500 -h 3 -t 5 -d dataset.txt -q queries.txt

h2. Source Code Organization

The source tree is divided in three directories:

  • @src@ contains the source files, the core functionality. ** @src/be/tarsos/[email protected] Contains the LSH implementation ** @src/be/tarsos/[email protected] Contains an implementation of a multi index hash algorithm
  • @test@ contains unit tests for some of the functionality.
  • @build@ contains ANT build files. Either to build Java documentation and runnable JAR-files.

h2. License

The TarsosLSH license is distributed under the LGPL license.

h2. Further Reading

This section includes a links to resources used to implement this library.

For more information on Multi-Index Hashing:

h2. Dependencies

TarsosLSH relies on "MapDB":http://www.mapdb.org/ for storage which in turn depends on "eclipse collections":https://www.eclipse.org/collections/.

h2. Change log

Version 0.5
2013-04-17
First release which includes several LSH families.
Version 0.6
2013-06-13
Added serialization options to store LSH hashes, which makes the library more practical in real-world scenario's. Later database support should be added.
Version 0.7
2015-03-16
Maintenance release with changed package names and small fixes to the documentation and build file.
Version 0.8
2017-03-17
Adds an implementation of a Hamming space LSH scheme.
Version 0.9
2017-04-21
Adds an implementation of a Hamming space multi index hasher algorithm as described in "Fast Exact Search in Hamming Space with Multi-Index Hashing":http://arxiv.org/abs/1307.2982 .
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].