Next Article in Journal
Variations à la Fourier-Weyl-Wigner on Quantizations of the Plane and the Half-Plane
Previous Article in Journal
Colombian Export Capabilities: Building the Firms-Products Network
Article

A QUBO Formulation of the Stereo Matching Problem for D-Wave Quantum Annealers

1
CU-UAEM Valle de Chalco, Hermenegildo Galeana 3, Valle de Chalco 56615, Estado de México, Mexico
2
Tecnologico de Monterrey, Escuela de Ingenieria y Ciencias. Ave., Eugenio Garza Sada 2501, Monterrey 64849, NL, Mexico
3
US Naval Research Laboratory, 4555 Overlook Ave., SW Washington, DC 20375, USA
*
Author to whom correspondence should be addressed.
Entropy 2018, 20(10), 786; https://doi.org/10.3390/e20100786
Received: 6 August 2018 / Revised: 8 October 2018 / Accepted: 8 October 2018 / Published: 12 October 2018
(This article belongs to the Section Quantum Information)

Abstract

In this paper, we propose a methodology to solve the stereo matching problem through quantum annealing optimization. Our proposal takes advantage of the existing Min-Cut/Max-Flow network formulation of computer vision problems. Based on this network formulation, we construct a quadratic pseudo-Boolean function and then optimize it through the use of the D-Wave quantum annealing technology. Experimental validation using two kinds of stereo pair of images, random dot stereograms and gray-scale, shows that our methodology is effective.
Keywords: quantum annealing; stereo matching; quantum algorithms quantum annealing; stereo matching; quantum algorithms

1. Introduction

Computer vision is an interdisciplinary field of research with almost six decades of theoretical and algorithmic developments [1,2] that focuses on developing mathematical techniques and algorithms that aim at enabling computers to identify, analyze, and understand information from elements of imagery [3]. Computer vision has many links and common interests with Artificial Intelligence and Machine Learning.
Stereo vision refers to the ability to extract information about the 3-D structure and distance of a scene from two or more images taken from different viewpoints. The most basic stereo system consists of two cameras (left and right) and any stereo system must solve two problems:
  • The stereo matching problem [4]: Which parts of the left and right images are projections of the same scene element?
  • The reconstruction problem, which is stated as follows: given a number of corresponding parts of the left and right images, what can we say about the 3-D locations and structures of the observed objects?
In this paper, we focus on the stereo matching problem using a basic stereo system. This problem is difficult to solve because some parts of the scene are visible only by either the left or right camera but not by both; therefore, a stereo system must also be able to select the image parts to be matched [5]. Stereo vision has many applications, such as in photogrammetry [6], stereo-based head tracking [7], volumetric and 3-D surface reconstruction [8], video-based walkthroughs [9], and stereo-based autonomous navigation [10], among others.
Nowadays, there is an increasing amount of interest in applying quantum computing techniques on machine learning tasks. The research area of quantum machine learning (QML) [11,12] has as its main objective designing quantum algorithms and data representation using quantum states that outperform classical algorithms in machine learning problems. Examples of recent progress in QML are the proposals of quantum principal component analysis of classical data [13] and quantum support vector machine [14] (both papers use quantum states that encode classical data as input), as well as deep quantum learning [15] and sampling of a quantum Boltzman machine [16] (these two papers have classical data as input). More recent advances in QML can be found in [17,18].
Quantum hardware technologies such as the quantum circuit-based IBMQ computer [19] and the D-Wave [20] quantum annealer machine have motivated the development of applications in QML. In particular, the D-Wave computer has evolved and grown significantly with respect to the number of qubits, allowing the posing of problems of interest [21,22,23,24]. For instance, the current generation of D-Wave 2000Q processors has almost 2048 working superconducting qubits connected in a graph topology known as Chimera.
In this paper, we present a methodology for writing a Quadratic Unconstrained Binary Optimization (QUBO) formulation of the stereo matching problem via a graph-cut approach, followed by using this QUBO formulation to simulate a quantum annealing algorithm on D-Wave’s simulation software. This paper is meant to be a contribution to the nascent area of quantum algorithms to solve relevant problems in science, engineering and other fields, like finance.
Our method could also be used to implement NP-hard problem instances in novel architectures of classical hardware, like the Ising model architectures proposed by Fujitsu [25] and Hitachi [26] research laboratories (examples of NP-hard problems are combinatorial optimization problems. A concise introduction to NP-hardness can be found in [27]). Furthermore, since the stereo matching problem is of paramount importance in computer vision, several classical algorithms have been developed to solve it, among them, graph-cut-based methods (we provide a brief account of algorithms for stereo matching in Section 2). Although the stereo matching problem is in the P class, a minimum upper bound for the computational complexity is unknown; hence, the development of novel approaches is pertinent. In this sense, the proposal presented in this manuscript combined with present and future research on quantum annealing-based algorithms could be used in future work to develop new and less expensive algorithms.
Our work consists of two main goals: (a) to express a problem of interest as a QUBO problem and (b) to find a minor embedding of the QUBO problem into the Chimera graph architecture. Before applying our methodology, we represent the stereo matching problem as a graph-cut problem by constructing an edge weighted graph with two special vertices. This weighted graph has the following property: finding a subset of edges with minimum cost whose removal disconnects the special vertices is equivalent to solving the stereo matching problem. Therefore, for step (a), we construct a pseudo-Boolean expression of degree three for the graph-cut problem, and we use a reduction method to obtain a QUBO expression to be minimized. For step (b), a minor embedding is found by using the software tools provided by the D-Wave solver application programming interface (SAPI). To validate our methodology for the solution to the stereo matching problem, we present the results of the minimization of the QUBO expression using the classic solver qbsolv developed by D-Wave.
This paper is organized as follows: In Section 2, we succinctly introduce the basic notions of optimization via quantum annealing and we describe our methodology for solving the stereo matching problem using QUBO and D-Wave technology; in Section 3, we present our experiments and results; finally, we present our conclusions in Section 4.

2. Results

2.1. Quantum Annealing

