Table of Contents
Fetching ...

Applying Quantum Autoencoders for Time Series Anomaly Detection

Robin Frehner, Kurt Stockinger

TL;DR

This paper explores the application of quantum autoencoders to time series anomaly detection and investigates two primary techniques for classifying anomalies: Analyzing the reconstruction error generated by the quantum autoencoder and latent representation analysis.

Abstract

Anomaly detection is an important problem with applications in various domains such as fraud detection, pattern recognition or medical diagnosis. Several algorithms have been introduced using classical computing approaches. However, using quantum computing for solving anomaly detection problems in time series data is a widely unexplored research field. This paper explores the application of quantum autoencoders to time series anomaly detection. We investigate two primary techniques for classifying anomalies: (1) Analyzing the reconstruction error generated by the quantum autoencoder and (2) latent representation analysis. Our simulated experimental results, conducted across various ansaetze, demonstrate that quantum autoencoders consistently outperform classical deep learning-based autoencoders across multiple datasets. Specifically, quantum autoencoders achieve superior anomaly detection performance while utilizing 60-230 times fewer parameters and requiring five times fewer training iterations. In addition, we implement our quantum encoder on real quantum hardware. Our experimental results demonstrate that quantum autoencoders achieve anomaly detection performance on par with their simulated counterparts.

Applying Quantum Autoencoders for Time Series Anomaly Detection

TL;DR

This paper explores the application of quantum autoencoders to time series anomaly detection and investigates two primary techniques for classifying anomalies: Analyzing the reconstruction error generated by the quantum autoencoder and latent representation analysis.

Abstract

Anomaly detection is an important problem with applications in various domains such as fraud detection, pattern recognition or medical diagnosis. Several algorithms have been introduced using classical computing approaches. However, using quantum computing for solving anomaly detection problems in time series data is a widely unexplored research field. This paper explores the application of quantum autoencoders to time series anomaly detection. We investigate two primary techniques for classifying anomalies: (1) Analyzing the reconstruction error generated by the quantum autoencoder and (2) latent representation analysis. Our simulated experimental results, conducted across various ansaetze, demonstrate that quantum autoencoders consistently outperform classical deep learning-based autoencoders across multiple datasets. Specifically, quantum autoencoders achieve superior anomaly detection performance while utilizing 60-230 times fewer parameters and requiring five times fewer training iterations. In addition, we implement our quantum encoder on real quantum hardware. Our experimental results demonstrate that quantum autoencoders achieve anomaly detection performance on par with their simulated counterparts.
Paper Structure (40 sections, 16 figures, 3 tables)

This paper contains 40 sections, 16 figures, 3 tables.

Figures (16)

  • Figure 1: Examples of different anomalies in time series data. Dashed lines indicate normality thresholds, red lines highlight anomalies, and grey lines represent the observed time series. Figure \ref{['fig:AnomalyTypesSfig1']} shows a point anomaly, where a value of 1.5 exceeds the normal range. Figure \ref{['fig:AnomalyTypesSfig2']} illustrates a contextual anomaly, where the value is typical but anomalous given its context. Figure \ref{['fig:AnomalyTypesSfig3']} depicts a collective anomaly, where data points are individually within normal noise levels but collectively exhibit a prolonged period of lower values.
  • Figure 2: The figures depict a 7-qubit quantum autoencoder circuit. Despite requiring 9 qubits for training, it is termed a 7-qubit autoencoder due to the number of qubits in the state preparation and encoder sub-circuit. Figure \ref{['fig:QAEArchitectureSfig1']} illustrates the circuit used during training, while Figure \ref{['fig:QAEArchitectureSfig2']} shows the final autoencoder capable of reconstructing input states. Encoder parameters optimized during training the archictecure in Figure \ref{['fig:QAEArchitectureSfig1']} are transferred to the setup in \ref{['fig:QAEArchitectureSfig2']}. In both figures, $\phi(\vec{x})$ represents the state preparation procedure, and $Encoder$ denotes a quantum variational sub-circuit with consistent architecture in both setups. Additionally, $|0\rangle$ signifies qubit reset (qubit 6), and $Encoder^{\dag}$ denotes the conjugate transpose of the encoder, serving as the decoding component.
  • Figure 3: The high level methodology employed for anomaly detection in this study encompasses a systematic approach, beginning with data preprocessing. Subsequently, the quantum state preparation procedure is performed, followed by applying the chosen autoencoding ansatz. Upon completion of these computational phases, the resultant data is subjected to postprocessing procedures and final anomaly classification. The notations CPU and QPU delineate between actions executed on classical computing architectures (CPU) and those performed on quantum hardware platforms (QPU).
  • Figure 4: Illustration of the datasets employed in this work. The data is an excerpt of the test data with red indicating the anomaly. The anomalies range from relatively easy to spot (dataset 28) to very subtle and hard to spot (dataset 176).
  • Figure 5: Illustration of the classical deep learning autoencoder used as the baseline in this study. This architecture follows the design employed by frehner2024detecting. In this work, the window size is set to 128, while other parameters remain unchanged.
  • ...and 11 more figures