arXiv:2610.09635quant-phOct 2026

Manuscript Offprint

arXiv:2610.09635

Quantum anomaly detection in real scarce data

Emanuele Casciaro, Fabio Mascherpa, Alfonso Amendola, Filippo Caruso

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Anomaly detection on small and unbalanced datasets remains very challenging in machine learning, although this scenario is common in several domains, including healthcare, cybersecurity, finance, and energy. Data augmentation and generative AI may mitigate training-data scarcity, but they often fall short because anomalies are, by definition, unpredictable, rare, and highly diverse events compared to high-probability normal data. Overfitting to pseudo-anomalies, model collapse, high-dimensional data, uninterpretable black-box models, and validation challenges are typical issues limiting their practical applicability. In this context, quantum machine learning may provide a promising and more sustainable avenue because it can enable more interpretable models with far fewer trainable parameters and smaller datasets, implementable on energy-efficient quantum hardware. Here, we propose a novel two-step hybrid classical–quantum architecture for sequential data and test it on a realistic scenario in the global energy-transition domain, i.e., automated anomaly detection in large-scale photovoltaic plants. The achieved generalization capability and competitive prediction accuracy may pave the way for new hybrid learning models able to exploit the continuously increasing power of cloud-available and more sustainable quantum accelerators integrated with more traditional energy-hungry High Performance Computing resources.

Introduction

In the context of learning theory, anomaly detection (AD) addresses the problem of identifying whether a sample (or a time window) is normal or anomalous, whereas anomaly classification (AC) aims to assign an anomalous sample to a specific fault type. An anomaly is commonly defined as an observation that does not conform to the expected behavior of the system 1^{1}. In real-world settings, AD/AC datasets are therefore highly unbalanced (anomalies are rare by definition), and crucially, anomaly labels are often scarce or expensive to obtain (i.e., requiring expert inspection), which can severely limit solutions based on labeled data. As the reliability of digital systems becomes a critical aspect, AD has become increasingly relevant in recent research, with notable applications in fields ranging from cybersecurity 2,3^{2,3} to financial fraud detection 4^{4}, IoT systems 5^{5}, smart cities 6^{6} and energy applications 7^{7}, to name just a few. In industrial contexts, AD and AC systems find valuable use in predictive maintenance, one common application being in large-scale solar photovoltaic plants 8^{8}. Predictive maintenance aims to prevent or reduce plant downtime due to major malfunctions by repairing or replacing defective components at the first signs of divergence from their expected behavior. Such anomalies in component operation may be undetectable or too costly to track through human inspection but easily recognized by sensors or imaging. This can be exploited by devising software capable of recognizing unexpected behavior from real-time sensor data or automatically inspecting panels for visible and non-visible defects 9^{9} (i.e., by thermal imaging) and sending warnings to prompt a timely response when needed.

A more complex formulation often related to the problem of predictive maintenance involves dealing with sequential data, often provided by a large number of sensors. The time dimension present in the so-called time series anomaly detection (TS-AD) introduces additional challenges due to the dynamic nature of the system, which makes it more difficult to reliably define and consequently identify an anomaly. In TS-AD, unexpected behavior can be classified into three main categories 10^{10}. Point anomalies, or outliers, are the simplest category. These are individual data points that are inherently anomalous, in the sense that they do not belong to the general data distribution. Contextual anomalies are more difficult to identify; a data point that would not be anomalous per se becomes so in relation to its specific neighborhood or context. Finally, collective anomalies are anomalies that concern a group of data points that are close to each other and collectively deviate from the underlying distribution. In most TS-AD applications, it is more interesting to capture the last two types of anomalies, which can only be identified by studying the correlations emerging among data points in the sequence over time.