Quantum annealing (QA) [28,29,30,31,32,33] can be seen as a quantum version of Classical Simulated Annealing (SA) [32,33,34,35]. SA uses the process of annealing in which a solid in a thermal bath is heated up by increasing the temperature, followed by a cooling by slowly lowering the temperature of the bath. The annealing allows the particles in the solid to go from a random configuration or high energy to a lattice configuration or low energy. This process was found to be equivalent to the problem of finding the configuration with the minimum amount of energy or the cost function of a given combinatorial optimization problem. QA employs quantum fluctuations to anneal the system down to its minimum energy state [33]. The most used physical system for QA is the Ising spin glass model on N particles described by
H p = 1 i N h i σ i z + 1 i < j N J i j σ i z σ j z
where σ i z is the Pauli matrix z acting on particle i, h i describes the magnetic field on particle i, and J i j is the coupling strength between particles i and j. The minimum energy state or ground state of the Hamiltonian H p corresponds to a configuration s = ( s 1 , , s N ) { + 1 , 1 } N of spins that minimizes the following energy function
E ( s ) = 1 i N h i s i + 1 i < j N J i j s i s j .
It is known that the problem of finding a configuration s * with minimum energy E ( s * ) is an NP-complete problem [36] (although some special cases of the Ising model can be solved in polynomial time. However, those cases are not part of our study). A related problem with the same complexity is obtained by changing the variable x i = ( 1 + s i ) / 2 for i = 1 , , N . In other words, finding a configuration x { 0 , 1 } N such as E ( x ) that is minimum also corresponds to an NP - complete problem [37].
One of the schemes to realize QA is through adiabatic quantum evolution from the ground state of an initial Hamiltonian to the ground state of a final Hamiltonian which corresponds to the solution of a given problem [38]. According to this scheme, a time-dependent Hamiltonian takes the form
H ( τ ) = A ( τ ) H 0 + B ( τ ) H p
where τ = t / t a for 0 t t a , is t a is the total annealing time, and the initial Hamiltonian H 0 = 1 i N σ i x is responsible for quantum tunnelling among the localized classical states corresponding to the eigenstates of the Hamiltonian H p . In the current generation of the D-Wave 2000Q processor, functions A ( τ ) and B ( τ ) are defined so that at time τ = 0 , the influence of the Hamiltonian H 0 is predominant against H p . As time evolves from τ = 0 to τ = 1 , the influence of the Hamiltonian H p increases, while H 0 fades away.
One then can solve the time-dependent Schrödinger equation with the Hamiltonian H ( t ) to obtain an approximate solution to the dynamics of the system. Consider the Hamiltonian H ( t ) = H ˜ ( t / t a ) = H ˜ ( τ ) such that 0 τ 1 , and let us denote by | l ; τ the instantaneous eigenvector of H ˜ ( τ ) corresponding to the instantaneous eigenvalue λ l ( τ ) . Then,
H ˜ ( τ ) | l ; τ = λ l ( τ ) | l ; τ
with
λ 0 ( τ ) λ 1 ( τ ) λ 2 N 1 ( τ ) .
The Adiabatic theorem asserts that for sufficiently large t a ,
lim t a | l = 0 ; τ = 1 | ψ ( t a ) | = 1
for some solution ψ ( t ) to the Schrödinger equation with the Hamiltonian H ( t ) . Consequently, the state ψ ( t a ) will be very close to the ground state of the Hamiltonian H p with a high probability. A sufficient condition for the algorithm running time that is needed to satisfy the Adiabatic theorem is
t a ε m a x g m i n 2
where
g m i n = min 0 τ 1 ( λ 1 ( τ ) λ 0 ( τ ) )
and
ε m a x = max 0 τ 1 | l = 1 ; τ | d H ˜ d τ | l = 0 ; τ | .
A more rigorous formulation of the Adiabatic theorem can be found in [39]. It must be noted that in realistic physical settings, including the D-Wave processor, the QA dynamics of a system do not necessary evolve adiabatically. There are several reasons including thermal fluctuations and additive noise from the environment. Other considerations to take into account when solving problems on a D-Wave processor are the size of the device or number of qubits in the current architecture and the precision of the Ising parameters, such as the magnetic field values h j and the coupler strength J i j between pairs of qubits. A concise introduction to quantum annealing algorithms, their potential relevance for the advancement of key problems in theoretical computer science, as well as mathematical methods to implement quantum annealing algorithms in D-Wave quantum annealers can be found in  [27].

2.1.1. QUBO Formulation Approach to the Stereo Matching Problem

The stereo matching problem is of key importance in computer vision [5,40]. Without any loss of generality, a stereo setup consists of two spatially separated cameras located at the same height with parallel optical axes. A stereo pair of images, I l and I r , are the recorded images by the left and right cameras, c l and c r , respectively. For a point P in a scene observed by a stereo setup, it (point P) will be projected into the left and right images with intensities I l ( x 1 , y ) and I r ( x 2 , y ) , respectively. Notice that, in a stereo setup, a point P will be projected at the same row y in both left and right images, whilst determining the columns x 1 and x 2 of projection is a difficult problem [4]. Let us now state the following problem.
Problem 1 (Stereo matching).
Given a stereo pair of images ( I l , I r ) , find, for every pixel I l ( x 1 , y ) in the left image, its corresponding projection I r ( x 2 , y ) in the right image (see Figure 1).
The solution to problem 1 involves calculating the disparity for every pixel in the left image. If the calibration parameters of the stereo setup are given [40], then it is possible to infer the depth at every point in the scene. Early approaches to solve problem 1 are those based on block matching techniques [4], dynamic programming [41], belief propagation [42] and graph-cut [43] based techniques, among others. In the following section, we formulate the stereo matching problems in terms of graph-cuts.

2.1.2. Energy Function

Let P be the image domain or set of pixels in the left image and let L be the set of labels or disparities; a labeling is a map
l : P L
such that for each pixel p P , l assigns a label l ( p ) = l p to the pixel p.
Given a labeling l, its cost is defined as
E ( l ) = p P D p ( l p ) + { p , q } N V p q ( l p , l q )
where D p models the cost of assigning label l p to the pixel p, V p q models the cost of assigning l p to p and l q to q, with p and q being adjacent pixels, and N is the set of neighbor pairs { p , q } .
Graph-cut techniques consist of constructing a graph with weighted edges and two special vertices, s and t. In this model, finding a cut with minimum cost that separates s and t is equivalent to minimizing function E ( l )  [44,45].

