Transfer learning in hybrid classical-quantum neural networks

Andrea Mari, Thomas R. Bromley, Josh Izaac, Maria Schuld, and Nathan Killoran

Xanadu, 777 Bay Street, Toronto, Ontario, Canada.

Find this paper interesting or want to discuss? Scite or leave a comment on SciRate.


We extend the concept of transfer learning, widely applied in modern machine learning algorithms, to the emerging context of hybrid neural networks composed of classical and quantum elements. We propose different implementations of hybrid transfer learning, but we focus mainly on the paradigm in which a pre-trained classical network is modified and augmented by a final variational quantum circuit. This approach is particularly attractive in the current era of intermediate-scale quantum technology since it allows to optimally pre-process high dimensional data (e.g., images) with any state-of-the-art classical network and to embed a select set of highly informative features into a quantum processor. We present several proof-of-concept examples of the convenient application of quantum transfer learning for image recognition and quantum state classification. We use the cross-platform software library PennyLane to experimentally test a high-resolution image classifier with two different quantum computers, respectively provided by IBM and Rigetti.

Transfer learning is a typical example of an artificial intelligence technique that has been originally inspired by biological intelligence. It originates from the simple observation that the knowledge acquired in a specific context can be transferred to a different area. For example, when we learn a second language we do not start from scratch, but we make use of our previous linguistic knowledge. Sometimes transfer learning is the only way to approach complex cognitive tasks, e.g., before learning quantum mechanics it is advisable to first study linear algebra. This general idea has been successfully applied also to design artificial neural networks. It has been shown that in many situations, instead of training a full network from scratch, it is more efficient to start from a pre-trained deep network and then optimize only some of the final layers for a particular task and dataset of interest. The aim of this work is to investigate the potential of the transfer learning paradigm in the context of quantum machine learning.

► BibTeX data

► References

[1] Sasank Chilamkurthy, PyTorch transfer learning tutorial. https:/​/​​tutorials/​beginner/​transfer_learning_tutorial.html. Accessed: 2019-08-08.

[2] https:/​/​​XanaduAI/​quantum-transfer-learning. Accessed: 2020-29-06.

[3] Tetris, Wikipedia, 2019. https:/​/​​wiki/​Tetris. Accessed: 2019-08-08.

[4] Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, et al. TensorFlow: Large-scale machine learning on heterogeneous distributed systems. arXiv preprint arXiv:1603.04467, 2016.

[5] Soumik Adhikary, Siddharth Dangwal, and Debanjan Bhowmik. Supervised learning with a quantum classifier using multi-level systems. Quantum Information Processing, 19 (3): 89, 2020. 10.1007/​s11128-020-2587-9.

[6] Frank Arute et al. Quantum supremacy using a programmable superconducting processor. Nature, 574 (7779): 505–510, 2019. 10.1038/​s41586-019-1666-5.

[7] Marcello Benedetti, John Realpe-Gómez, and Alejandro Perdomo-Ortiz. Quantum-assisted Helmholtz machines: A quantum–classical deep learning framework for industrial datasets in near-term devices. Quantum Science and Technology, 3 (3): 034007, 2018. 10.1088/​2058-9565/​aabd98.

[8] Yoshua Bengio, Aaron Courville, and Pascal Vincent. Representation learning: A review and new perspectives. IEEE Transactions on Pattern Analysis and Machine Intelligence, 35 (8): 1798–1828, 2013. 10.1109/​tpami.2013.50.

[9] Ville Bergholm, Josh Izaac, Maria Schuld, Christian Gogolin, and Nathan Killoran. PennyLane: Automatic differentiation of hybrid quantum-classical computations. arXiv preprint arXiv:1811.04968, 2018.

[10] Jacob Biamonte, Peter Wittek, Nicola Pancotti, Patrick Rebentrost, Nathan Wiebe, and Seth Lloyd. Quantum machine learning. Nature, 549 (7671): 195, 2017. 10.1038/​nature23474.

[11] Alfredo Canziani, Adam Paszke, and Eugenio Culurciello. An analysis of deep neural network models for practical applications. arXiv preprint arXiv:1605.07678, 2016.

[12] Kelvin Ch'Ng, Juan Carrasquilla, Roger G Melko, and Ehsan Khatami. Machine learning phases of strongly correlated fermions. Physical Review X, 7 (3): 031038, 2017. 10.1103/​physrevx.7.031038.