In recent years, many machine learning algorithms have been proposed to solve the AD problem, leveraging assumptions about the data distribution to identify outliers. The isolation forest algorithm 11^{11}, for instance, flags as anomalies the most isolated sampled points and is used in the predictive maintenance of IoT-aided PV systems 12^{12}. Other methods flag as anomalies those instances that fail to associate with any other point in the dataset 13^{13}, or learn a decision boundary based on previously seen sets comprising only non-anomalous data. The One-Class Support Vector Machine (SVM) 14^{14}, for example, adapts the SVM formulation to the AD task and is widely used in monitoring large industrial plants 15^{15}. However, all these methods are only capable of dealing with point anomalies and are not suitable for processing temporal information; in the context of TS-AD, the Autoregressive Integrated Moving Average (ARIMA) family of models 16^{16} allows processing sequential information and is commonly used to monitor individual critical components (e.g., a turbogenerator 17^{17}). Basic ARIMA models can only handle univariate sequences, but the related and more general Vector Autoregression family of models 18^{18} enables working with sequences of vectors as well, extending the scope of the methods to more realistic settings, including those with complex, multivariate data.

Recent advances in ML have led to the development of deep learning methods, which employ large parameterized models to learn a latent representation of the data and subsequently use this information to learn the desired target function. A widely used pattern in standard unsupervised AD is the autoencoder architecture 19^{19}, which learns to reconstruct non-anomalous data from a lower-dimensional representation and flags as anomalous any data point whose reconstruction error exceeds a certain threshold. This approach assumes that the dataset can be described by a set of latent variables, which are learned and used to fit a training set containing only sane data due to the scarcity of anomalous samples. Other techniques build upon a similar concept to exploit the scarcity of labeled anomalies; in 20^{20}, a deep learning architecture is used to learn a latent representation of a dataset alongside a minimal hypersphere S\mathcal{S} that contains all points, signaling at test time every point projected by the model that does not belong to S\mathcal{S} as an anomaly, with promising results in industrial AD benchmarks on real-time production images 21^{21}.

Over the years, several deep learning architectures have been proposed to deal with correlations within data sequences; the Convolutional Neural Network (CNN) 22^{22} method learns several one-dimensional convolutional filters from the data, allowing the extraction of some information from the sequence, at the cost of fixing the size of the learned sequence; this lightweight model can be successfully applied in the monitoring of simple, non-interconnected systems with short-term memory, as in 23^{23}, where a convolutional model is used in the predictive maintenance of mechanical equipment, using the data relative to their vibrations. The Recurrent Neural Network (RNN) 24^{24} method, which is frequently used in AD in PV plants 25^{25}, improves this aspect by storing a hidden state vector h, which is updated every time a new element is processed, allowing the encoding of sequences with indefinite length, at the cost of an exponentially vanishing gradient as the sequence grows, due to the repeated operations on the same weight matrix. The Long Short-Term Memory (LSTM) cell 26^{26} enables a partial update of the recurrent cell, leading to the gradients vanishing more slowly and therefore larger treatable datasets; one of the most recent and popular solutions is the Transformer architecture 27^{27}, which encodes every element of a sequence with arbitrary length using a non-linear mapping of the query, key and value" representation, and then computes a final embedding from them, taking into account every other element and its intersections within the sequence. This method is successfully demonstrated in 28^{28} as a means to reliably isolate occurrences of anomalous energy output of PV systems caused by harsh climate conditions.

A common trend is the adoption of increasingly larger models as the size of the problem grows. Although this reflects the increasing complexity of the task at hand, this choice is not always optimal due to the new set of challenges that may arise when dealing with a high number of trainable parameters. These include a more expensive training procedure that requires more time and more data, and less predictable, more black-box behavior as the models size and complexity grow.

Quantum Machine Learning (QML) may offer a way around the numerical challenges presented by such problems by taking advantage of the unique characteristics of quantum algorithms to bypass some of the computational limits of classical ML methods 29^{29}, including in the field of AD 30^{30}. In particular, Quantum Neural Networks (QNN) have attracted much interest in the past few years. Similarly to its classical counterpart, a QNN uses a set of parameters to learn a quantum function, which is capable of expressing complex relationships not possible in classical ML by exploiting superposition and entanglement to express non-classical states 31^{31}.

In this work, we try to harness the power of quantum computation to perform anomaly classification in a realistic energy transition problem, assessing the capabilities of QNNs to achieve desirable performance using smaller (in terms of parameters) models, leading to more efficient and less expensive training. The article is structured as follows: in Section , we showcase and discuss the results of a test application of our method over a realistic dataset, and in Section , the theoretical and empirical background of our work is provided, followed by the description of our hybrid training procedure.

References (44)