2.1.3. Graph Construction

The following graph construction is based on the Boykov and Kolmogorov approach for Min-Cut/Max-Flow Algorithms for Energy Minimization [44].
Let G = ( V , E , c ) be an edge weighted graph where V is the set of vertices with two special vertices, the source s and the sink t, E is the set of undirected edges, and c : E Z + is a function that assigns a positive value to each edge in E. A cut in G is a set of edges whose removal from E separates the source from the sink, and its cost is the sum of their weights. Let L = { 0 , , L } be the set of possible disparities or labels. The graph G is constructed as follows:
  • To each pixel p in the image, we associate a chain composed of L + 2 vertices, say p 0 , p 1 , , p L + 1 . These vertices are connected by edges called t-links, { e p 0 , p 1 , e p 1 , p 2 , , e p L , p L + 1 } , where e p 0 , p 1 = { p 0 , p 1 } , e p 1 , p 2 = { p 1 , p 2 } , , e p L , p L + 1 = { p L , p L + 1 } . For a disparity range from 0 to L values, and for each pixel p, we will have L + 2 vertices in the chain and L + 1 t-links between these vertices; each edge defines a labeling with one specific value. Additionally, there are two t-links that connect the first vertex with the source and the last vertex with the sink. Hence, there exist L + 3 such edges in the graph for each pixel p. The weights of those edges directly depend on the function D p , which specifies the cost of applying a specific label to a pixel.
  • To each pair of neighbor pixels, p and q, there will be links that connect the corresponding chains with edges called n-links. For instance, let p 0 , p 1 , , p L + 1 and q 0 , q 1 , , q L + 1 be the chain vertices for two neighbor pixels p and q; the n-links between chains are e p 0 , q 0 = { p 0 , q 0 } , e p 1 , q 1 = { p 1 , q 1 } , , e p L + 1 , q L + 1 = { p L + 1 , q L + 1 } . Usually a 4-neighborhood is assumed for every pixel. The weights of these edges should reflect the penalty when assigning different labels to neighboring pixels.
For a given stereo pair of images of size N × M pixels and a disparity range L, the total number of vertices in the constructed graph is ( L + 2 ) N M + 2 and the number of edges is N M ( L + 3 ) + ( ( M 1 ) N + ( N 1 ) M ) ( L + 2 ) . In Figure 2, we present an example of the graph topology for an image of 5 × 5 pixels and L = 3 , in which we show the t-links and n-links (red edges) for the central pixel and its neighbor pixels (right). In this example, there are 127 vertices and 350 edges.
A cut separating the source from the sink severs t-links as well as n-links. The severed t-links directly define the labels assigned to each pixel. For instance, if a cut severs the t-link t p j = { p j , p j + 1 } with 0 j L for a pixel p, then the assigned label to p is j. Therefore, the cut must sever exactly one t-link at every pixel.
The cost of a t-link will correspond to the disparity of a given pixel. If the assumption that we have a certain disparity d at pixel p = ( x 1 , y ) is correct, the intensity I l ( x , y ) observed in the left camera at position ( x , y ) should be similar to the intensity I r ( x d , y ) in the right camera observed at position ( x d , y ) , because both pixels depict the same scene object. Consequently, the cost of a given t-link t p d = { p d , p d + 1 } with 0 d L can be set to the L 2 norm of the intensity difference between corresponding pixels in both camera images:
c ( t p d ) = | I l ( x , y ) I r ( x d , y ) | 2 + C
where C is a constant that is chosen to be sufficiently large in order to ensure that exactly one t-link is severed by the cut for each pixel. If the intensity difference between I l ( x , y ) and I r ( x d , y ) is low enough, this indicates that the corresponding disparity is a good solution and consequently, c ( t p d ) is low. The constant C is set to be slightly larger than the sum of the weights of all penalty n-links belonging to pixel p,
C p = 1 + ( L 1 ) q N p λ p q
where N p defines the neighborhood of p.
The pairwise cost function V p q depends on the difference between labels l p and l q . In the simplest case, V p q can be set to the absolute difference | l p l q | . Therefore,
V p q ( l p , l q ) = λ p q | l p l q |
where λ p q is a weighting factor for setting the relative importance of the smoothness term, which can be chosen differently for each pair of pixels, but is often set to a constant λ = λ p q for all p , q N . Given an n-link n p k q k for two neighbor pixels p and q, the cost of n p k q k is equal to c ( n p k q k ) = λ p q for all  1 k < L .

2.1.4. QUBO Formulation of the Stereo Matching Problem via the Minimum Multicut Problem

