Triplet Loss Based Quantum Encoding for Class Separability
Marco Mordacci, Mahul Pandey, Paolo Santini and Michele Amoretti · 2025
Read Triplet Loss Based Quantum Encoding for Class Separability by Marco Mordacci, Mahul Pandey, Paolo Santini and Michele Amoretti (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2509-15705.txt.
Introduction
Marco Mordacci leads a team that teaches quantum circuits to place like data far apart. Their classifiers run on quantum states held in a space where distance matters. If states with the same label cluster tightly, sorting gets easier. Hard data, like medical images, need an encoding that builds those clusters on purpose.
The encoding circuit learns from a loss borrowed from face recognition, which pulls same label states close and pushes others away. Gaps between the averaged states of each class gauge the success. On handwriting and medical image tasks, the encoding beats a standard one with the same classifier. It also needs a much shallower circuit.
Catalog record
| CREATOR | Marco Mordacci, Mahul Pandey, Paolo Santini and Michele Amoretti |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 29 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2509-15705
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Triplet Loss Based Quantum Encoding for Class Separability Marco Mordacci, Mahul Pandey, Paolo Santini and Michele Amoretti Abstract An efficient and data-driven encoding scheme is proposed to enhance the performance of variational quantum classifiers. This encoding is specially designed for complex datasets like images and seeks to help the classification task by producing input states that form well-separated clusters in the Hilbert space according to their classification labels. The encoding circuit is trained using a triplet loss function inspired by classical facial recognition algorithms, and class separability is measured via average trace distances between the encoded density matrices. Benchmark tests performed on various binary classification tasks on MNIST and MedMNIST datasets demonstrate considerable improvement over amplitude encoding with the same VQC structure while requiring a much lower circuit depth. 1 Introduction The goal of quantum machine learning (QML) biamonte2017quantum is to take advantage of quantum computers to address learning tasks such as classification, regression, and content generation. A key component in QML is the data encoding strategy: the method by which classical data is embedded into the initial quantum states, to be subsequently manipulated using hybrid learning algorithms schuld2018supervised ; larose2020robust . The encoding step is, in essence, the most important one, as it defines the working principle of the quantum algorithm, often constitutes the bottleneck step in terms of runtime, and the choice of encoding significantly influences the performance of the learning algorithm. Commonly used encoding schemes, such as angle encoding and amplitude encoding schuld2018supervised , are not efficient. Angle encoding maps classical data x=(x_{1},...,x_{n}) into a quantum state using rotation angles: |x\rangle=\bigotimes_{i=1}^{n}\cos(x_{i})|0\rangle+\sin(x_{i})|1\rangle. (1) However, angle encoding is not efficient in terms of the number of qubits, as it can encode only one feature per qubit. Amplitude encoding, instead, maps a normalized classical N -dimensional data x into the amplitudes of a quantum state: |\psi_{x}\rangle=\sum_{i=1}^{N}x_{i}|i\rangle (2) where N=2^{n} , x_{i} is the i^{th} element of x and |i\rangle is the i^{th} computational basis state. However, amplitude encoding requires a quantum circuit whose depth increases exponentially with the number of qubits mottonen2004transformation ; sun2023asymptotically ; belli2025srbb . This is a relevant issue, as in the current Noisy Intermediate-Scale Quantum (NISQ) era, quantum devices are prone to noise and deeper circuits tend to produce noise. Furthermore, these methods do not take advantage of the structure of the data, which could be exploited for improved classification or generalization. In this work, a novel approach to quantum encoding is explored, specifically aimed at classification problems, that is adaptive and data-driven. Instead of using an a-priori fixed encoding map, an encoding circuit is designed and optimized specifically for the classification task at hand. More precisely, it aims to embed input data in a way that explicitly achieves class separability in the Hilbert space. The method is inspired by FaceNet Schroff2015 , a classical deep learning model for face recognition that employs a triplet loss function to encourage similar inputs to be mapped close together and dissimilar ones far apart in the embedding space. The paper is organized as follows. In Section 2 , the state-of-the-art is discussed and some of the recent developments in addressing the problem of quantum embeddings for machine learning are summarized. In Section 3 , the mathematical problem and the objective are defined. The strategy is described in Section 4 , where the triplet loss and how it drives the embedding circuit construction are explained. The basic variational classifier that uses these embedded states to make predictions is also described in that section. In Section 5 , results from both simulation and real hardware are reported. Finally, in Section 6 an overview of findings and future outlook is presented. 2 Related Work In recent years, the problem of encoding classical data into a quantum state has attracted considerable interest. A well-designed encoding scheme can simplify the task for the Variational Quantum Circuit (VQC), but the most commonly used methods, angle and amplitude encoding, present several challenges. Several algorithms have been developed in recent years to address this problem. A comprehensive benchmarking of the most well-known encoding schemes, viz. amplitude, angle and IQP embedding havlicek2018 has been carried out in zang2025 on various datasets including the MNIST01 and MNIST08 subsets. These results are useful as a benchmark test for advanced encoding schemes that better take into account the data structure. In recent years, a research field known as Quantum Architecture Search (QAS) martyniuk2024quantum has emerged, aiming to identify the optimal quantum circuit architecture for both the encoding stage and the VQC. Techniques such as Reinforcement Learning kuo2021quantum ; kolle2024optimizing , evolutionary algorithms jin2024practicality ; wang2022quantumnas ; altares2021automatic ; sunkel2023ga4qco , and particle swarm optimization were applied kolle2024optimizing ; mordacci2025training . Genetic algorithms katoch2021review are used to learn the whole architecture of the encoding scheme. Those are optimization techniques based on the theory of evolution. The algorithms evolve a population of individuals with the encoded feature maps, through the application of genetic operators. In each generation, the resulting offspring is selected in order to improve the objectives. In altares2021automatic , the authors optimized the quantum feature maps in a quantum kernel Support Vector Machine (SVM) rebentrost2014quantum . The genetic algorithm stores the circuit of each individual and aims to maximize the accuracy of the feature maps in modeling the data, while minimizing circuit complexity. The results show that it can produce a classifier with 100\% accuracy that generalizes well to unseen data. In lloyd2020quantum , the authors, inspired by the so-called classical ”metric learning” bromley1993signature ; chopra2005learning , trained the quantum embedding using the trace and Hilbert-Schmidt distances. Drawing inspiration from classical kernel methods hofmann2008kernel , quantum kernel methods map classical data into a high-dimensional quantum feature space mercadier2023quantum ; gentinetta2024complexity ; yin2024experimental ; ding2025quantum . The similarity between data points is then calculated using a quantum kernel, which is essentially the inner product of the quantum states. In schuld2019quantum , two strategies inspired by kernel theory hofmann2008kernel to find patterns in the data were proposed. One estimates intractable quantum kernels by feeding them into a classical kernel method; the other applies VQC to learn models that process the feature vectors. Rath et al. rath2024quantum analyzed the impact of quantum encoding techniques (basis, superposition, angle, and amplitude encodings) in classical machine learning. Various classical algorithms were tested, such as SVM, Decision Tree, Random Forest, and AdaBoost. In gonzalez2024efficient , an efficient method for amplitude encoding of real polynomial functions was proposed. Another interesting embedding is the Hamiltonian encoding schuld2018supervised ; di2021improving , where classical data are encoded into the parameters of a system’s Hamiltonian. The choice of the encoding method plays a crucial role, as it can lead to the emergence of barren plateaus larocca2025barren , which cause the gradients to vanish exponentially with the size of the system, hindering effective training. The entanglement entropy calabrese2004entanglement generated by a quantum circuit can follow either a volume law or an area law. In a volume law regime, entanglement scales proportionally with the total number of qubits in the system; while in the area law scenario, entanglement entropy scales proportionally with the number of qubits at the boundary. Consequently, the applied encoding method can induce barren plateaus by generating excessive entanglement entropy leone2024practical .