Generative tensor network classification model for supervised machine learning

Zheng-Zhi Sun, Peng Cheng, Ding Liu, Shi-Ju Ran, Gang Su · DOI

Abstract

The tensor network (TN) has recently triggered extensive interest in developing machine learning models defined in quantum Hilbert space. Here, we propose a generative TN classification (GTNC) model for supervised machine learning. The strategy is first to map the classical data onto the states in a many-body Hilbert space and then to capture these states with tensor network schemes. We adopt the TN in the form of matrix product states as an example to implement GTNC where the testing images are classified by comparing the fidelities between different states. Our results show that GTNC has a very impressive performance on benchmark datasets in comparison to several well-known machine learning models. The advantage of GTNC is reflected from the facts that the samples are naturally clustering in the many-body Hilbert space, and it relies much less on hyperparameters. These characters make GTNC an adaptive and universal quantum-inspired method, which would have important applications in quantum computation and quantum information.

Introduction

In traditional machine learning, mapping data into higher-dimensional spaces—such as the "kernel trick" in Support Vector Machines (SVMs)—is a common strategy to make different classes linearly separable. However, as dimensionality increases, computational costs often explode, a phenomenon known as the "curse of dimensionality."

This paper explores the use of Tensor Networks (TNs), mathematical tools originally designed to simulate quantum many-body systems, to address this challenge. While previous TN-based machine learning research has largely focused on discriminative models, this work introduces a generative approach. The authors investigate whether learning the underlying distribution of each class individually within a "quantum" Hilbert space can lead to more robust and efficient classification.

Methodology: The GTNC Pipeline

The GTNC approach follows a three-step pipeline to transform classical images into quantum-inspired representations:

  1. Feature Mapping: Each pixel of an image is mapped to a two-component vector (similar to a qubit state) using a trigonometric function. An image of $L$ pixels is thus represented as a product state in a massive $2^L$-dimensional Hilbert space.
  2. Generative Training: Instead of a single model for all classes, the authors train one Matrix Product State (MPS)—a 1D Tensor Network—for each specific class (e.g., one for the digit '4', one for '9'). Each MPS learns the joint probability distribution of its respective class.
  3. Classification via Fidelity: To classify a new image, the model calculates the fidelity (a quantum mechanical measure of similarity) between the test image and each class's generative TN. The image is assigned to the class with the highest fidelity.
Visualization of mapping classical data to a many-body Hilbert space for classification.

Key Insights: Natural Clustering and Regularization

A striking finding of this research is that data naturally "clusters" when mapped to the many-body Hilbert space. The fidelity between different classes was found to be significantly lower than the fidelity within the same class, suggesting that the quantum representation inherently simplifies the separation of complex data.

Furthermore, the model utilizes the bond dimension ($\chi$) as a natural regularizer. In Tensor Networks, $\chi$ controls the amount of information (or entanglement) the network can carry. By limiting $\chi$, the model is forced to discard redundant, less-entangled information, which prevents overfitting and improves overall testing accuracy.

Performance and Results

The GTNC model was evaluated against benchmark datasets, including MNIST (handwritten digits) and Fashion-MNIST (clothing items).

  • Accuracy: On MNIST, GTNC achieved a testing accuracy of 97.6% (at $\chi=32$). On the more complex Fashion-MNIST, it reached 88.2%.
  • Comparison: GTNC significantly outperformed traditional generative classifiers like Naive Bayes ($<70.6\%$) and remained competitive with SVMs while requiring far less hyperparameter tuning.
  • Efficiency: Because GTNC trains on one class at a time, it is orders of magnitude faster than discriminative TN models ($9 \times 10^3$ seconds vs. $4 \times 10^6$ seconds).
Testing accuracy of GTNC vs. bond dimension χ compared to baseline models.

Conclusion and Future Directions

While GTNC shows impressive performance and robustness, it currently trails state-of-the-art Convolutional Neural Networks (CNNs) in raw accuracy. The authors attribute this to the 1D nature of the MPS architecture, which may not fully capture 2D spatial correlations. Future work will explore 2D Tensor Networks (such as PEPS) and the implementation of these models on actual quantum hardware, where fidelity calculations are natively efficient.

Summary updated

BibTeX
@inproceedings{sun2020generative,
  author = {Zheng-Zhi Sun and Peng Cheng and Ding Liu and Shi-Ju Ran and Gang Su},
  title = {{Generative tensor network classification model for supervised machine learning}},
  booktitle = {Physical},
  year = {2020},
  doi = {10.1103/physrevb.101.075135},
}
Figure