Professional Documents
Culture Documents
Quantum Image Filtering in The Frequency Domain
Quantum Image Filtering in The Frequency Domain
1
Abstract—In this paper we address the emerging field of The research in quantum image processing is still
Quantum Image Processing. We investigate the use of quantum confronting with fundamental aspects such as representing
computing systems to represent and manipulate images. In and storing an image on a quantum computer and the basic
particular, we consider the basic task of image filtering. We
processing operations. Representation of color information
prove that a quantum version for this operation can be
achieved, even though the quantum convolution of two on one qubit was proposed for the Qubit Lattice approach
sequences is physically impossible. In our approach we use the [8] and was also employed in the FRQI framework [9].
principle of the quantum oracle to implement the filter Several basic processing operations were defined in the
function. We provide the quantum circuit that implements the FRQI framework: geometrical transformations [10], one-
filtering task and present the results of several simulation qubit quantum gates applied on the color wire [11], a
experiments on grayscale images. There are important
similarity measure between two images based on pixel
differences between the classical and the quantum
implementations for image filtering. We analyze these differences [12], two strategies for quantum image
differences and show that the major advantage of the quantum watermarking [13, 14].
approach lies in the exploitation of the efficient implementation Beach et al. [15] show that Grover's quantum search
of the quantum Fourier transform. algorithm [16] is applicable to image processing tasks such
as pose recognition in a model-based machine vision
Index Terms—quantum image processing, quantum Fourier system.
transform, quantum oracle, image filtering.
Other important contributions to the quantum image-
processing field rely on the exploitation of maybe the most
I. INTRODUCTION
valuable resource of many–qubit quantum systems,
The spectacular perspectives offered by the realization of entanglement. It was shown that it could lead to the
a quantum computer have determined an increasing interest development of efficient methods for representing and
for research in quantum information and quantum retrieving information about the objects in a quantum image
computation. It seems that, in certain cases, the massive [17] and also to a quantum image compression scheme [18].
parallelism inherent in quantum computational systems can In this paper we focus on how to achieve a quantum
lead to exponential speedups over the best classical version of a rather basic classical task, that of image
approaches [1-3]. Nevertheless, exploiting the remarkable filtering. A common approach is to convolve the image with
properties of quantum systems for developing efficient a filter function, which in the frequency domain translates
quantum algorithms is a challenging task. This is due to the into a multiplication operation. However, there are
fundamental differences between the operating modes of fundamental differences between classical and quantum
quantum and classical computers. operations, the latter being necessarily invertible due to the
The key role in most of the known quantum algorithms is reversible nature of quantum computation. Therefore there
played by the quantum Fourier transform. It is the main are classical processing operations that cannot be directly
ingredient for the efficient quantum order-finding algorithm applied to quantum images. Such examples are convolution
introduced by Peter Shor [4]. Other problems such as and correlation [19]. In our paper we describe a method to
performing discrete logarithms and factoring, which for achieve the filtering of a quantum image by exploiting the
large numbers are considered intractable on a classical quantum Fourier transform and the principle of the quantum
computer, benefit from similar speedups as they can be oracle.
reduced to order finding. Before describing the proposed quantum image-filtering
The remarkable properties of quantum systems have led algorithm, background is given to make the paper self-
to the emergence of innovative ideas in all major fields of contained. We give a short introduction to the basic
computing, including graphics processing. Nevertheless, concepts in quantum computing and briefly overview the
speeding up certain signal processing tasks is a rather under quantum version of the discrete Fourier transform. In
researched area. There is an important potential use of Section III we describe our approach for representing a
quantum computation in this field generated by the more quantum image and then discuss the proposed technique for
efficient quantum versions of the Fourier transform, wavelet quantum image filtering. In Section IV we provide the
transform [5] and of the discrete cosine transform [6-7]. results of applying various filters on quantum images by
1
performing simulation experiments. In Section V we
This work was supported by the project PERFORM-ERA Postdoctoral analyze the features of the proposed quantum algorithm for
Performance for Integration in the European Research Area (ID-57649),
financed by the European Social Fund and the Romanian Government). image filtering with respect to its classical counterpart and
Digital Object Identifier 10.4316/AECE.2013.03013
77
1582-7445 © 2013 AECE
[Downloaded from www.aece.ro on Monday, April 19, 2021 at 02:30:57 (UTC) by 179.61.159.184. Redistribution subject to AECE license or copyright.]
to the use of other quantum image representation The action of the controlled-Not gate is x, y x, x y ,
approaches. In Section VI we summarize our conclusions
and discuss the prospects for further development of the where is addition modulo two, and has the following
quantum image-processing field in the light of the new matrix representation:
contributions presented in this paper. 1 0 0 0
0 1 0 0
CNOT . (5)
II. BASIC CONCEPTS IN QUANTUM COMPUTING 0 0 0 1
The quantum analogous of the classical bit is called a
0 0 1 0
qubit. The states of the qubit can be completely described by
The only irreversible operation allowed is the
the superposition of two orthonormal basis states, which in
measurement of quantum states, which has the effect of
Dirac notation are labelled 0 and 1 (in a Hilbert space collapsing the superposition into one of the computational
C 2 ). This orthonormal system 0 , 1, with basis states.
A direct consequence of the principles of quantum
0 1 0 and 1 0 1 , is called computational
T T
physics is the immense computing power of a quantum
machine compared to that of a classical one. This is due to
basis. Any state can be described by a linear
three remarkable quantum resources that have no classical
combination of these two states: counterparts: quantum parallelism, quantum interference
0 1 with 1 .
2 2
(1) and entanglement of quantum states.
These remarkable properties of quantum systems allowed
Complex values and represent the probability
the formulation of optimal algorithms for two fundamental
amplitudes of the basis states. This means that measuring problems: integer factorization (Shor's algorithm [4]) and
the quantum system yields 0 with probability
2
the search in an unstructured database (Grover's algorithm
[16]). Thus, two main classes of quantum algorithms have
and 1 with probability .
2
better time complexity than their classical counterparts. The
The state of an n -qubit quantum computer is described algorithms in the first class are based on the quantum
by an unit vector in Hilbert space H C 2 :
n
Fourier transform and provide remarkable solutions for
2n 1
solving the factorization and discrete logarithm problems,
i i (2) with an exponential speedup over the best known classical
i 0 algorithms. The algorithms in the second class are based on
2n 1 the mechanism of quantum amplitude amplification [21]
1 and i
2 2
where i represents the probability of found in Grover's quantum search algorithm. This class of
i 0
algorithms provides a quadratic speedup with respect to the
obtaining state i when measuring the register. best classical algorithms.
A quantum register s is represented by a sequence of
qubits. If s is an n -qubit quantum register and U is an III. QUANTUM IMAGE FILTERING
operator in the states space H , then the operator U (s) A. Representation of Quantum Images
applied to a register is called a quantum gate. Any quantum In order to represent the quantum image we will use a
operator is a unitary operator and thus any computational quantum register prepared in a state that encodes both color
process can be implemented by a sequence of quantum and position of a pixel [22]:
gates. Elementary quantum gates include single qubit gates
1 2 1 2 1
2n m
78
[Downloaded from www.aece.ro on Monday, April 19, 2021 at 02:30:57 (UTC) by 179.61.159.184. Redistribution subject to AECE license or copyright.]
79
[Downloaded from www.aece.ro on Monday, April 19, 2021 at 02:30:57 (UTC) by 179.61.159.184. Redistribution subject to AECE license or copyright.]
Figure 2. The quantum circuit for image filtering in the frequency domain.
used, the output image is the sum of the image containing state representing the frequencies removed by the filter:
the high frequencies and the image containing the 22 n t t
corresponding low frequencies. The additional qubit can be I1 2n
I1bad 2 n I1good , (15)
2 2
used to make the distinction between the two images.
In the following we analyse this process and describe the where I1good is the state containing the ‘good’ frequencies
state of the quantum image filtering circuit at each step of
that the filter allows to pass, I1bad is the state containing
the computation as marked in Fig. 2. The input state I 0 is
the ‘bad’ frequencies that are suppressed by the filter and t
represented by the input image and an additional qubit in
is the number of ‘good’ frequencies. Applying the oracle
state 0 :
operator U H to this superposition one can use the additional
2n 1 2n 1 2m 1
1
I0 Q 0
2n
y 0 x 0 j 0
ij j y x 0 , (12) qubit to make the distinction between the two states, where
the action of U H is
where Q holds the quantum image using the kp z
UH
kp z H (k , p) . (16)
representation described in Section III.A. Applying the I 2 I m U H I1
quantum Fourier transform on the image produces state 2 i ( yk xp )
2n 1 2n 1 2m 1 2n 1 , (17)
j UH k p 0
1
I1 :
22 n
yxj e 2n
y 0 x 0 j 0 k , p 0
I1 I m QFT22 n Q I 0
U H only acts on the position qubits and leaves the color
2n 1 2n 1 2m 1
1
2n
yxj j QFT22 n y x 0 qubits unaffected. In our case z is initially 0 and the
y 0 x 0 j 0
filter H (k , p ) is
2n 1 2n 1 2m 1
2
1
n yxj
j QFT2n y QFT 2n
x 0 (13) 1, k , p S good
H (k , p ) . (18)
0, k , p Sbad
y 0 x 0 j 0
2n 1 2n 1 2m 1 2n 1 2 iyk 2n 1 2 ixp
1
22 n
y 0 x 0 j 0
yxj j e
k 0
2n
k e
p 0
2n
p 0 S good and Sbad represent the sets of coordinates for the
‘good’ and ‘bad’ frequencies classified accordingly by the
2n 1 2n 1 2m 1 2n 1 2 iyk 2 ixp
1
corresponding filter function. The resulting state, I 2 can
2n
n n
2 2
yxj e e j k p 0
2 y 0 x 0 j 0 k , p 0 thus be re-written:
2 iyk 2 ixp
1 2 1 2 1 2 1
n n m
where I and I m denote the identity operator on one and m
I 2 2 n yxj e 2 e 2 j k p 0
n n
qubits, respectively. We also used the fact that the quantum 2 y 0 x 0 j 0 k , pSbad
Fourier transform on k qubits is the k -fold tensor product 2 iyk 2 ixp
(19)
2n 1 2n 1 2m 1
1
of k one-qubit quantum Fourier transforms (written 2n
2
y 0 x 0 j 0 k , pS good
yxj e 2n
e 2n
j k p 1
QFT k ):
TABLE 1. THE Sgood AND Sbad FREQUENCY SETS FOR SOME
QFT2k i k
QFT k ik 1 i1i0 COMMON IDEAL FILTERS.
. (14)
QFT ik 1 QFT i0 Filter Frequency Sets
Low-pass
The next step performed by the quantum circuit is the S good k , p D(k , p ) D0
equivalent of the classical filtering step. Nevertheless, there Sbad k , p D(k , p ) D0
is a fundamental distinction compared to the classical High-pass
operation that allows us to avoid the result proved by S good k , p D(k , p ) D0
Lomont. The state of the register holding the image does not Sbad k , p D(k , p ) D0
actually change to a state representing the filtered image but Band-pass
rather it undergoes an interference process with the S k , p DL D(k , p ) DH
good
additional qubit initially in state 0 . This is achieved using Sbad k , p D(k , p ) DL and D(k , p) DL
a quantum oracle built using the filter function H (k , p ) . Band-stop
S good k , p D(k , p ) DL and D (k , p ) D
The quantum state I1 is actually a superposition of two Sbad k , p DL D(k , p ) DH
states, a state representing only the filtered frequencies and a
80
[Downloaded from www.aece.ro on Monday, April 19, 2021 at 02:30:57 (UTC) by 179.61.159.184. Redistribution subject to AECE license or copyright.]
Various choices for the filter function H (k , p ) lead to both images in the final superposition using the quantum
different values in the ‘good’ and ‘bad’ frequency sets. storage and retrieval protocol described by Venegas-
Table 1 shows the different sets associated with some ideal Andraca and Bose [8]. The disadvantage of this protocol is
filters. that it involves preparing several copies of the input image,
The last computational step in the quantum circuit in Fig. applying the same computational process on each copy and
2 represents the inverse quantum Fourier transform that then sampling using the measurement operator. This is in
reverts from the frequency to the spatial representation of fact a statistical procedure that serves for minimizing the
the image. The final state of the circuit contains the uncertainty in the retrieval process of a quantum parameter.
superposition of two quantum images: the image containing This uncertainty comes from the probabilistic nature of
the frequencies passed by the filter and the image containing quantum measurement.
the frequencies suppressed by the filter. For example, if a An alternative for extracting useful information from a
low-pass filter is used, the final image is actually a quantum-transformed image is to apply further processing
superposition of the low-frequencies image and the high- steps. In fact, this is also the common procedure in classical
frequencies image. Moreover, the distinction between these image processing. The filtering step is part of a pre-
two images can still be made using the additional qubit: processing stage where the image is enhanced such that
further operations, e.g. segmentation, could be better
I3
applied. Then, other classes of measurements could be
1 2 1 2 1 2 1
n n m
applied on the processed image that could reveal its
yxj j QFT21 k QFT21 p 0
22 n y0 x0 j 0 k , pS
n n
properties without the need to actually ‘see’ the processed
bad
2n 1 2n 1 2m 1 2n 1 2n 1 2 i ( kr pt )
1 IV. SIMULATION OF QUANTUM IMAGE FILTERING
23 n
r 0 t 0 j 0 k , pS good y 0 x 0
'
yxj e 2n
j r t 1
In this section we present the results of applying the
,(21) filtering operation on the gray scale images in Fig. 3. The
2n 1 2n 1 2m 1
1
23 n
b
rtj j r t 0 simulations were performed in MATLAB by representing
r 0 t 0 j 0
the quantum images in the form of an ij -matrix according
2n 1 2n 1 2m 1
1
23 n
r 0 t 0 j 0
g
rtj j r t 1 to (6) and by applying (21) to compute the intensity values
for the pixels in the resulting quantum states that represent
Qbad 0 Qgood 1 the filtered images, Qbad and Qgood . Three 32 by 32
where the color of a pixel with position rt is pixels images were used: a synthetic image containing only
two gray levels (Fig. 3 left) and two sub-images of a
2m 1
1
22 n
j 0
b
rtj j in the image containing the suppressed microscopy image (Fig. 3 right). For each image, the color
information for each pixel is represented using m 8 qubits
1 2m 1 to encode 256 possible gray levels and the pixel positions
frequencies, Qbad , and
22 n
j 0
g
rtj j in the image with are encoded using 2n 10 qubits.
The synthetic image was filtered using a high pass filter
the frequencies passed through by the filter, Qgood . with D0 6.4 and the resulting high- and low-frequency
In classical image processing the final stage usually images are shown in Fig. 4, corresponding to the Qgood
assumes extracting information from the result by looking at
the image. This, however, cannot be achieved in the and Qbad states, respectively. Scaled versions of the 32 by
quantum domain because the resulting image(s) are stored in 32 images are presented. As expected, the high-pass filter
quantum states. A measurement on the final state I 3 only emphasizes a horizontal edge in the middle of the image and
samples from the transformed image, revealing only the the low-pass filter has a blurring effect. The horizontal
color at a single pixel position. However, one can retrieve bands in the filtered images are due to the ringing effect of
81
[Downloaded from www.aece.ro on Monday, April 19, 2021 at 02:30:57 (UTC) by 179.61.159.184. Redistribution subject to AECE license or copyright.]
the ideal filter. Fourier transform. For comparison and displaying purposes,
the classical representation of the quantum high- and low-
frequency images is extracted from the corresponding
quantum superpositions by multiplying the amplitudes, i.e.
the coefficients, with the integer encoding of the state
vectors. Just like in the classical case, negative floating point
values are also obtained for the gray levels in the filtered
images. The minimum value in the image is displayed as
black, the maximum value is displayed as white and the
values in between are displayed as intermediate shades of
Figure 3. Test images. Left – synthetic image, 32 32 pixels, with two gray, using 256 gray levels. The gray level for pixel (3,3) in
gray levels. Right – Microscopy image of a tissue section displaying cell the high-frequency image is represented as 105 and in the
nuclei as bright round objects; A,B are 32 32 pixels sub-images used for
low-frequency image as 246.
testing purposes.
The results of filtering sub-images A and B of the
microscopy image are presented in Fig. 5 and Fig. 6. As
only four gray levels are present in the original sub-image
A, the quantum representation of each pixel in the filtered
images is expressed as a superposition of four basis vectors.
The gray levels and the corresponding amplitudes in the
quantum representation of pixel (3,3) of sub-image A are
detailed in Table III. The original sub-image B contains 189
different gray levels. The quantum amplitudes of the
superposition representing the intensity value of the same
Figure 4. Result of filtering the synthetic image in Fig. 3 with a high-pass pixel in sub-image B are presented in Fig. 7.
filter, D0 0.2 32 6.4 . Left – image containing the corresponding high
frequencies. Right – image containing the corresponding low frequencies.
82
[Downloaded from www.aece.ro on Monday, April 19, 2021 at 02:30:57 (UTC) by 179.61.159.184. Redistribution subject to AECE license or copyright.]
83
[Downloaded from www.aece.ro on Monday, April 19, 2021 at 02:30:57 (UTC) by 179.61.159.184. Redistribution subject to AECE license or copyright.]
representation. Moreover, we envision that a more advanced applications for quantum information processing. It would
quantum image processing field will exploit various image also represent an overall justification for the immense
representation models. This is much like in the classical case efforts needed for building working quantum computers.
where one uses different image formats and color models
depending on the purpose of the image manipulation process REFERENCES
(we use compressed formats for image transmission, the [1] D. R. Simon, “On the Power of Quantum Computation”, SIAM J.
RGB color model for image display, the L*a*b* color Comput. 26, 5, pp. 1474-1483, 1997, dx.doi.org/
10.1137/S0097539796298637.
model for color analysis, etc.). [2] D. Deutsch and R. Jozsa, “Rapid Solution of Problems by Quantum
Computation”, Proc. R. Soc. Lond. A, 439, pp. 553-558, 1992,
VI. CONCLUSIONS dx.doi.org/10.1098/rspa.1992.0167.
[3] E. Bernstein and U. Vazirani, “Quantum Complexity Theory”, SIAM
In this paper we addressed the field of Quantum J. Comput. 26, 5 pp. 1411-1473, 1997,
Information Processing by analyzing the prospects of dx.doi.org/10.1137/S0097539796300921.
applying quantum computation concepts to image [4] P. Shor, “Algorithms For Quantum Computation: Discrete
Logarithms and Factoring”, in: SFCS '94: Proc. of the 35th Annual
processing tasks. Specifically, we developed a quantum Symposium on Foundations of Computer Science, IEEE Computer
version for the image filtering operation. This is an Society, 1994, pp. 124-134, dx.doi.org/ 10.1109/SFCS.1994.365700.
important technique that comes up in many image [5] A. Fijany, C. Williams, “Quantum Wavelet Transform: Fast
Algorithm and Complete Circuits”, arXiv:quant-ph/9809004, 1998.
processing applications. It is usually applied in the early [6] A. Klappenecker, M. Roetteler, “Discrete Cosine Transforms on
stages of vision processing for image enhancement. For Quantum Computers”, arXiv:quant-ph/0111038, 2001.
example, it can be used to eliminate undesirable [7] C. C. Tseng, T. M. Hwang, “Quantum Circuit Design of 8x8 Discrete
Cosine Transform Using Its Fast Computation Flow Graph”, in:
characteristics introduced in the acquisition process (e.g. Circuits and Systems, 2005. ISCAS 2005. IEEE International
noise) or to emphasize various structures in the image prior Symposium on, pp. 828-831 Vol. 1,
to a segmentation process (e.g. edges). In classical dx.doi.org/10.1109/ISCAS.2005.1464716.
[8] S. Venegas-Andraca and S. Bose, “Storing, Processing and Retrieving
computing, image filtering can be achieved by convolving an Image Using Quantum Mechanics,” in Proc. of the SPIE Conf.
the image with a mask representing the filter. However, Quantum Information and Computation, 2003, pp. 137–147,
convolution with large filters is a very expensive process in dx.doi.org/ 10.1117/12.485960.
[9] P. Le, F. Dong, and K. Hirota, “A Flexible Representation of
the spatial domain. The alternative is to apply filtering in the Quantum Images for Polynomial Preparation, Image Compression,
frequency domain as it corresponds to a multiplication and Processing Operations,” Quantum Inf. Process., vol. 10, pp. 63–
operation. Either way, to the best of our knowledge, no 84, 2011, dx.doi.org/ 10.1007/s11128-010-0177-y.
quantum algorithm has yet been devised to implement this [10] P. Q. Le, A. M. Iliyasu, F. Dong, K. Hirota, “Strategies for Designing
Geometric Transformations on Quantum Images”, Theor. Comput.
operation. Sci. 412 (2011), 1406-1418, dx.doi.org/ 10.1016/j.tcs.2010.11.029.
Our quantum version for the image filtering operation [11] P. Q. Le, A. M. Iliyasu, F. Dong, K. Hirota, “Efficient Color
avoids convolving the image with a filter, which has been Transformations on Quantum Images”, JACIII 15 (2011) 698-706.
[12] F. Yan, P. Q. Le, A. M. Iliyasu, B. Sun, J. A. Garcia, F. Dong and K.
proved to be physically impossible to realize directly [19], Hirota, “Assessing the Similarity of Quantum Images Based on
and uses a quantum oracle to act as a filter. This quantum Probability Measurements,” 2012 IEEE World Congress on
image filtering mechanism has several advantages over the Computational Intelligence, Brisbane, 10-15 June 2012, pp. 1-6,
dx.doi.org/ 10.1109/CEC.2012.6256418.
classical case: [13] A. M. Iliyasu, P. Q. Le, F. Dong, and K. Hirota, “Watermarking and
- It exploits the speedup introduced by the quantum authentication of quantum images based on restricted geometric
version of the Fourier transform and thus it is transformations”. Inf. Sci. 186, 1, pp. 126-149, 2012,
dx.doi.org/10.1016/j.ins.2011.09.028.
exponentially faster; [14] W. Zhang, F. Gao, B. Liu, Q. Wen, and H. Chen, “A watermark
- It exploits the properties of quantum superpositions and strategy for quantum images based on quantum Fourier transform”
thus requires less memory space to represent and process Quantum Inf. Process. 12, 2, pp. 793-803, 2013,
dx.doi.org/10.1007/s11128-012-0423-6.
the image ( m 2n qubits are needed to store a 2n 2n [15] G. Beach, C. Lomont, C. Cohen, “Quantum Image Processing
image with L 2m gray levels compared to m 22 n (QuIP)”, in: Proc. of 32nd Workshop on Applied Imagery Pattern
Recognition, 2003, pp. 39-44, dx.doi.org/
classical bits); 10.1109/AIPR.2003.1284246.
- The output quantum state incorporates information about [16] L. K. Grover, “A Fast Quantum Mechanical Algorithm for Database
both components of the original image – the image Search”, in: Proc. of the 28th annual ACM Symposium on Theory of
Computing, STOC '96, ACM, New York, NY, USA, 1996, pp. 212-
containing the frequencies passed by the filter and the 219, dx.doi.org/ 10.1145/237814.237866.
image containing the frequencies stopped by the filter. [17] S. Venegas-Andraca, J. Ball, “Processing Images in Entangled
The two components can be efficiently distinguished and Quantum Systems”, Quantum Inf. Process. 9 (2010) 1-11, dx.doi.org/
10.1007/s11128-009-0123-z.
exploited using the oracle qubit. [18] J. Latorre, “Image Compression and Entanglement”,
The result obtained in this paper offers a promising arXiv:quantph/0510031, 2005.
perspective on the investigation of more such applications of [19] C. Lomont, “Quantum Convolution and Quantum Correlation
quantum computing to image processing tasks. The Algorithms Are Physically Impossible,” arXiv:quant-ph/0309070,
2003.
developments in the field of Quantum Image Processing are [20] M. Nielsen and I. Chuang, “Quantum Computation and Quantum
still in an early stage. We believe that the contributions to Information”, Cambridge Series on Information and the Natural
this field are not a mere digression in a hot topic as many Sciences. Cambridge, UK: Cambridge University Press, 2000
[21] G. Brassard, P. Hoyer, M. Mosca, A. Tapp, “Quantum Amplitude
may think, but they could significantly impact the overall Amplification and Estimation”, arXiv:quant-ph/0005055, 2000.
advent of the main framework of Quantum Information [22] S. Caraiman and V. Manta, “Image Processing Using Quantum
Processing. Interesting ideas could arise for the design of Computing”, 16th International Conference on System Theory,
Control and Computing (ICSTCC), Sinaia, 12-14 October 2012 , pp.
new quantum algorithms and the development of novel 1-6.
84