[13] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. ImageNet: A large-scale hierarchical image database. In 2009 IEEE Conference on Computer Vision and Pattern Recognition, pages 248–255. IEEE, 2009. 10.1109/​CVPR.2009.5206848.

[14] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. 2019. 10.18653/​v1/​n19-1423.

[15] Vedran Dunjko, Jacob M Taylor, and Hans J Briegel. Quantum-enhanced machine learning. Physical Review Letters, 117 (13): 130501, 2016. 10.1103/​physrevlett.117.130501.

[16] Héctor Abraham et al. . Qiskit: An open-source framework for quantum computing., 2019. 10.5281/​zenodo.2562110.

[17] Edward Farhi and Hartmut Neven. Classification with quantum neural networks on near term processors. arXiv preprint arXiv:1802.06002, 2018.

[18] Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep learning. MIT press, 2016.

[19] Aram W Harrow and Ashley Montanaro. Quantum computational supremacy. Nature, 549 (7671): 203, 2017. 10.1038/​nature23458.

[20] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 770–778, 2016. 10.1109/​cvpr.2016.90.

[21] Maxwell Henderson, Samriddhi Shakya, Shashindra Pradhan, and Tristan Cook. Quanvolutional neural networks: powering image recognition with quantum circuits. Quantum Machine Intelligence, 2 (1), feb 2020. 10.1007/​s42484-020-00012-y.

[22] Jeremy Howard and Sebastian Ruder. Universal language model fine-tuning for text classification. 2018. 10.18653/​v1/​p18-1031.

[23] Patrick Huembeli, Alexandre Dauphin, and Peter Wittek. Identifying quantum phase transitions with adversarial neural networks. Physical Review B, 97 (13): 134109, 2018. 10.1103/​physrevb.97.134109.

[24] Nathan Killoran, Thomas R. Bromley, Juan Miguel Arrazola, Maria Schuld, Nicolás Quesada, and Seth Lloyd. Continuous-variable quantum neural networks. Physical Review Research, 1 (3), oct 2019a. 10.1103/​physrevresearch.1.033063.

[25] Nathan Killoran, Josh Izaac, Nicolás Quesada, Ville Bergholm, Matthew Amy, and Christian Weedbrook. Strawberry Fields: A software platform for photonic quantum computing. Quantum, 3: 129, 2019b. 10.22331/​q-2019-03-11-129.

[26] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.

[27] Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009.

[28] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems, pages 1097–1105, 2012. 10.1145/​3065386.

[29] Ding Liu, Shi-Ju Ran, Peter Wittek, Cheng Peng, Raul Blázquez García, Gang Su, and Maciej Lewenstein. Machine learning by unitary tensor network of hierarchical tree structure. New Journal of Physics, 21 (7): 073059, 2019. 10.1088/​1367-2630/​ab31ef.

[30] Jarrod R McClean, Jonathan Romero, Ryan Babbush, and Alán Aspuru-Guzik. The theory of variational hybrid quantum-classical algorithms. New Journal of Physics, 18 (2): 023023, 2016. 10.1088/​1367-2630/​18/​2/​023023.

[31] Sinno Jialin Pan and Qiang Yang. A survey on transfer learning. IEEE Transactions on Knowledge and Data Engineering, 22 (10): 1345–1359, 2009. 10.1109/​tkde.2009.191.

[32] Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in PyTorch. In NIPS Autodiff Workshop, 2017.

[33] Alejandro Perdomo-Ortiz, Marcello Benedetti, John Realpe-Gómez, and Rupak Biswas. Opportunities and challenges for quantum-assisted machine learning in near-term quantum computers. Quantum Science and Technology, 3 (3): 030502, 2018. 10.1088/​2058-9565/​aab859.

[34] Alberto Peruzzo, Jarrod McClean, Peter Shadbolt, Man-Hong Yung, Xiao-Qi Zhou, Peter J Love, Alán Aspuru-Guzik, and Jeremy L O’brien. A variational eigenvalue solver on a photonic quantum processor. Nature Communications, 5: 4213, 2014. 10.1038/​ncomms5213.

[35] Sebastien Piat, Nairi Usher, Simone Severini, Mark Herbster, Tommaso Mansi, and Peter Mountney. Image classification with quantum pre-training and auto-encoders. International Journal of Quantum Information, 16 (08): 1840009, 2018. 10.1142/​s0219749918400099.