The graph cut formulation of the stereo matching problem is a special case of the following general problem:
Problem 2 (Minimum multi-cut).
Given an edge weighted graph G = ( V , E , c ) and a set S = { ( s 1 , t 1 ) , , ( s k , t k ) } of k pairs of vertices, find a multi-cut with minimum cost, i.e., a set E E such that the removal of E from E disconnects s i from t i for every pair ( s i , t i ) S , where the cost of E is given as { u , v } E c ( { u , v } ) (see Figure 3).
When k = 1 , 2 , the minimum multi-cut problem can be solved in polynomial time [46], and it becomes NP-hard for k 3 for general graphs [47]. In the special case where G is restricted to trees and for arbitrary k, Problem 2 remains NP-hard [48].
Let us formulate Problem 2 for k = 1 as a QUBO expression. Let G = ( V , E , c ) be a weighted graph and ( s , t ) be the pair of vertices to be disconnected. For each edge { u , v } E , let us associate a Boolean variable y u v such that y u v = 1 if the edge { u , v } is selected for a cut and y u v = 0 otherwise. Similarly, for each vertex v V , let us associate a Boolean variable x v such that x v = 1 if v U and x v = 0 in the other cases where U is a subset of V.
Let H problem be defined as
H problem = H cost + H penalty .
The first term, H cost , in Equation (15) expresses the cost of the selected edges to be removed from the graph G, and the second term, H penalty , has the purpose of introducing a penalization if the selected edges do not correspond to a cut in G.
The term H cost can be easily defined as
H cost = { u , v } E y u v · c ( { u , v } )
which gives us the cost of the selected edges to be removed.
The second term, H penalty , is constructed as
H penalty = α [ 1 x s x t + 2 x s x t + { u , v } E ( 1 y u v ) ( x u + x v 2 x u x v ) ] .
The penalty term satisfies the criterion that if the selected edges form a cut, then H penalty = 0 , and H penalty > 0 in other cases. The penalty term is constructed based on the observation that the selected edges form a cut if there exists a partition ( U , U ¯ ) with U V such that s U and t U ¯ , and every edge e E with y e = 0 , has its extreme vertices on only one side of the partition, either in U or in U ¯ . The coefficient α is a positive value which is used to ensure that solutions that do not constitute a cut are avoided.
The expression H penalty given in (17) corresponds to a pseudo-Boolean function of the third degree which can be converted into a QUBO expression using a reduction method. Among reduction methods we find the Boros algorithms [37,49,50] and the Freedman [51] and Ishikawa [52] methods. A review of quadratization methods in pseudo-Boolean optimization can be found in [53].
The Ishikawa method says that every positive cubic term x 1 x 2 x 3 can be expressed as a quadratic term with
x 1 x 2 x 3 = x 1 x 2 + x 1 x 3 + x 2 x 3 + min z { 0 , 1 } z ( 1 x 1 x 2 x 3 ) x 1 x 2 + x 1 x 3 + x 2 x 3 + z ( 1 x 1 x 2 x 3 )
where z is an ancilla Boolean variable. By applying the Ishikawa method to Equation (17) (which is the method that uses the smallest number of ancilla variables to obtain a quadratic expression) we have
H penalty qubo = α [ 1 x s x t + 2 x s x t + { u , v } E ( x u + x v + 2 w u v + x u y u v + x v y u v 2 x u w u v 2 x v w u v 2 y u v w u v ) ] .
where w u v for each { u , v } E are ancilla variables.
The final quadratic cost function to be minimized can be written as
H problem qubo = H cost + H penalty qubo
which requires a number 2 | E | + | V | of variables to represent the minimum multi-cut problem for a single pair of vertices.

3. Experiments and Discussion

In this section, we prove the concept of the solution to the stereo matching problem using the methodology described in Section 2. The following steps summarise our methodology:
(i)
Construct the weighted graph described in Section 2.1.3 for the given stereo pair of images.
(ii)
Formulate the stereo matching problem as the minimum multi-cut problem for the pair ( s , t ) using the weighted graph from the previous step.
(iii)
Construct the QUBO expression given in Equation (20) from the weighted graph in step (ii) for a single pair.
(iv)
Embed into the Chimera graph topology of the D-Wave computer.
(v)
Find the minimum energy solution to the QUBO/Ising problem by quantum annealing.
We consider two case studies of stereo pair images: (a) a binary random dot stereogram (BRDS) and (b) a gray scale imaged object, both with a resolution of 15 × 15 pixels. At this stage of our research, we are unable to study bigger size images because of the large resources needed to represent the stereo matching problem with the current limitations of quantum hardware. In case (a), we generate a BRDS as follows: a left image is created by setting each pixel randomly to either black or white. Then, a copy of this image is made and it is called the right image. Take a region in the right image and shift that region horizontally by d pixels to the left. The pixels vacated by shifting the region are filled in with random values. The shifted region simulates an object with a disparity of d pixels. In Figure 4 (top), we show a BRDS pair of images with a centered square region of size 7 × 7 pixels shifted by d = 3  pixels.
For case (b), we crop a region of size 15 × 15 pixels from a stereo pair of images of a larger size. The cropped images have a maximum disparity range of five pixels. Figure 5 (top) shows a stereo pair showing a corner of an object on a background. In cases (a) and (b), the regions of interest (ROIs) to be matched are of sizes 15 × 12 and 15 × 10 pixels, respectively. In Table 1, the size of the weighted graph described in Section 2.1.3 for step (i) in our methodology is shown. Despite the large number of vertices and edges needed to formulate the stereo matching as a graph-cut problem, it is possible to use simplification techniques to limit the volume of the graph [45,54,55].
Figure 6 shows the weighted graphs for cases (a) and (b) where the vertices s , t and their incident edges are omitted for better visualization. The t-links in the graph, represented by wide lines, are colored according to their weights, and the n-links are colored in black as thinner lines. As it can be seen in Figure 6a, we have only two possible weights for a t-link because the cost given in (12) for a BRDS can be zero or one plus a constant value.
In the center vertices of the weighted graph, we can see the square region to be matched. In Figure 6a, we show the weighted graph for the gray scale stereo pair given in Figure 5. In this case, there are many possible weights or disparity options. The weights of the omitted t-links in Figure 6 are set as high as possible so that they can never be chosen in the multi-cut. In cases (a) and (b), the constant weight λ is chosen in (14) which is equal to L for the n-links since the disparity is, at most, L 1 , and the constant value C in (12) is set to be equal to the maximum value of | I l ( x , y ) I r ( x d , y ) | 2 for all possible values from d = 0 , , L 1 for all pixels.
In step (iii), the stereo matching problem is formulated as a graph-cut problem for a single pair ( s , t ) . For this purpose, a QUBO function is constructed as given in (20). Table 1 presents the number of logical Boolean variables needed to construct the QUBO function for cases (a) and (b). The QUBO function H problem qubo can be constructed for the given weighted graphs in Figure 6 as follows:
H problem qubo = { u , v } E t l i n k y u v c ( { u , v } ) + { u , v } E n l i n k y u v c ( { u , v } ) + α ( 1 x s x t + 2 x s x t ) + α { u , v } E t l i n k ( x u + x v + 2 w u v + x u y u v 2 x u w u v 2 x v w u v 2 y u v w u v ) + α { u , v } E n l i n k ( x u + x v + 2 w u v + x u y u v 2 x u w u v 2 x v w u v 2 y u v w u v )
where the set of edges E = E t l i n k E n l i n k such that E t l i n k is the set of t-links and E n l i n k is the set of n-links. For the weighted graphs in Figure 6a,b, the number of n-links and t-links are | E n l i n k | = 1080 , | E n l i n k | = 1665 , and | E n l i n k | = 1200 , | E n l i n k | = 1925 , respectively.
The coefficient α in (19) that is used to penalize sets of edges that do not correspond to a multi-cut is
α = { u , v } E c ( { u , v } ) u V c ( { s , u } ) + c ( { t , u } )
where the second term corresponds to the sum of the cost of all t-links that are adjacent to the source and sink vertices s and t. We omit the contribution of these t-links since they can never be selected for a multi-cut due to their high assigned cost.
The embedding procedure in step (iv) of the methodology consists of matching the connectivity of a given general graph into the D-Wave graph topology (see Figure 7). Translating a problem expressed as a QUBO function to an identical problem as a subgraph of the graph topology involves a process called minor embedding [56,57]. Commonly, the embedding process requires a number of physical qubits that is greater than the number of logical variables used in a given QUBO expression. Also, finding a minor embedding with the smallest number of physical qubits is an NP-hard problem [57].
The minor embedding problem can be stated as follows. Given the graph topology G of the quantum hardware and a QUBO problem H problem qubo , represented as a logical graph G = ( V , E ) , where V corresponds to the set of Boolean variables in H problem qubo and E corresponds to the set of edges consisting of a pair of Boolean variables for each quadratic term in H problem qubo , find a subgraph in G such that
  • Each vertex j V is mapped to a connected subtree T j in G .
  • Each edge { i , j } E must be mapped to at least one edge in G .
