Leveraging Data Locality in Quantum Convolutional Classifiers
Abstract
:1. Introduction
2. Background
2.1. Quantum Measurement and Reset
2.2. Classical-to-Quantum (C2Q)
2.3. Convolutional Neural Networks (CNNs)
2.4. Quantum Machine Learning with Variational Algorithms
3. Related Work
3.1. Data Encoding
3.2. Convolution
3.2.1. Classical Convolution
3.2.2. Quantum Convolution
3.3. Quantum Machine Learning
3.3.1. Quantum Convolutional Neural Networks
3.3.2. Quanvolutional Neural Networks
4. Materials and Methods
- Develop a generalizable quantum convolution algorithm for a quantum-convolution-based classifier that supports multiple features/kernels.
- Design a scalable MQCC that uses multidimensional quantum convolution and pooling based on the QHT. This technique reduces training parameters and time complexity compared with other classical and quantum implementations.
- Evaluate the MQCC model in a state-of-the-art QML simulator from Xanadu using a variety of datasets.
4.1. Quantum Fully Connected Layer
4.1.1. Single-Feature Output
4.1.2. Multifeature Output
Replication:
Applying the Filter:
Data Rearrangement:
4.1.3. Circuit Depth of the Quantum Fully Connected Layer
4.2. Generalized Quantum Convolution
Stride:
Multiply-and-Accumulate (MAC):
Data Rearrangement:
4.2.1. One-Dimensional Multifeature Quantum Convolution
4.2.2. Multidimensional Multifeature Quantum Convolution
4.3. Quantum Pooling
4.3.1. Quantum Average Pooling using Quantum Haar Transform
Haar Wavelet Operation:
Data Rearrangement:
4.3.2. Quantum Euclidean Pooling using Partial Measurement
4.4. Multidimensional Quantum Convolutional Classifier
4.5. Optimized MQCC
5. Experimental Work
5.1. Experimental Setup
5.2. Configuration of ML Models
5.3. Results and Analysis
Quantum Convolution Results
6. Discussion
6.1. Number of Parameters
6.2. Loss History and Accuracy
6.3. Gate Count and Circuit Depth
6.4. Complexity Comparison with Classical Models
7. Conclusions
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
Appendix A
Appendix A.1. Quantum Bits and States
Appendix A.2. Rotation Gates
Appendix A.3. Hadamard Gate
Appendix A.4. Controlled-NOT (CNOT) Gate
Appendix A.5. SWAP Gate
Appendix A.6. Quantum Perfect-Shuffle Permutation (PSP)
Appendix A.7. Quantum Shift Operation
References
- Villalobos, P.; Sevilla, J.; Besiroglu, T.; Heim, L.; Ho, A.; Hobbhahn, M. Machine learning model sizes and the parameter gap. arXiv 2022, arXiv:2207.02852. [Google Scholar]
- LeCun, Y.; Kavukcuoglu, K.; Farabet, C. Convolutional networks and applications in vision. In Proceedings of the 2010 IEEE International Symposium on Circuits and Systems, Paris, France, 30 May–2 June 2010; IEEE: New York, NY, USA, 2010; pp. 253–256. [Google Scholar]
- Lecun, Y.; Bengio, Y.; Hinton, G. Deep learning. Nature 2015, 521, 436–444. [Google Scholar] [CrossRef] [PubMed]
- Chakraborty, S.; Dey, L. Computing for Data Analysis: Theory and Practices; Springer: Singapore, 2023; pp. 161–178. [Google Scholar]
- Peruzzo, A.; McClean, J.; Shadbolt, P.; Yung, M.H.; Zhou, X.Q.; Love, P.J.; Aspuru-Guzik, A.; O’Brien, J.L. A variational eigenvalue solver on a photonic quantum processor. Nat. Commun. 2014, 5, 4213. [Google Scholar] [CrossRef]
- Havlíček, V.; Córcoles, D.; Temme, K.; Harrow, W.; Kandala, A.; Chow, J.; Gambetta, M. Supervised learning with quantum-enhanced feature spaces. Nature 2019, 567, 209–212. [Google Scholar] [CrossRef]
- Farhi, E.; Goldstone, J.; Gutmann, S. A quantum approximate optimization algorithm. arXiv 2014, arXiv:1411.4028. [Google Scholar]
- Farhi, E.; Neven, H. Classification with quantum neural networks on near term processors. arXiv 2018, arXiv:1802.06002. [Google Scholar]
- Schuld, M.; Bocharov, A.; Svore, M.; Wiebe, N. Circuit-centric quantum classifiers. Phys. Rev. A 2020, 101, 032308. [Google Scholar] [CrossRef]
- Williams, C.P. Explorations in Quantum Computing, 2nd ed.; Springer: London, UK, 2011. [Google Scholar]
- Jeng, M.; Islam, S.I.U.; Levy, D.; Riachi, A.; Chaudhary, M.; Nobel, M.A.I.; Kneidel, D.; Jha, V.; Bauer, J.; Maurya, A.; et al. Improving quantum-to-classical data decoding using optimized quantum wavelet transform. J. Supercomput. 2023, 79, 20532–20561. [Google Scholar] [CrossRef]
- El-Araby, E.; Mahmud, N.; Jeng, M.J.; MacGillivray, A.; Chaudhary, M.; Nobel, M.A.I.; Islam, S.I.U.; Levy, D.; Kneidel, D.; Watson, M.R.; et al. Towards Complete and Scalable Emulation of Quantum Algorithms on High-Performance Reconfigurable Computers. IEEE Trans. Comput. 2023, 72, 2350–2364. [Google Scholar] [CrossRef]
- IBM Quantum. Qiskit: An Open-Source Framework for Quantum Computing. Zenodo. Available online: https://doi.org/10.5281/zenodo.2573505 (accessed on 28 February 2024).
- Nation, P. How to Measure and Reset a Qubit in the Middle of a Circuit Execution. 2021. Available online: https://www.ibm.com/quantum/blog/quantum-mid-circuit-measurement (accessed on 26 February 2024).
- Mi, A.; Deng, S.; Szefer, J. Securing Reset Operations in NISQ Quantum Computers. In Proceedings of the 2022 ACM SIGSAC Conference on Computer and Communications Security, Los Angeles, CA, USA, 7–11 November 2022; pp. 2279–2293. [Google Scholar]
- Mahmud, N.; Jeng, M.; Nobel, M.A.I.; Chaudhary, M.; Ul Islam, S.M.I.; Levy, D.; El-Araby, E. Efficient Data Encoding and Decoding for Quantum Computing. In Proceedings of the 2022 IEEE International Conference on Quantum Computing and Engineering (QCE), Broomfield, CO, USA, 18–23 September 2022; pp. 765–768. [Google Scholar] [CrossRef]
- Albawi, S.; Mohammed, T.A.; Al-Zawi, S. Understanding of a convolutional neural network. In Proceedings of the 2017 International Conference on Engineering and Technology (ICET), Antalya, Turkey, 21–23 August 2017; IEEE: Piscataway, NJ, USA, 2017; pp. 1–6. [Google Scholar]
- Le, Q.; Dong, F.; Hirota, K. A flexible representation of quantum images for polynomial preparation, image compression, and processing operations. Quantum Inf. Process. 2011, 10, 63–84. [Google Scholar] [CrossRef]
- Zhang, Y.; Lu, K.; Gao, Y.; Wang, M. NEQR: A novel enhanced quantum representation of digital images. Quantum Inf. Process. 2013, 12, 2833–2860. [Google Scholar] [CrossRef]
- Jeng, M.; Nobel, A.; Jha, V.; Levy, D.; Kneidel, D.; Chaudhary, M.; Islam, I.; Rahman, M.; El-Araby, E. Generalized Quantum Convolution for Multidimensional Data. Entropy 2023, 25, 11. [Google Scholar] [CrossRef]
- Burrus, C.S.S.; Parks, T.W. DFT/FFT and Convolution Algorithms: Theory and Implementation; John Wiley & Sons, Inc.: Hoboken, NJ, USA, 1991. [Google Scholar]
- Podlozhnyuk, V. FFT-Based 2D Convolution. NVIDIA. 2007. Available online: https://developer.download.nvidia.com/compute/cuda/1.1-Beta/x86_64_website/projects/convolutionFFT2D/doc/convolutionFFT2D.pdf (accessed on 18 February 2024).
- NVIDIA. CUTLASS Convolution. Github. 2023. Available online: https://github.com/NVIDIA/cutlass/blob/main/media/docs/implicit_gemm_convolution.md (accessed on 18 February 2024).
- NVIDIA. Convolution Algorithms. Github. 2023. Available online: https://docs.nvidia.com/deeplearning/performance/dl-performance-convolutional/index.html#conv-algo (accessed on 18 February 2024).
- Fan, P.; Zhou, R.; Hu, W.; Jing, N. Quantum image edge extraction based on classical Sobel operator for NEQR. Quantum Inf. Process. 2018, 18, 24. [Google Scholar] [CrossRef]
- Ma, Y.; Ma, H.; Chu, P. Demonstration of Quantum Image Edge Extration Enhancement through Improved Sobel Operator. IEEE Access 2020, 8, 210277–210285. [Google Scholar] [CrossRef]
- Zhang, Y.; Lu, K.; Gao, Y. QSobel: A novel quantum image edge extraction algorithm. Sci. China Inf. Sci. 2015, 58, 1–13. [Google Scholar] [CrossRef]
- Zhou, R.; Yu, H.; Cheng, Y.; Li, F. Quantum image edge extraction based on improved Prewitt operator. Quantum Inf. Process. 2019, 18, 261. [Google Scholar] [CrossRef]
- Li, P. Quantum implementation of the classical Canny edge detector. Multimed. Tools Appl. 2022, 81, 11665–116941. [Google Scholar] [CrossRef]
- Yao, X.; Wang, H.; Liao, Z.; Chen, M.; Pan, J.; Li, J.; Zhang, K.; Lin, X.; Wang, Z.; Luo, Z.; et al. Quantum Image Processing and Its Application to Edge Detection: Theory and Experiment. Phys. Rev. X 2017, 7, 031041. [Google Scholar] [CrossRef]
- Cong, I.; Choi, S.; Lukin, M.D. Quantum convolutional neural networks. Nat. Phys. 2019, 15, 1273–1278. [Google Scholar] [CrossRef]
- Henderson, M.; Shakya, S.; Pradhan, S.; Cook, T. Quanvolutional neural networks: Powering image recognition with quantum circuits. Quantum Mach. Intell. 2020, 2, 2. [Google Scholar] [CrossRef]
- Shende, V.; Bullock, S.; Markov, I. Synthesis of quantum-logic circuits. IEEE Trans. Comput. Aided Des. Integr. Circuits Syst. 2006, 25, 1000–1010. [Google Scholar] [CrossRef]
- Bieder, F.; Sandkühler, R.; Cattin, P. Comparison of methods generalizing max-and average-pooling. arXiv 2021, arXiv:2103.01746. [Google Scholar] [CrossRef]
- Jeng, M.; Nobel, A.; Jha, V.; Levy, D.; Kneidel, D.; Chaudhary, M.; Islam, I.; Baumgartner, E.; Vanderhoof, E.; Facer, A.; et al. Optimizing Multidimensional Pooling for Variational Quantum Algorithms. Algorithms 2024, 17, 82. [Google Scholar] [CrossRef]
- PyTorch. torch.nn.LPPool1d [Computer Software]. 2023. Available online: https://pytorch.org/docs/stable/generated/torch.nn.LPPool1d.html (accessed on 18 February 2024).
- IBM Quantum. qiskit.circuit.library.NLocal [Computer Software]. 2023. Available online: https://qiskit.org/documentation/stubs/qiskit.circuit.library.NLocal.html (accessed on 18 February 2024).
- Xanadu. qml.BasicEntanglerLayers [Computer Software]. 2023. Available online: https://docs.pennylane.ai/en/stable/code/api/pennylane.BasicEntanglerLayers.html (accessed on 18 February 2024).
- Geneva, Switzerland. Sound Quality Assessment Material: Recordings for Subjective Tests. 1988. Available online: https://tech.ebu.ch/publications/sqamcd (accessed on 18 February 2024).
- Brand Center, University of Kansas. Jayhawk Images. Available online: https://brand.ku.edu/ (accessed on 18 February 2024).
- Graña, M.; Veganzons, M.A.; Ayerdi, B. Hyperspectral Remote Sensing Scenes. Available online: https://www.ehu.eus/115ccwintco/index.php/Hyperspectral_Remote_Sensing_Scenes#Kennedy_Space_Center_(KSC) (accessed on 18 February 2024).
- Deng, L. The MNIST database of handwritten digit images for machine learning research. IEEE Signal Process. Mag. 2012, 29, 141–142. [Google Scholar] [CrossRef]
- Xiao, H.; Rasul, K.; Vollgraf, R. Fashion-MNIST: A Novel Image Dataset for Benchmarking Machine Learning Algorithms. arXiv 2017, arXiv:1708.07747. [Google Scholar]
- Krizhevsky, A. Learning Multiple Layers of Features from Tiny Images. 2009. Available online: https://www.cs.toronto.edu/~kriz/learning-features-2009-TR.pdf(accessed on 18 February 2024).
- Paszke, A.; Gross, S.; Massa, F.; Lerer, A.; Bradbury, J.; Chanan, G.; Killeen, T.; Lin, Z.; Gimelshein, N.; Antiga, L.; et al. Pytorch: An imperative style, high-performance deep learning library. Adv. Neural Inf. Process. Syst. 2019, 32, 8026–8037. [Google Scholar]
- Bergholm, V.; Izaac, J.; Schuld, M.; Gogolin, C.; Ahmed, S.; Ajith, V.; Alam, M.S.; Alonso-Linaje, G.; AkashNarayanan, B.; Asadi, A.; et al. PennyLane: Automatic differentiation of hybrid quantum-classical computations. arXiv 2022, arXiv:1811.04968. Available online: https://pennylane.ai/ (accessed on 18 February 2024).
- KU Community Cluster, Center for Research Computing, University of Kansas. Available online: https://crc.ku.edu/systems-services/ku-community-cluster (accessed on 18 February 2024).
- Kingma, D.P.; Ba, J. Adam: A method for stochastic optimization. arxiv 2014, arXiv:1412.6980. [Google Scholar]
- Arora, R.; Basu, A.; Mianjy, P.; Mukherjee, A. Understanding deep neural networks with rectified linear units. arxiv 2014, arXiv:1611.01491. [Google Scholar]
- Hur, T.; Kim, L.; Park, D. Quantum convolutional neural network for classical data classification. Quantum Mach. Intell. 2022, 4, 3. [Google Scholar] [CrossRef]
- Anton, F.K.; Franco, N. Quantum Bits with Josephson Junctions; Springer: Cham, Switzerland, 2019. [Google Scholar]
- Balauca, S.; Arusoaie, A. Efficient Constructions for Simulating Multi Controlled Quantum Gates. In Proceedings of the Computational Science—ICCS, 22nd International Conference, London, UK, 21–23 June 2022; Springer International Publishing: Cham, Switzerland, 2022; Volume 25, pp. 179–194. [Google Scholar] [CrossRef]
- Li, X.; Yang, G.; Torres, M.; Zheng, D.; Wang, L. A Class of Efficient Quantum Incrementer Gates for Quantum Circuit Synthesis. Int. J. Mod. Phys. B 2014, 28, 1350191, (Preprint). [Google Scholar] [CrossRef]
Data Size (No. of Sample Points) | (3) Averaging Classical/ Noise-Free | (3) Averaging Noisy ( Shots) | (5) Averaging Classical/ Noise-Free | (5) Averaging Noisy ( Shots) |
---|---|---|---|---|
256 | ||||
4096 | ||||
65,536 | ||||
1,048,576 |
Kernel | () Kernel Classical/Noise-Free | () Kernel Noisy ( Shots) | () Kernel Classical/Noise-Free | () Kernel Noisy ( Shots) |
---|---|---|---|---|
Average | ||||
Gaussian | ||||
Sobel-X | ||||
Sobel-Y | ||||
Laplacian |
Kernel | () Kernel Classical/Noise-Free | () Kernel Noisy ( Shots) | () Kernel Classical/Noise-Free | () Kernel Noisy ( Shots) |
---|---|---|---|---|
Average | ||||
Gaussian | ||||
Sobel-X | ||||
Sobel-Y | ||||
Laplacian |
Data Size () | () Averaging Classical/ Noise-Free | () Averaging Noisy ( Shots) | () Averaging Classical/ Noise-Free | () Averaging Noisy ( Shots) |
---|---|---|---|---|
() | ||||
() | ||||
() | ||||
() | ||||
() |
a Depth complexity of C2Q [12] data encoding (I/O) technique | ||||
b Complexity of proposed technique compared with classical convolutional neural network | ||||
MQCC Optimized with MAC-based fully connected layer | MQCC Optimized with ansatz-based fully connected layer | Direct (CPU) [21] | FFT (CPU/GPU) [21,22] | GEMM (GPU) [23,24] |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Jeng, M.; Nobel, A.; Jha, V.; Levy, D.; Kneidel, D.; Chaudhary, M.; Islam, I.; Facer, A.; Singh, M.; Baumgartner, E.; et al. Leveraging Data Locality in Quantum Convolutional Classifiers. Entropy 2024, 26, 461. https://doi.org/10.3390/e26060461
Jeng M, Nobel A, Jha V, Levy D, Kneidel D, Chaudhary M, Islam I, Facer A, Singh M, Baumgartner E, et al. Leveraging Data Locality in Quantum Convolutional Classifiers. Entropy. 2024; 26(6):461. https://doi.org/10.3390/e26060461
Chicago/Turabian StyleJeng, Mingyoung, Alvir Nobel, Vinayak Jha, David Levy, Dylan Kneidel, Manu Chaudhary, Ishraq Islam, Audrey Facer, Manish Singh, Evan Baumgartner, and et al. 2024. "Leveraging Data Locality in Quantum Convolutional Classifiers" Entropy 26, no. 6: 461. https://doi.org/10.3390/e26060461
APA StyleJeng, M., Nobel, A., Jha, V., Levy, D., Kneidel, D., Chaudhary, M., Islam, I., Facer, A., Singh, M., Baumgartner, E., Vanderhoof, E., Arshad, A., & El-Araby, E. (2024). Leveraging Data Locality in Quantum Convolutional Classifiers. Entropy, 26(6), 461. https://doi.org/10.3390/e26060461