Table of Contents
Fetching ...

Quantum Patch-Based Autoencoder for Anomaly Segmentation

Maria Francisca Madeira, Alessandro Poggiali, Jeanette Miriam Lorenz

TL;DR

The paper targets pixel-level anomaly segmentation in images by introducing a Quantum Patch-Based Autoencoder (QPB-AE) that operates entirely on quantum hardware with a patch-wise processing strategy. Each patch is embedded into a quantum state, compressed via a Matrix Product State (MPS) encoder, and evaluated with a SWAP-test fidelity to yield patch-level anomaly scores, which are stitched into a full anomaly map without reconstructing the full image. The approach achieves logarithmic parameter scaling with patch size and demonstrates competitive anomaly localization across MvTEC-AD and BUSI datasets with far fewer trainable parameters than a classical autoencoder baseline. This work highlights the practical potential of QML for unsupervised anomaly segmentation on NISQ devices, with promising implications for low-data regimes and resource-efficient quantum architectures.

Abstract

Quantum Machine Learning investigates the possibility of quantum computers enhancing Machine Learning algorithms. Anomaly segmentation is a fundamental task in various domains to identify irregularities at sample level and can be addressed with both supervised and unsupervised methods. Autoencoders are commonly used in unsupervised tasks, where models are trained to reconstruct normal instances efficiently, allowing anomaly identification through high reconstruction errors. While quantum autoencoders have been proposed in the literature, their application to anomaly segmentation tasks remains unexplored. In this paper, we introduce a patch-based quantum autoencoder (QPB-AE) for image anomaly segmentation, with a number of parameters scaling logarithmically with patch size. QPB-AE reconstructs the quantum state of the embedded input patches, computing an anomaly map directly from measurement through a SWAP test without reconstructing the input image. We evaluate its performance across multiple datasets and parameter configurations and compare it against a classical counterpart.

Quantum Patch-Based Autoencoder for Anomaly Segmentation

TL;DR

The paper targets pixel-level anomaly segmentation in images by introducing a Quantum Patch-Based Autoencoder (QPB-AE) that operates entirely on quantum hardware with a patch-wise processing strategy. Each patch is embedded into a quantum state, compressed via a Matrix Product State (MPS) encoder, and evaluated with a SWAP-test fidelity to yield patch-level anomaly scores, which are stitched into a full anomaly map without reconstructing the full image. The approach achieves logarithmic parameter scaling with patch size and demonstrates competitive anomaly localization across MvTEC-AD and BUSI datasets with far fewer trainable parameters than a classical autoencoder baseline. This work highlights the practical potential of QML for unsupervised anomaly segmentation on NISQ devices, with promising implications for low-data regimes and resource-efficient quantum architectures.

Abstract

Quantum Machine Learning investigates the possibility of quantum computers enhancing Machine Learning algorithms. Anomaly segmentation is a fundamental task in various domains to identify irregularities at sample level and can be addressed with both supervised and unsupervised methods. Autoencoders are commonly used in unsupervised tasks, where models are trained to reconstruct normal instances efficiently, allowing anomaly identification through high reconstruction errors. While quantum autoencoders have been proposed in the literature, their application to anomaly segmentation tasks remains unexplored. In this paper, we introduce a patch-based quantum autoencoder (QPB-AE) for image anomaly segmentation, with a number of parameters scaling logarithmically with patch size. QPB-AE reconstructs the quantum state of the embedded input patches, computing an anomaly map directly from measurement through a SWAP test without reconstructing the input image. We evaluate its performance across multiple datasets and parameter configurations and compare it against a classical counterpart.
Paper Structure (16 sections, 10 equations, 6 figures, 3 tables)

This paper contains 16 sections, 10 equations, 6 figures, 3 tables.

Figures (6)

  • Figure 1: a) MPS ansatz, $U_{\text{MPS}}(\boldsymbol{\theta})$, used for compression of the patch quantum state. Each block on the MPS has the same structure, but different trainable parameters. The circuit is used as the encoder on QPB-AE, while $U_{\text{MPS}}^{\dagger}(\boldsymbol{\theta})$ is used as the decoder. b) The chosen two-qubit MPS block, composed of two trainable $\text{R}_\text{Y}$ gates and a $\text{CNOT}$ gate.
  • Figure 2: Schematic representation illustrating the full quantum autoencoder circuit (employed during the test phase to obtain the final anomaly maps). Each patch $x^p$ is encoded into a quantum state $|\phi\rangle$. The state is processed by the quantum autoencoder, that attempts to reconstruct the input wavefunction. A SWAP test between the input and reconstructed patch states yields a fidelity score that is post-processed to be interpreted as a probabilitic anomaly score.
  • Figure 3: Schematic representation of the training process of QPB-AE. An optimal compression of the input patch $|\phi\rangle$ is obtained by maximizing the average fidelity between the trash state and the reference state over all patches. After all patches are evaluated, the full map is constructed, the cost function is evaluated and the parameters are updated.
  • Figure 4: QPB-AE results on several breast ultrasound images (BUSI dataset), for $P=4$ and $S=1$. The top, middle, and bottom rows show the input images, predicted anomaly maps, and ground-truth masks, respectively.
  • Figure 5: Dice score (a) and IoU (b) for several threshold values across the evaluated datasets, for $P=4$, $S=1$ and $BD=2$.
  • ...and 1 more figures