Finding a minor embedding with the smallest number of physical qubits is an NP hard problem [57]. Figure 7a shows a logical graph with 26 vertices corresponding a QUBO expression, and Figure 7b shows an embedding into the hardware topology of the given logical graph.
We have simulated our algorithm using the software toolbox qbsolv that solves large QUBO problems by partitioning into subproblems targeted for execution on a D-Wave system [58]. Indeed, in addition to qbsolv, there are several QUBO solvers available, among them is [59,60] as well as those methods and software packages mentioned in [61]. We selected qbsolv because we are interested in testing our algorithm on D-Wave’s technology. Source code and full documentation of qbsolv can be found in  [62,63].
Our experiments were run on qbsolv tool using a desktop computer MacBook Air with a 1.3 GHz Intel Core i5 processor and 4 GB of RAM. The motivation of using qbsolv is that if the D-Wave quantum hardware is available, then the problem is partitioned into smaller subproblems that can be minimized by executing a quantum search on the quantum hardware. On the other hand, if no hardware is available, then the qbsolv tool executes the classical Tabu search algorithm to solve each subproblem.
We compare the solutions obtained using qbsolv with a traditional block matching technique. In Figure 4c, we present the truth disparity map which consists of a square region of 7 × 7 pixels with a depth of 3 pixels. For the BRDS stereo pair, the result using a block matching algorithm can be seen in Figure 4d, and the result obtained using qbsolv can be seen in Figure 4e. In the first case, the square region is partially reconstructed with high disparity values, and in the second case it is almost completely reconstructed with low disparity values. In the latter case, it takes 91.67 s of classic cpu time and 1288 calls using qbsolv. For the gray-scale stereo pair images in Figure 5, we compare the result of a block matching algorithm with sub-pixel accuracy shown in Figure 5c with the result using qbsolv shown in Figure 5d. Figure 5e shows the absolute difference error between the disparity maps in Figure 5c,d, where the mean absolute error is 0.7359 pixels. In this case, it takes 148.31 s of classic cpu time and 1426 calls using qbsolv.
The examples presented in this section were selected with the purpose of showing how our proposal could be implemented. Due to hardware constraints, images used in this section are composed of a limited number of bits. We leave for future work a scalability analysis of our algorithm as well as a comparison study of our algorithm with its classical counterparts.

4. Conclusions

We have presented a method for rewriting the stereo matching problem as QUBO expressions based on the graph-cut and minimum multi-cut problems and the Ishikawa reduction method, followed by using QUBO expressions to simulate quantum annealing algorithms on D-Wave’s simulation software. This method has been validated using BRDS and gray scale stereo pairs of images. Future research will be focused on reducing the number of vertices in the graph-cut formulation of the stereo matching problem. This can be achieved by doing an initial disparity search to bound the limits of the disparity range for every pixel of the reference image as well as by incorporating an occlusion term in the cost model given in (11) to penalize occluded regions. An important contribution of this research is the quantum formulation of the minimum multi-cut problem for the case of a single pair of vertices. This formulation consists of the construction of a QUBO expression that is equivalent to the graph-cut problem; hence, no reduction algorithms are needed.
Although the proposed problem can be efficiently solved in a classical way, our methodology provides us with a new way of dealing with problems using quantum-annealing based algorithms and quantum technologies, such as the D-Wave annealer processor, to solve tasks within the realm of machine learning and related areas.

Author Contributions

W.C.-S. proposed the idea of writing a quantum annealing algorithm for the stereo matching problem. W.C.-S., S.E.V.-A., and M.L. made contributions towards writing and simulating the stereo matching problem in terms of a quantum annealing algorithm. W.C.-S., S.E.V.-A., and M.L. reviewed the manuscript.

Funding

S.E.V.-A. acknowledges the financial support of Tecnologico de Monterrey, Escuela de Ingenieria y Ciencias and CONACyT (SNI number 41594 as well as Fronteras de la Ciencia project No. 1007).

Acknowledgments