[36] Lorien Y Pratt. Discriminability-based transfer between neural networks. In Advances in Neural Information Processing Systems, pages 204–211, 1993.

[37] John Preskill. Quantum computing in the NISQ era and beyond. Quantum, 2: 79, 2018. 10.22331/​q-2018-08-06-79.

[38] Rajat Raina, Alexis Battle, Honglak Lee, Benjamin Packer, and Andrew Y Ng. Self-taught learning: transfer learning from unlabeled data. In Proceedings of the 24th International Conference on Machine Learning, pages 759–766. ACM, 2007. 10.1145/​1273496.1273592.

[39] Maria Schuld and Nathan Killoran. Quantum machine learning in feature Hilbert spaces. Physical Review Letters, 122 (4): 040504, 2019. 10.1103/​physrevlett.122.040504.

[40] Maria Schuld, Ilya Sinayskiy, and Francesco Petruccione. An introduction to quantum machine learning. Contemporary Physics, 56 (2): 172–185, 2015. 10.1080/​00107514.2014.964942.

[41] Maria Schuld, Alex Bocharov, Krysta M. Svore, and Nathan Wiebe. Circuit-centric quantum classifiers. Physical Review A, 101 (3), mar 2020. 10.1103/​physreva.101.032308.

[42] Kodai Shiba, Katsuyoshi Sakamoto, Koichi Yamaguchi, Dinesh Bahadur Malla, and Tomah Sogabe. Convolution filter embedded quantum gate autoencoder. arXiv preprint arXiv:1906.01196, 2019.

[43] Sukin Sim, Peter D. Johnson, and Alán Aspuru-Guzik. Expressibility and entangling capability of parameterized quantum circuits for hybrid quantum-classical algorithms. Advanced Quantum Technologies, 2 (12): 1900070, 2019. 10.1002/​qute.201900070.

[44] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.

[45] Robert S Smith, Michael J Curtis, and William J Zeng. A practical quantum instruction set architecture. arXiv preprint arXiv:1608.03355, 2016. 10.5281/​zenodo.3677540.

[46] Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1–9, 2015. 10.1109/​cvpr.2015.7298594.

[47] Lisa Torrey and Jude Shavlik. Transfer learning. In Handbook of Research on Machine Learning Applications and Trends: Algorithms, Methods, and Techniques, pages 242–264. IGI Global, 2010. 10.4018/​978-1-60566-766-9.ch011.

[48] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems, pages 5998–6008, 2017.

[49] Guillaume Verdon, Michael Broughton, Jarrod R. McClean, Kevin J. Sung, Ryan Babbush, Zhang Jiang, Hartmut Neven, and Masoud Mohseni. Learning to learn with quantum neural networks via classical neural networks. arXiv preprint arXiv:1907.05415, 2019.

[50] Christian Weedbrook, Stefano Pirandola, Raúl García-Patrón, Nicolas J Cerf, Timothy C Ralph, Jeffrey H Shapiro, and Seth Lloyd. Gaussian quantum information. Reviews of Modern Physics, 84 (2): 621, 2012. 10.1103/​RevModPhys.84.621.

[51] Jason Yosinski, Jeff Clune, Yoshua Bengio, and Hod Lipson. How transferable are features in deep neural networks? In Advances in Neural Information Processing Systems, pages 3320–3328, 2014.

[52] Remmy Zen, Long My, Ryan Tan, Frédéric Hébert, Mario Gattobigio, Christian Miniatura, Dario Poletti, and Stéphane Bressan. Transfer learning for scalability of neural-network quantum states. Physical Review E, 101 (5), 2020. 10.1103/​physreve.101.053301.

Cited by

[1] Francesco Tacchino, Panagiotis Kl. Barkoutsos, Chiara Macchiavello, Dario Gerace, Ivano Tavernelli, and Daniele Bajoni, 2020 IEEE International Conference on Quantum Computing and Engineering (QCE) 130 (2020) ISBN:978-1-7281-8969-7.

[2] Ljubomir Budinski, "Quantum algorithm for the advection–diffusion equation simulated with the lattice Boltzmann method", Quantum Information Processing 20 2, 57 (2021).

[3] Xi He, "Quantum subspace alignment for domain adaptation", Physical Review A 102 6, 062403 (2020).

