Abstract
Average neighborhood margin maximization (ANMM) is a local supervised metric learning approach, which aims to find projection directions where the local class discriminability is maximized. Furthermore, it has no assumption of class distribution and works well on small sample size. In this work, we address this problem in the quantum setting and present a quantum ANMM algorithm for linear feature extraction. More specifically, a quantum algorithm is designed to construct scatterness and compactness matrices in the quantum state form. Then a quantum algorithm is presented to obtain the features of the testing sample set in the quantum state form. The time complexity analysis of the quantum ANMM algorithm shows that our algorithm may achieve an exponential speedup on the dimension of the sample points \(D\), and a quadratic speedup on the numbers of training samples \(N\) and testing samples \(M\) compared to the classical counterpart under certain conditions.
Similar content being viewed by others
Data availability statement
The data that support the findings of this study are available upon reasonable request from the authors.
References
Carreira-Perpinán M.A.: A review of dimension reduction techniques. Department of Computer Science. University of Sheffield. Tech. Rep. CS-96–09 9(1–69), (1997).
Roweis, S.T., Saul, L.K.: Nonlinear dimensionality reduction by locally linear embedding. Science 290(5500), 2323–2326 (2000)
Wold, S., Esbensen, K., Geladi, P.: Principal component analysis. Chemometr. Intell. Lab. 2(1–3), 37–52 (1987)
Fisher, R.A.: The use of multiple measurements in taxonomic problems. Ann. Eugen. 7(2), 179–188 (1936)
Wang F., Zhang C.: Feature extraction by maximizing the average neighborhood margin, in: 2007 IEEE Conference on Computer Vision and Pattern Recognition, IEEE, 2007, pp. 1–8.
Button, K.S., Ioannidis, J.P., Mokrysz, C., Nosek, B.A., Flint, J., Robinson, E.S., Munafò, M.R.: Power failure: why small sample size undermines the reliability of neuroscience. Nat. Rev. Neur. 14(5), 365–376 (2013)
Suárez-Díaz J.L., García S., Herrera F.: A tutorial on distance metric learning: mathematical foundations, algorithms, experimental analysis, prospects and challenges (with appendices on mathematical background and detailed algorithms explanation). arXiv preprint arXiv:1812.05944 (2018).
Shor P.W.: Algorithms for quantum computation: discrete logarithms and factoring, in: Proceedings 35th Annual Symposium on Foundations of Computer Science, IEEE, 1994, pp. 124–134.
Grover, L.K.: Quantum mechanics helps in searching for a needle in a haystack. Phys. Rev. Lett. 79(2), 325 (1997)
Harrow, A.W., Hassidim, A., Lloyd, S.: Quantum algorithm for linear systems of equations. Phys. Rev. Lett. 103(15), 150502 (2009)
Lloyd, S., Garnerone, S., Zanardi, P.: Quantum algorithms for topological and geometric analysis of data. Nat. Comm. 7(1), 1–7 (2016)
Duan, B.J., Yuan, J.B., Liu, Y., Li, D.: Quantum algorithm for support matrix machines. Phys. Rev. A 96(3), 032301 (2017)
Lloyd, S., Mohseni, M., Rebentrost, P.: Quantum principal component analysis. Nat. Phys. 10(9), 631–633 (2014)
Yu, C.H., Gao, F., Lin, S., Wang, J.: Quantum data compression by principal component analysis. Quan. Inf. Pro. 18(8), 1–20 (2019)
He, X.: Quantum subspace alignment for domain adaptation. Phys. Rev. A 102(6), 062403 (2020)
He, X.: Quantum correlation alignment for unsupervised domain adaptation. Phys. Rev. A 102(3), 032410 (2020)
Gao, S., Pan, S.J., Yang, Y.G.: Quantum algorithm for kernelized correlation filter. Sci. China Inf. Sci. 66(2), 129501 (2023)
Gao, S., Yang, Y.G.: New quantum algorithm for visual tracking. Physica A 615(2), 128587 (2023)
Yu, C.H., Gao, F., Wang, Q.L., Wen, Q.Y.: Quantum algorithm for association rules mining. Phys. Rev. A 94(4), 042311 (2016)
Duan, B.J., Yuan, J.B., Xu, J., Li, D.: Quantum algorithm and quantum circuit for a-optimal projection: dimensionality reduction. Phys. Rev. A 99(3), 032311 (2019)
He, X., Sun, L., Lyu, C., Wang, X.: Quantum locally linear embedding for nonlinear dimensionality reduction. Quan. Inf. Pro. 19(9), 1–21 (2020)
Pan, S.J., Wan, L.C., Liu, H.L., Wang, Q.L., Qin, S.J., Wen, Q.Y., Gao, F.: Improved quantum algorithm for A-optimal projection. Phys. Rev. A 102(5), 052402 (2020)
Yu, K., Guo, G.D., Lin, S.: Quantum dimensionality reduction by linear discriminant analysis. arXiv preprint arXiv:2103.03131 (2021).
Gao, S., Yang, Y.G.: A novel quantum recommender system. Phys. Scr. 98(1), 010001 (2023)
Kerenidis I., Prakash A.: Quantum recommendation systems. arXiv preprint arXiv:1603.08675 (2016).
Brandao, F.G., Svore, K.M.: Quantum speed-ups for solving semidefinite programs, in, IEEE 58th Annual Symposium on Foundations of Computer Science (FOCS). IEEE 2017, 415–426 (2017)
Wan, L.C., Yu, C.H., Pan, S.J., Gao, F., Wen, Q.Y., Qin, S.J.: Asymptotic quantum algorithm for the Toeplitz systems. Phys. Rev. A 97(6), 062322 (2018)
Gao, S., Yang, Y.G.: Quantum algorithm for Toeplitz matrix-vector multiplication. Chin. Phys. B (2023). https://doi.org/10.1088/1674-1056/acb914
Rebentrost, P., Schuld, M., Wossnig, L., Petruccione, F., Lloyd, S.: Quantum gradient descent and Newton’s method for constrained polynomial optimization. New J. Phys. 21(7), 073023 (2019)
Gao, X., Zhang, Z.Y., Duan, L.M.: A quantum machine learning algorithm based on generative models. Sci. Adv. 4(12), eaat9004 (2018)
Hu, L., Wu, S.H., Cai, W., Ma, Y., Mu, X., Xu, Y., Wang, H., Song, Y., Deng, D.L., Zou, C.L.: Quantum generative adversarial learning in a superconducting quantum circuit. Sci. Adv. 5(1), eaav2761 (2019)
Wang, F., Wang, X., Zhang, D., Zhang, C., Li, T.: Marginface: A novel face recognition method by average neighborhood margin maximization. Patt. Rec. 42(11), 2863–2875 (2009)
Pedregosa, F., Varoquaux, G., Gramfort, A., Michel, V., Thirion, B., Grisel, O., Blondel, M., Prettenhofer, P., Weiss, R., Dubourg, V.: Scikit-learn: Machine learning in Python. J. Mach. Learn. Res. 12, 2825–2830 (2011)
Giovannetti, V., Lloyd, S., Maccone, L.: Quantum random access memory. Phys. Rev. Lett. 100(16), 160501 (2008)
Kerenidis I., Landman J., Luongo A., Prakash A.: q-means: A quantum algorithm for unsupervised machine learning. arXiv preprint arXiv:1812.03584 (2018).
Pan S.J., Wan L.C., Liu H.L., Wu Y.S., Qin S.J., Wen Q.Y., Gao F.: Quantum algorithm for Neighborhood Preserving Embedding. arXiv preprint arXiv:2110.11541 (2021).
Rebentrost, P., Mohseni, M., Lloyd, S.: Quantum support vector machine for big data classification. Phys. Rev. Lett. 113(13), 130503 (2014)
Kimmel, S., Lin, C.Y.Y., Low, G.H., Ozols, M., Yoder, T.J.: Hamiltonian simulation with optimal sample complexity. npj Quan. Inf. 3(1), 1–7 (2017)
Chakraborty S., Gilyén A., Jeffery S.: The power of block-encoded matrix powers: improved regression techniques via faster Hamiltonian simulation. arXiv preprint arXiv:1804.01973 (2018).
Gilyén A., Su Y., Low G.H., Wiebe N.: Quantum singular value transformation and beyond: exponential improvements for quantum matrix arithmetics, in: Proceedings of the 51st Annual ACM SIGACT Symposium on Theory of Computing, 2019, pp. 193–204.
Low, G.H., Chuang, I.L.: Hamiltonian simulation by qubitization. Quantum 3, 163 (2019)
Cong, I., Duan, L.M.: Quantum discriminant analysis for dimensionality reduction and classification. New J. Phys. 18(7), 073011 (2016)
Acknowledgements
We declare that we have no financial and personal relationships with other people or organizations that can inappropriately influence our work, 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, or the review of, the manuscript. This work was supported by the National Natural Science Foundation of China (Grant Nos. 62071015, 62171264).
Author information
Authors and Affiliations
Corresponding author
Ethics declarations
Ethical approval
Ethics Committee approval was obtained from the Institutional Ethics Committee of Beijing University of Technology to the commencement of the study.
Additional information
Publisher's Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Appendices
Appendix A: quantum comparison circuit diagram
Here, we design a quantum comparison circuit used in this article, as shown in Fig. 1. Assume there are two quantum states to be compared, \(\left|a\right.\rangle =|{a}_{l-1}{a}_{l-2}\cdots {a}_{0}\rangle \) and \(\left|b\right.\rangle =|{b}_{l-1}{b}_{l-2}\cdots {b}_{0}\rangle \), after passing this quantum comparison circuit, if \(a\ge b\), we can obtain \(|0\rangle \) in the lower most register, otherwise, this quantum state will be flipped to \(|1\rangle \).
Appendix B: Proof of Eq. (22)
According to the Hadamard Lemma [38], we can get
As for \({\mathrm{Tr}}_{p}\left\{{\mathrm{e}}^{-\mathrm{i}Sw\Delta t}\left(\sigma \otimes \rho \right){e}^{iSw\Delta t}\right\}\), suppose \(\sigma ={\sum }_{i}{\sigma }_{i}|{\sigma }_{i}\rangle \langle {\sigma }_{i}|\) and \(\rho ={\sum }_{j}{\rho }_{j}|{\rho }_{j}\rangle \langle {\rho }_{j}|\), the derivation is as follows:
Appendix C: Proof of Eq. (23)
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
Gao, S., Pan, SJ., Xu, GB. et al. Quantum average neighborhood margin maximization for feature extraction. Quantum Inf Process 22, 152 (2023). https://doi.org/10.1007/s11128-023-03879-5
Received:
Accepted:
Published:
DOI: https://doi.org/10.1007/s11128-023-03879-5