Variational quantum one-class classier Gunhee Park1Joonsuk Huh2 3 4and Daniel K. Park5 6y 1Division of Engineering and Applied Science California Institute of Technology Pasadena CA 91125 USA

2025-05-06 0 0 804.89KB 12 页 10玖币
侵权投诉
Variational quantum one-class classifier
Gunhee Park,
1
Joonsuk Huh,
2, 3, 4,
and Daniel K. Park
5, 6,
1
Division of Engineering and Applied Science, California Institute of Technology, Pasadena, CA 91125, USA
2
Department of Chemistry, Sungkyunkwan University, Suwon, 16419, Republic of Korea
3
SKKU Advanced Institute of Nanotechnology, Sungkyunkwan University, Suwon, 16419, Republic of Korea
4
Institute of Quantum Biophysics, Sungkyunkwan University, Suwon, 16419, Republic of Korea
5
Department of Applied Statistics, Yonsei University, Seoul, 03722, Republic of Korea
6
Department of Statistics and Data Science, Yonsei University, Seoul, 03722, Republic of Korea
One-class classification is a fundamental problem in pattern recognition with a wide range of
applications. This work presents a semi-supervised quantum machine learning algorithm for such a
problem, which we call a variational quantum one-class classifier (VQOCC). The algorithm is suitable
for noisy intermediate-scale quantum computing because the VQOCC trains a fully-parameterized
quantum autoencoder with a normal dataset and does not require decoding. The performance
of the VQOCC is compared with that of the one-class support vector machine (OC-SVM), the
kernel principal component analysis (PCA), and the deep convolutional autoencoder (DCAE) using
handwritten digit and Fashion-MNIST datasets. The numerical experiment examined various
structures of VQOCC by varying data encoding, the number of parameterized quantum circuit layers,
and the size of the latent feature space. The benchmark shows that the classification performance of
VQOCC is comparable to that of OC-SVM and PCA, although the number of model parameters
grows only logarithmically with the data size. The quantum algorithm outperformed DCAE in most
cases under similar training conditions. Therefore, our algorithm constitutes an extremely compact
and effective machine learning model for one-class classification.
I. INTRODUCTION
With the growing demand for efficient and effective
methods to extract useful knowledge from data, Quantum
Machine Learning (QML) has emerged as a promising
application of quantum technology [
1
,
2
]. Many pattern
recognition problems in data science can be formulated
as a classification problem, which can be addressed via
supervised machine learning. Several theoretical works
showed that QML can be advantageous for classification in
terms of runtime [
3
9
], trainability and model capacity [
10
,
11], and prediction accuracy [12].
While the majority of existing works on QML for clas-
sification addresses binary problems, this work focuses on
one-class classification (OCC). One-class classification has
a wide range of applications, such as anomaly detection in
finance [
13
], bioinformatics [
14
], manufacturing [
15
], and
computer vision [
16
]. The goal of OCC is to train a ma-
chine learning (ML) model that distinguishes normal data
from anomalous ones. In OCC, instead of having input-
output example pairs as in the usual setup for supervised
learning, only the input information is provided. Since
the training example does not contain the class labels, the
OCC is often called semi-supervised learning and is more
difficult than the binary or multinomial classification with
the label information. Moreover, a multinomial classifier
can be constructed with multiple one-class classifiers.
One-class classification problems have been tackled by
statistical machine learning approaches, such as princi-
pal component analysis (PCA) [
17
], one-class support
joonsukhuh@gmail.com
dkd.park@yonsei.ac.kr
vector machine (OC-SVM) [
18
20
], and deep learning
based algorithms [
21
,
22
]. In particular, an autoencoder,
a feed-forward neural network that aims to copy its input
to its output [
23
25
], is widely used in one-class classi-
fication. An autoencoder consists of an encoder, which
extracts the essential feature of data and reduces dimen-
sion, and a decoder, which reconstructs the data. Given
a training dataset, an autoencoder is trained to act as
an identity function with respect to the training dataset
and the mean squared reconstruction error is subject to
minimization. For one-class classification, after training
a neural network as an autoencoder with normal class
data, the reconstruction error can be used as a decision
function [
26
,
27
]. Alternatively, the autoencoder can be
used as a feature extractor of other statistical machine
learning techniques like OC-SVM [28–30].
As a classical autoencoder is able to learn the efficient
representation of low dimensional latent space, a quantum
autoencoder (QAE) is proposed for efficient quantum data
compression. The QAE utilizes a Parameterized Quan-
tum Circuit (PQC) [
31
], which is central in variational
quantum algorithms [
32
]. In addition to quantum data
compression, several applications of QAE have been ex-
plored including denoising quantum data [
33
], quantum
error correction [
34
], quantum error mitigation [
35
], and
quantum metrology [
36
]. The QAE has also been explored
for detecting anomalous phases in the context of quantum
Hamiltonian problems [37].
Motivated by the success of classical autoencoders for
OCC problems, we present a Variational Quantum One-
Class Classifier (VQOCC) algorithm based on the QAE
that applies to classical data. The VQOCC is composed
of data encoding, PQC, and quantum measurements for
classical post-processing. In the past, anomaly detection
arXiv:2210.02674v1 [quant-ph] 6 Oct 2022
2
algorithms based on the quantum OC-SVM and quan-
tum PCA that could achieve exponential speedup were
proposed [
5
]. However, these quantum algorithms re-
quire expensive subroutines, such as the quantum linear
solver [
38
] and matrix exponentiation [
4
] that are not suit-
able for Noisy Intermediate-Scale Quantum (NISQ) com-
puting [
39
]. In contrast, training a shallow-depth PQC
with a classical optimizer is regarded as a promising ap-
proach for near-term quantum machine learning [
40
]. This
work focuses on taking the NISQ-friendly approach that
constructs a variational quantum algorithm for one-class
classification with classical data, and verifying whether a
quantum advantage can be attained.
Numerical experiments are performed on handwritten
digits and the Fashion-MNIST dataset with open-source
Python API Qibo [
41
] for quantum circuit simulation.
The performance of VQOCC is evaluated via the area
under a receiver operating characteristic (ROC) curve
(AUC), and compared to classical methods including OC-
SVM, Kernel PCA, and deep convolutional autoencoder
(DCAE). We benchmark the performance of VQOCC
with various structures of the quantum autoencoder. The
structure of the QAE is determined by selecting data
encoding, the number of PQC layers, and the size of
the latent feature space. The general result of VQOCC
shows comparable performance to the classical methods
despite having the number of model parameters grow
only logarithmically with the data feature size. Notably,
the performance of VQOCC is better than DCAE under
similar training conditions.
The remainder of the paper is organized as follows. Sec-
tion II describes the one-class classification and reviews
some of the well-known approaches to the problem. Sec-
tion III explains the quantum autoencoder, which is the
basis of the quantum one-class classifier proposed in this
work. Section IV explains the application of quantum
autoencoder for one-class classification and constructing
different models via modifying the ansatz (i.e. structure
of the PQC) and cost functions. Numerical experiments
performed using scikit-learn and Qibo with handwrit-
ten digits and Fashion-MNIST datasets are explained
in Sec. V. This section also compares the AUC of ROC
curves of our algorithm with a one-class SVM, a kernel
PCA, and a deep convolutional autoencoder. Section VI
provides conclusion and suggestions for future work.
II. ONE-CLASS CLASSIFICATION
Assigning an input data to one of a given set of classes
is a canonical problem in pattern recognition and can be
formally described as a classification problem. Classifi-
cation aims to predict the class label of an unseen (test)
data ˜
xRN, given a labelled (training) dataset
D={(x1, y1),...,(xM, yM)} ⊂ RN×Zl,
where
l
is the number of classes. The one-class classifi-
cation is a special case of the aforementioned problem
when
l
= 1 [
22
,
42
]. In this case, the training dataset is
D
=
{x1,x2,...,xM}
, which is treated as a normal class,
and the goal is to identify whether a test data
˜
x
is in the
normal class or not. Since anomalous data is not used
in training, this is known as semi-supervised learning. It
is also possible to perform one-class classification with
unsupervised methods with an unlabelled dataset under
the assumption that most of the test dataset is composed
of normal data [21, 22].
Given a training dataset of normal class
D
, a decision
function
f
(
x
;
x1,x2,...,xM
) is attained from a one-class
classification algorithm, which expresses how far the input
data is from the training dataset. If the decision function
f
(
˜
x
;
x1,x2,...,xM
) has a value smaller than a certain
threshold value
Cth
(i.e.
f
(
˜
x
)
< Cth
), then
˜
x
is classified
as normal. Otherwise, if
f
(
˜
x
)
> Cth
, then the test data
is classified as anomalous. If
f
(
˜
x
) =
Cth
, the decision can
be made at random.
Two well-known statistical approaches for addressing
one-class classification problems are principal compo-
nent analysis (PCA) [
17
] and support vector machine
(SVM) [
18
20
]. PCA is a dimensionality reduction tech-
nique that projects data
xi
into a lower dimensional sub-
space such that the projections have the largest variances.
The projected space provides reconstructed data
ˆ
xi
. The
lower dimensional subspace is determined to minimize
the reconstruction error
Pikxiˆ
xik2
. Once the lower
dimensional subspace is chosen, the reconstruction error
f
(
x
) =
kxˆ
xk2
can be considered as a decision function
for one-class classification, since it will be small for normal
data and large for anomalous one. The kernel trick can
be utilized in PCA to include non-linearity [43].
The support vector machine is a supervised learning
model that aims to find a hyperplane that separates two
classes of training data with the maximum margin. Thus
it is commonly used in binary classification. The SVM
can be modified for one-class classification by finding a
maximum-margin hyperplane that separates normal data
from the origin. This is known as the one-class SVM
(OC-SVM) [
18
,
19
]. The decision function of OC-SVM is
f(x) = hw,Φ(x)i − b, (1)
where
w
and
b
describes the hyperplane and Φ is the
feature map. If the decision function is positive (nega-
tive), the corresponding test data is classified as normal
(anomalous).
Alternatively, the SVM can be modified for one-class
classification by finding the smallest hypersphere that
encapsulates normal data. This is known as the support
vector data description (SVDD) [
20
]. After finding the
optimal hypersphere, the data located outside of the
hypersphere is classified as anomalous. In this case, the
decision function can be expressed as
f(x) = kΦ(x)ak2R, (2)
where
a
is a center of the hypersphere, and
R
is a radius of
the hypersphere. Note that when the data is normalized
3
Decoder
Encoder Data
Encoding
Parameterized
Quantum Circuit
One-Class
Classification
FIG. 1. Graphical representation of (a) QAE and (b) VQOCC with number of trash qubits
nt
= 2 and total qubits
n
= 6.
Quantum autoencoder is composed of encoder and decoder parts, which are represented as parameterized quantum circuit
U
(
θ
)
and
U
(
θ
), respectively. The VQOCC quantum circuit consists of three parts: data encoding (blue rectangle), parameterized
quantum circuit
U
(
θ
), and measurement of trash qubits for one-class classification. Note that the parameterized quantum
circuit and measurement from the VQOCC quantum circuit is directly taken from the encoder part of quantum autoencoder.
to unit norm, the OC-SVM and SVDD become equiva-
lent [
44
]. Intuitively, these methods can be understood as
a process of learning the boundary for the normal data
and identifying the data outside of the boundary to be
anomalies.
III. QUANTUM AUTOENCODER
QAE is the quantum-analog of classical autoencoder,
for which a PQC learns to reduce the dimensionality of
data [
31
]. The training is carried out through a classical
optimization process; hence, it is the classical-quantum
hybrid algorithm. The dimensionality reduction means
that a quantum autoencoder compresses quantum data
into a smaller number of qubits than the input qubits.
Following the convention used in classical machine learn-
ing, we refer to the set of qubits to which the data is
compressed as latent qubits. A QAE is composed of an
encoding part and a decoding part as depicted in Fig. 1
(a). The encoding part applies a parameterized unitary
gate
U
(
θ
), where
θ
is a set of trainable parameters, aim-
ing to compress data into latent qubits. Other qubits are
discarded after this step (i.e. traced out) and are called
trash qubits. The number of trash qubits is denoted by
nt
. For example, the QAE circuit in Fig. 1 (a) uses four
latent qubits and two trash qubits. The decoder applies
U
(
θ
) on the latent qubits and a reference state
|0int
to
reconstruct the initial quantum state. For a QAE to be
successful, the parameterized unitary gates for encoding
should learn to disentangle latent qubits and trash qubits
to put them into a product state. This guarantees the
reconstruction of the initial quantum state via decoding
with a proper ancillary state. The PQC is trained by min-
imizing a cost function defined with the quantum state
fidelity or Hamming distance between the trash qubit sys-
tem and the target state
|0int
[
31
,
45
,
46
]. More details
on the cost function used in this work will be described
in the next section.
IV. VARIATIONAL QUANTUM ONE-CLASS
CLASSIFIER
The QAE lays the ground for variational quantum
one-class classification. The structure of a QAE can
be simplified if it is applied to a one-class classification.
Namely, only the encoder part of the QAE is needed.
In Romero et al. [
31
], two cost functions based on the
trash state fidelity and the decoded state fidelity were
analyzed. It shows that the trash state fidelity is the upper
bound of the decoded state fidelity, and when the trash
state fidelity equals one, the decoded state fidelity also
equals one. The cost function based on the decoded state
requires the access of two identical copies of the input
state, whereas the cost function based on the trash state
does not. Thus formulating the optimization problem
with the cost function that only uses the trash state is
more advantageous in terms of computational resources.
After training the PQC to minimize the cost function
for the normal class training dataset, the cost function for
anomalous data is expected to yield values far from zero.
Hence by setting a threshold value to the cost function,
normal and anomalous data can be discriminated. In this
case, the cost function can be understood as a decision
function
f
of one-class classification, which is analogous
to using the reconstruction error as a decision function in
the classical autoencoder.
In the following, the essential steps of the QAE-based
VQOCC, namely data encoding, parameterized unitary
gates, and measurement of
nt
qubits from which the cost
function is evaluated, are explained in detail. Hereinafter,
摘要:

Variationalquantumone-classclassi erGunheePark,1JoonsukHuh,2,3,4,andDanielK.Park5,6,y1DivisionofEngineeringandAppliedScience,CaliforniaInstituteofTechnology,Pasadena,CA91125,USA2DepartmentofChemistry,SungkyunkwanUniversity,Suwon,16419,RepublicofKorea3SKKUAdvancedInstituteofNanotechnology,Sungkyunkw...

展开>> 收起<<
Variational quantum one-class classier Gunhee Park1Joonsuk Huh2 3 4and Daniel K. Park5 6y 1Division of Engineering and Applied Science California Institute of Technology Pasadena CA 91125 USA.pdf

共12页,预览3页

还剩页未读, 继续阅读

声明:本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。玖贝云文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知玖贝云文库,我们立即给予删除!
分类:图书资源 价格:10玖币 属性:12 页 大小:804.89KB 格式:PDF 时间:2025-05-06

开通VIP享超值会员特权

  • 多端同步记录
  • 高速下载文档
  • 免费文档工具
  • 分享文档赚钱
  • 每日登录抽奖
  • 优质衍生服务
/ 12
客服
关注