[4] Ryan LaRose and Brian Coyle, "Robust data encodings for quantum classifiers", Physical Review A 102 3, 032420 (2020).

[5] Samuel Yen-Chi Chen, Shinjae Yoo, and Yao-Lung L. Fang, "Quantum Long Short-Term Memory", arXiv:2009.01783.

[6] Philip Easom-McCaldin, Ahmed Bouridane, Ammar Belatreche, and Richard Jiang, "Towards Building A Facial Identification System Using Quantum Machine Learning Techniques", arXiv:2008.12616.

[7] Samuel Yen-Chi Chen, Tzu-Chieh Wei, Chao Zhang, Haiwang Yu, and Shinjae Yoo, "Quantum Convolutional Neural Networks for High Energy Physics Data Analysis", arXiv:2012.12177.

[8] Samuel Yen-Chi Chen, Chih-Min Huang, Chia-Wei Hsing, and Ying-Jer Kao, "Hybrid quantum-classical classifier based on tensor network and variational quantum circuit", arXiv:2011.14651.

[9] Francesco Tacchino, Panagiotis Barkoutsos, Chiara Macchiavello, Ivano Tavernelli, Dario Gerace, and Daniele Bajoni, "Quantum implementation of an artificial feed-forward neural network", Quantum Science and Technology 5 4, 044010 (2020).

[10] Xi He, "Quantum correlation alignment for unsupervised domain adaptation", Physical Review A 102 3, 032410 (2020).

[11] Samuel Yen-Chi Chen, Tzu-Chieh Wei, Chao Zhang, Haiwang Yu, and Shinjae Yoo, "Hybrid Quantum-Classical Graph Convolutional Network", arXiv:2101.06189.

[12] Rongxin Xia and Sabre Kais, "Hybrid Quantum-Classical Neural Network for Calculating Ground State Energies of Molecules", Entropy 22 8, 828 (2020).

[13] Andrew Blance and Michael Spannowsky, "Quantum machine learning for particle physics using a variational quantum classifier", Journal of High Energy Physics 2021 2, 212 (2021).

[14] Soumik Adhikary, "Entanglement assisted training algorithm for supervised quantum classifiers", arXiv:2006.13302.

[15] Richie Yeung, "Diagrammatic Design and Study of Ansätze for Quantum Machine Learning", arXiv:2011.11073.

[16] Samuel Yen-Chi Chen and Shinjae Yoo, "Federated Quantum Machine Learning", arXiv:2103.12010.

[17] Xi He, Chufan Lyu, Min-Hsiu Hsieh, and Xiaoting Wang, "Quantum transfer component analysis for domain adaptation", arXiv:1912.09113.

[18] Saurabh Kumar, Siddharth Dangwal, and Debanjan Bhowmik, "Supervised Learning Using a Dressed Quantum Network with "Super Compressed Encoding": Algorithm and Quantum-Hardware-Based Implementation", arXiv:2007.10242.

[19] Samuel Yen-Chi Chen, Chih-Min Huang, Chia-Wei Hsing, and Ying-Jer Kao, "An end-to-end trainable hybrid classical-quantum classifier", arXiv:2102.02416.

[20] Angelina Gokhale, Mandaar B. Pande, and Dhanya Pramod, "Implementation of a quantum transfer learning approach to image splicing detection", International Journal of Quantum Information 18 5, 2050024-220 (2020).

[21] Jasvith Raj Basani and Aranya B Bhattacherjee, "Continuous-Variable Deep Quantum Neural Networks for Flexible Learning of Structured Classical Information", arXiv:2006.10927.

[22] Dominic Pasquali, "Simultaneous Quantum Machine Learning Training and Architecture Discovery", arXiv:2009.06093.

[23] William M Watkins, Samuel Yen-Chi Chen, and Shinjae Yoo, "Quantum machine learning with differential privacy", arXiv:2103.06232.

[24] En-Jui Kuo, Yao-Lung L. Fang, and Samuel Yen-Chi Chen, "Quantum Architecture Search via Deep Reinforcement Learning", arXiv:2104.07715.

The above citations are from Crossref's cited-by service (last updated successfully 2021-04-21 14:59:21) and SAO/NASA ADS (last updated successfully 2021-04-21 14:59:22). The list may be incomplete as not all publishers provide suitable and complete citation data.