S.E.V.-A. gratefully thanks his family for their unconditional support.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Klette, R. Concise Computer Vision: An Introduction into Theory and Algorithms; Springer Publishing Company: London, UK, 2014. [Google Scholar]
  2. Stockman, G.; Shapiro, L.G. Computer Vision, 1st ed.; Prentice Hall PTR: Upper Saddle River, NJ, USA, 2001. [Google Scholar]
  3. Szeliski, R. Computer Vision: Algorithms and Applications, 1st ed.; Springer: New York, NY, USA, 2010. [Google Scholar]
  4. Brown, M.Z.; Burschka, D.; Hager, G.D. Advances in Computational Stereo. IEEE Trans. Pattern Anal. Mach. Intell. 2003, 25, 993–1008. [Google Scholar] [CrossRef]
  5. Hartley, R.; Zisserman, A. Multiple View Geometry in Computer Vision, 2nd ed.; Cambridge University Press: New York, NY, USA, 2003. [Google Scholar]
  6. Triggs, B.; McLauchlan, P.F.; Hartley, R.I.; Fitzgibbon, A.W. Bundle Adjustment—A Modern Synthesis. In Proceedings of the International Workshop on Vision Algorithms: Theory and Practice, Corfu, Greece, 21–22 September 2000; Springer: London, UK, 2000; pp. 298–372. [Google Scholar]
  7. Darrell, T.; Gordon, G.; Harville, M.; Woodfill, J. Integrated Person Tracking Using Stereo, Color, and Pattern Detection. Int. J. Comput. Vis. 2000, 37, 175–185. [Google Scholar] [CrossRef]
  8. Seitz, S.M.; Curless, B.; Diebel, J.; Scharstein, D.; Szeliski, R. A Comparison and Evaluation of Multi-View Stereo Reconstruction Algorithms. In Proceedings of the 2006 IEEE Computer Society Conference on Computer Vision and Pattern Recognition, New York, NY, USA, 17–22 June 2006; IEEE Computer Society: Washington, DC, USA, 2006; Volume 1, pp. 519–528. [Google Scholar] [CrossRef]
  9. Uyttendaele, M.; Criminisi, A.; Kang, S.B.; Winder, S.; Szeliski, R.; Hartley, R. Image-Based Interactive Exploration of Real-World Environments. IEEE Comput. Graph. Appl. 2004, 24, 52–63. [Google Scholar] [CrossRef] [PubMed]
  10. Agrawal, M.; Konolige, K.; Bolles, R.C. Localization and Mapping for Autonomous Navigation in Outdoor Terrains: A Stereo Vision Approach. In Proceedings of the 2007 IEEE Workshop on Applications of Computer Vision (WACV ’07), Austin, TX, USA, 21–22 February 2007; p. 7. [Google Scholar] [CrossRef]
  11. Schuld, M.; Sinayskiy, I.; Petruccione, F. An introduction to quantum machine learning. Contemp. Phys. 2014, 56, 172–185. [Google Scholar] [CrossRef][Green Version]
  12. Biamonte, J.D.; Wittek, P.; Pancotti, N.; Rebentrost, P.; Wiebe, N.; Lloyd, S. Quantum machine learning. Nature 2017, 549, 195–202. [Google Scholar] [CrossRef] [PubMed][Green Version]
  13. Lloyd, S.; Mohseni, M.; Rebentrost, P. Quantum principal component analysis. Nat. Phys. 2014, 10, 631–633. [Google Scholar] [CrossRef][Green Version]
  14. Rebentrost, P.; Mohseni, M.; Lloyd, S. Quantum Support Vector Machine for Big Data Classification. Phys. Rev. Lett. 2014, 113, 130503. [Google Scholar] [CrossRef] [PubMed][Green Version]
  15. Adachi, S.H.; Henderson, M.P. Application of Quantum Annealing to Training of Deep Neural Networks. arXiv, 2015; arXiv:1510.06356. [Google Scholar]
  16. Kulchytskyy, B.; Andriyash, E.; Amin, M.; Melko, R. Quantum Boltzmann Machine. arXiv, 2016; arXiv:1601.02036. [Google Scholar]
  17. Benedetti, M.; Realpe-Gómez, J.; Biswa, R.; Perdomo-Ortiz, A. Estimation of effective temperatures in quantum annealers for sampling applications: A case study with possible applications in deep learning. Phys. Rev. A 2016, 94, 022308. [Google Scholar] [CrossRef]
  18. Benedetti, M.; Realpe-Gómez, J.; Biswa, R.; Perdomo-Ortiz, A. Quantum-Assisted Learning of Hardware-Embedded Probabilistic Graphical Models. Phys. Rev. X 2017, 7, 130503. [Google Scholar] [CrossRef]
  19. IBM Quantum Experience. Available online: http://research.ibm.com/ibm-q/ (accessed on 7 January 2018).
  20. D-Wave systems. Available online: http://www.dwavesys.com/ (accessed on 7 January 2018).
  21. Perdomo-Ortiz, A.; Dickson, N.; Drew-Brook, M.; Rose, G.; Aspuru-Guzik, A. Finding low-energy conformations of lattice protein models by quantum annealing. Sci. Rep. 2012, 2, 571. [Google Scholar] [CrossRef] [PubMed][Green Version]
  22. Perdomo-Ortiz, A.; Fluegemann, J.; Narasimhan, S.; Biswas, R.; Smelyanskiy, V. A quantum annealing approach for fault detection and diagnosis of graph-based systems. Eur. Phys. J. Spec. Top. 2015, 224, 131–148. [Google Scholar] [CrossRef][Green Version]
  23. King, J.; Yarkoni, S.; Nevisi, M.M.; Hilton, J.P.; McGeoch, C.C. Benchmarking a quantum annealing processor with the time-to-target metric. arXiv, 2015; arXiv:quant-ph/1508.05087. [Google Scholar]
  24. Bian, Z.; Chudak, F.; Israel, R.B.; Lackey, B.; Macready, W.G.; Roy, A. Mapping Constrained Optimization Problems to Quantum Annealing with Application to Fault Diagnosis. Front. ICT 2016, 3, 14. [Google Scholar] [CrossRef]
  25. Tsukamoto, S.; Takatsu, M.; Matsubara, S.; Tamura, H. An Accelerator Architecture for Combinatorial Optimization Problems. Fujitsu Sci. Tech. J. 2017, 53, 8–13. [Google Scholar]
  26. Yamaoka, M.; Yoshimura, C.; Hayashi, M.; Okuyama, T.; Aoki, H.; Mizuno, H. Ising Computer. Hitachi Rev. 2016, 65, 78–82. [Google Scholar]
  27. Venegas-Andraca, S.; Cruz-Santos, W.; McGeoch, C.; Lanzagorta, M. A cross-disciplinary introduction to quantum annealing-based algorithms. Contemp. Phys. 2018, 5982, 174–196. [Google Scholar] [CrossRef]
  28. Apolloni, B.; Cesa-Bianchi, N.; de Falco, D. A numerical implementation of Quantum Annealing. In Proceedings of the Stochastic Processes, Physics and Geometry, Ascona, Switzerland, 4–9 July 1988; pp. 97–111. [Google Scholar]
  29. Apolloni, B.; Carvalho, C.; de Falco, D. Quantum stochastic optimization. Stoch. Process. Appl. 1989, 33, 233–244. [Google Scholar] [CrossRef]
  30. Somorjai, R. Novel approach for computing the global minimum of proteins. 1. General concepts, methods, and approximations. J. Phys. Chem. 1991, 95, 4141–4146. [Google Scholar] [CrossRef]
  31. Amara, P.; Hsu, D.; Straub, J.E. Global energy minimum searches using an approximate solution of the imaginary time Schroedinger equation. J. Phys. Chem. 1993, 97, 6715–6721. [Google Scholar] [CrossRef]
  32. Finnila, A.; Gomez, M.; Sebenik, C.; Stenson, C.; Doll, J. Quantum annealing: A new method for minimizing multidimensional functions. Chem. Phys. Lett. 1994, 219, 343–348. [Google Scholar] [CrossRef]
  33. Kadowaki, T.; Nishimori, H. Quantum annealing in the transverse Ising model. Phys. Rev. E 1998, 58, 5355–5363. [Google Scholar] [CrossRef][Green Version]
  34. Kirkpatrick, S.; Gelatt, C.D.; Vecchi, M.P. Optimization by Simulated Annealing. Science 1983, 220, 671–680. [Google Scholar] [CrossRef] [PubMed][Green Version]
  35. Santoro, G.E.; Tosatti, E. Optimization using quantum mechanics: quantum annealing through adiabatic evolution. J. Phys. A Math. Gen. 2006, 39, R393–R431. [Google Scholar] [CrossRef]
  36. Barahona, F. On the computational complexity of Ising spin glass models. J. Phys. A Math. Gen. 1982, 15, 3241. [Google Scholar] [CrossRef]
  37. Boros, E.; Hammer, P.L. Pseudo-boolean Optimization. Discret. Appl. Math. 2002, 123, 155–225. [Google Scholar] [CrossRef]
  38. Farhi, E.; Goldstone, J.; Gutmann, S.; Lapan, J.; Lundgren, A.; Preda, D. A Quantum Adiabatic Evolution Algorithm Applied to Random Instances of an NP-Complete Problem. Science 2001, 292, 472–475. [Google Scholar] [CrossRef] [PubMed][Green Version]
  39. Jansen, S.; Ruskai, M.B.; Seiler, R. Bounds for the adiabatic approximation with applications to quantum computation. J. Math. Phys 2007, 48, 102111. [Google Scholar] [CrossRef][Green Version]
  40. Forsyth, D.A.; Ponce, J. Computer Vision: A Modern Approach; Pearson: New York, NY, USA, 2002. [Google Scholar]
  41. Ohta, Y.; Kanade, T. Stereo by Intra- and Inter-Scanline Search Using Dynamic Programming. IEEE Trans. Pattern Anal. Mach. Intell. 1985, PAMI-7, 139–154. [Google Scholar] [CrossRef]
  42. Sun, J.; Zheng, N.N.; Shum, H.Y. Stereo matching using belief propagation. IEEE Trans. Pattern Anal. Mach. Intell. 2003, 25, 787–800. [Google Scholar] [CrossRef][Green Version]
  43. Boykov, Y.; Veksler, O.; Zabih, R. Fast Approximate Energy Minimization via Graph Cuts. IEEE Trans. Pattern Anal. Mach. Intell. 2001, 23, 1222–1239. [Google Scholar] [CrossRef]
  44. Boykov, Y.; Kolmogorov, V. An Experimental Comparison of Min-Cut/Max-Flow Algorithms for Energy Minimization in Vision. IEEE Trans. Pattern Anal. Mach. Intell. 2004, 26, 1124–1137. [Google Scholar] [CrossRef] [PubMed]
  45. Veksler, O. Reducing Search Space for Stereo Correspondence with Graph Cuts. In Proceedings of the British Machine Vision Conference 2006, Edinburgh, UK, 4–7 September 2006; pp. 709–718. [Google Scholar]
  46. Papadimitriou, C.H.; Steiglitz, K. Combinatorial Optimization: Algorithms and Complexity; Prentice-Hall, Inc.: Upper Saddle River, NJ, USA, 1982. [Google Scholar]
  47. Dahlhaus, E.; Johnson, D.S.; Papadimitriou, C.H.; Seymour, P.D.; Yannakakis, M. The Complexity of Multiterminal Cuts. SIAM J. Comput. 1994, 23, 864–894. [Google Scholar] [CrossRef][Green Version]
  48. Garg, N.; Vazirani, V.; Yannakakis, M. Primal-dual approximation algorithms for integral flow and multicut in trees. Algorithmica 1997, 18, 3–20. [Google Scholar] [CrossRef]
  49. Boros, E.; Gruber, A. On Quadratization of Pseudo-Boolean Functions. arXiv, 2014; arXiv:1404.6538. [Google Scholar]
  50. Anthony, M.; Boros, E.; Crama, Y.; Gruber, A. Quadratization of symmetric pseudo-Boolean functions. Discret. Appl. Math. 2016, 203, 1–12. [Google Scholar] [CrossRef][Green Version]
  51. Freedman, D.; Drineas, P. Energy Minimization via Graph Cuts: Settling What is Possible. In Proceedings of the 2005 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR 2005), San Diego, CA, USA, 20–26 June 2005; pp. 939–946. [Google Scholar] [CrossRef]
  52. Ishikawa, H. Transformation of General Binary MRF Minimization to the First-Order Case. IEEE Trans. Pattern Anal. Mach. Intell. 2011, 33, 1234–1249. [Google Scholar] [CrossRef] [PubMed][Green Version]
  53. Tanburn, R.; Dattani, N.S. Quadratization in Pseudo-Boolean Optimization and Adiabatic Quantum Computing. Available online: https://github.com/ndattani/quadratizationReview (accessed on 17 September 2018).
  54. Zureiki, A.; Devy, M.; Chatila, R. Stereo Matching using Reduced-Graph Cuts. In Proceedings of the 2007 IEEE International Conference on Image Processing, San Antonio, TX, USA, 16 September–19 October 2007; Volume 1, pp. 237–240. [Google Scholar] [CrossRef]
  55. Zhang, Y.; Hartley, R.I.; Wang, L. Fast Multi-labelling for Stereo Matching. In Proceedings of the 11th European Conference on Computer Vision (ECCV 2010), Heraklion, Crete, Greece, 5–11 September 2010; pp. 524–537. [Google Scholar]
  56. Choi, V. Minor-embedding in adiabatic quantum computation: I. The parameter setting problem. Quantum Inf. Process. 2008, 7, 193–209. [Google Scholar] [CrossRef][Green Version]
  57. Choi, V. Minor-embedding in adiabatic quantum computation: II. Minor-universal graph design. Quantum Inf. Process. 2011, 10, 343–353. [Google Scholar] [CrossRef]
  58. Booth, M.; Reinhardt, S.P.; Roy, A. Partitioning Optimization Problems for Hybrid Classical/Quantum Execution; Technical Report; D-Wave the Quantum Computing Company: Burnaby, CA, USA, 9 January 2017. [Google Scholar]
  59. IBM ILOG CPLEX Optimizer. Available online: http://www-01.ibm.com/software/integration/optimization/cplex-optimizer (accessed on 14 September 2018).
  60. METSlib An Open Source Tabu Search Metaheuristic framework in modern C++. Available online: http://projects.coin-or.org/metslib (accessed on 14 September 2018).
  61. Rosenberg, G.; Vazifeh, M.; Woods, B.; Haber, E. Building an iterative heuristic solver for a quantum annealer. Comput. Optim. Appl. 2016, 65, 845–869. [Google Scholar] [CrossRef][Green Version]
  62. Qbsolv Software, Version 2000Q. D-Wave Systems: Burnaby, CA, USA, 2000. Available online: https://www.dwavesys.com/software (accessed on 14 September 2018).
  63. D-Wave sOurce Code and Documentation. Available online: https://github.com/dwavesystems/qbsolv (accessed on 14 September 2018).
