Abstract
Product quantization (PQ) is an effective solution to approximate nearest neighbor (ANN) search. The idea of PQ is to decompose the space into Cartesian product of several low-dimensional subspaces and quantize each subspace separately. Database vectors are represented by short codes with different length composed of their subspace quantization indices. A vector is encoded to a short code consisting of its subspace quantization indices. PQ allows to generate a large size codebook with very low memory and time cost, and the selection of the number M of sub-vectors is the most essential and important problem, but is easily neglected. Motivated by this observation, we propose a method named Flexible Product quantization (FPQ) to optimize PQ-based methods that fix M for all vectors. FPQ achieves flexible M by concatenating the sub-vector pairs through constrains on quantization distortion. The concatenating operation is implemented individually among different database vectors and can lead to far less additions in the search process. Different from existing PQ-based fast search methods, this operation of our proposed FPQ is to reduce the computational complexity for searching each single database vector, which provides a new perspective to better accelerate ANN search. Experimental results show that our method for product quantization based methods can significantly reduce nearly 25\(\%\) computational complexity by using appropriate parameters, while the search accuracy can be guaranteed.
Similar content being viewed by others
Data Availibility Statement
The datasets that support the findings of this study are openly available at http://corpus-texmex.irisa.fr. The program that supports the findings of this study is available from the corresponding author,upon request.
References
Boiman O, Shechtman E, Irani M (2008) In defense of nearest-neighbor based image classification. In: 2008 IEEE Conference on computer vision and pattern recognition, pp 1–8
Wang J, Wen C (2011) Personalized commodity recommending method and system which integrate attributes and structural similarity
Zhang S, Li X, Zong M, Zhu X, Wang R (2017) Efficient knn classification with different numbers of nearest neighbors. IEEE Trans Neural Netw Learn Syst 29(5):1774–1785
Pan Y, Pan Z, Wang Y, Wang W (2020) A new fast search algorithm for exact k-nearest neighbors based on optimal triangle-inequality-based check strategy. Knowl-Based Syst 189
Indyk P, Motwani R (1998) Approximate nearest neighbors: towards removing the curse of dimensionality. In: Proceedings of the thirtieth annual ACM symposium on Theory of computing, pp 604–613
Liu W, Wang J, Ji R, Jiang Y-G, Chang S-F (2012) Supervised hashing with kernels. In: 2012 IEEE Conference on computer vision and pattern recognition, pp 2074–2081
Ercoli S, Bertini M, Bimbo AD (2017) Compact hash codes for efficient visual descriptors retrieval in large scale databases. IEEE Trans Multimed 19(11):2521–2532
Wang J, Kumar S, Chang S-F (2012) Semi-supervised hashing for large-scale search. IEEE Trans Patt Anal Mach Intell 34(12):2393–2406
Jin L, Li Z, Tang J (2020) Deep semantic multimodal hashing network for scalable image-text and video-text retrievals. IEEE Trans Neural Netw Learn Syst 34(4):1838–1851
Li Z, Tang J, Zhang L, Yang J (2020) Weakly-supervised semantic guided hashing for social image retrieval. Int J Comp Vision 128:2265–2278
Jégou H, Douze M, Schmid C (2011) Product quantization for nearest neighbor search. IEEE Trans Patt Anal Mach Intell 33(1):117–128
Song W, Wang Y, Pan Z (2023) A novel cell partition method by introducing Silhouette Coefficient for fast approximate nearest neighbor search. Inf Sci 642:119216
Pan Z, Wang L, Wang Y, Liu Y (2020) Product quantization with dual codebooks for approximate nearest neighbor search. Neurocomputing 401:59–68
Fan F, Pan Z,Wang L,WangY (2022) Codebook-softened product quantization for high accuracy approximate nearest neighbor search. Neurocomputing 507(1):107–116
Ge T, He K, Ke Q, Sun J (2014) Optimized product quantization. IEEE Trans Patt Anal Mach Intell 36(4):744–755
Kalantidis Y, Avrithis Y (2014) Locally optimized product quantization for approximate nearest neighbor search. In: 2014 IEEE Conference on computer vision and pattern recognition, pp 2329–2336
Norouzi M, Fleet DJ (2013) Cartesian k-means. In: 2013 IEEE Conference on computer vision and pattern recognition, pp 3017–3024
Hong W, Tang X, Meng J, Yuan J (2020) Asymmetric mapping quantization for nearest neighbor search. IEEE Trans Patt Anal Mach Intell 42(7):1783–1790
Heo J-P, Lin Z, Yoon S-E (2019) Distance encoded product quantization for approximate k-nearest neighbor search in high-dimensional space. IEEE Trans Patt Anal Mach Intell 41(9):2084–2097
Li L, Hu Q, Han Y, Li X (2018) Distribution sensitive product quantization. IEEE Trans Circ Syst Video Tech 28(12):3504–3515
Ning Q, Zhu J, Zhong Z, Hoi SC, Chen C (2017) Scalable image retrieval by sparse product quantization. IEEE Trans Multimed 19(3):586–597
An S, Huang Z, Bai S, Che G, Ma X, Luo J, Chen Y (2019) Quarter-point product quantization for approximate nearest neighbor search. Pattern Recogn Lett 125:187–194
Acknowledgements
This work is supported in part by the National Natural Science Foundation of China (Grant No. U1903213), The Ph.D. Stand-up Fund of Xi’an University of Technology (Grant No. 108-451121002) and the Zhejiang Provincial Commonweal Project (Grant No. LGF21F030002).
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Conflicts of interest
We declare that we have no financial and personal relationships with other people or organizations that can inappropriately influence our work, and there is no professional or other personal interest of any nature or kind in any product, service and/or company that could be construed as influencing the position presented in the manuscript entitled “Flexible Product Quantization for Fast Approximate Nearest Neighbor Search”.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.
About this article
Cite this article
Fan, J., Wang, Y., Song, W. et al. Flexible product quantization for fast approximate nearest neighbor search. Multimed Tools Appl 83, 53243–53261 (2024). https://doi.org/10.1007/s11042-023-17564-3
Received:
Revised:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11042-023-17564-3