we use all features but we stop the mapping process when necessary. Our approach is also more general as it does not depend on the sequential property of the data.

PROPOSED METHOD {#sec:method}
===============

Vector-quantization (VQ) is an expensive process when the BoW-based image retrieval is performed in large-scale environments, in which hundreds of features extracted from an image need to be matched against hundreds of thousands of visual words. The question is if we really need to vector-quantize all features? Depending on the difficulty level of the search, the number of features to be converted to visual words may vary. We call a search difficult when there are many similar images to the query and thus finding the nearest neighbor among all those candidates requires more computations[^3]. Whereas in an easy search, the query image is similar to only a few images in the database and it can find its true match after processing only a small percentage of features. Figure \[diff\_search\] and Figure \[easy\_search\] show examples of easy and difficult searches. The histograms show the similarity of each database image to the query based on the *tf-idf* score. The difficult search needs to process at least $89\%$ of 