Figure 1. Example of the projection of a point P on the image planes of the left and right images. As can be seen in this illustration, the point P is projected to the positions x 1 and x 2 of the left and right images, respectively. The difference x 2 x 1 is called the disparity of point P.
Figure 1. Example of the projection of a point P on the image planes of the left and right images. As can be seen in this illustration, the point P is projected to the positions x 1 and x 2 of the left and right images, respectively. The difference x 2 x 1 is called the disparity of point P.
Entropy 20 00786 g001
Figure 2. An image of size 5 × 5 pixels (left) and its graph topology (right).
Figure 2. An image of size 5 × 5 pixels (left) and its graph topology (right).
Entropy 20 00786 g002
Figure 3. Example of a multi-cut with k = 1 for the pair of vertices ( s , t ) . The dotted lines are the edges belonging to the minimum multi-cut and its cost is the sum of their weights.
Figure 3. Example of a multi-cut with k = 1 for the pair of vertices ( s , t ) . The dotted lines are the edges belonging to the minimum multi-cut and its cost is the sum of their weights.
Entropy 20 00786 g003
Figure 4. Example of binary random dot stereogram (BRDS) images of size 15 × 15 pixels: (a,b) left and right BRDS images, (c) truth disparity map, (d) disparity map obtained using matching techniques, and (e) disparity map obtained using our approach.
Figure 4. Example of binary random dot stereogram (BRDS) images of size 15 × 15 pixels: (a,b) left and right BRDS images, (c) truth disparity map, (d) disparity map obtained using matching techniques, and (e) disparity map obtained using our approach.
Entropy 20 00786 g004
Figure 5. Example of gray scale images of size 15 × 15 pixels: (a,b) left and right gray scale stereo images, (c) disparity map using matching techniques with sub-pixel accuracy, (d) disparity map obtained using our approach, and (e) map error between the disparity maps (c,d).
Figure 5. Example of gray scale images of size 15 × 15 pixels: (a,b) left and right gray scale stereo images, (c) disparity map using matching techniques with sub-pixel accuracy, (d) disparity map obtained using our approach, and (e) map error between the disparity maps (c,d).
Entropy 20 00786 g005
Figure 6. Weighted graphs described in Section 2.1.3 for the (a) binary random dot stereogram BRDS and (b) gray-scale stereo pair images given in Figure 4 and Figure 5, respectively.
Figure 6. Weighted graphs described in Section 2.1.3 for the (a) binary random dot stereogram BRDS and (b) gray-scale stereo pair images given in Figure 4 and Figure 5, respectively.
Entropy 20 00786 g006
Figure 7. An example of minor embedding: (a) logical graph and (b) embedding of the logical graph into the hardware of the D-Wave One with 128 physical qubits.
Figure 7. An example of minor embedding: (a) logical graph and (b) embedding of the logical graph into the hardware of the D-Wave One with 128 physical qubits.
Entropy 20 00786 g007
Table 1. For case studies (a) and (b) in Figure 4 and Figure 5, respectively, the region of interest (ROI), the disparity range, the dimension of the weighted graph described in Section 2.1.3, and the number of logical variables used to formulate the minimum multi-cut problem given in Equation (19) are shown.
Table 1. For case studies (a) and (b) in Figure 4 and Figure 5, respectively, the region of interest (ROI), the disparity range, the dimension of the weighted graph described in Section 2.1.3, and the number of logical variables used to formulate the minimum multi-cut problem given in Equation (19) are shown.
CaseROIL | V | | E | | H problem qubo |
(a) 15 × 12 390227456392
(b) 15 × 10 5105231257302
Back to TopTop