On Partial Optimality in Multi-lab el MRFs Pushmeet Kohli1 Alexander Shekhovtsov2 Carsten Rother1 Vladimir Kolmogorov3 Philip Torr4 1 4 pkohli@microsoft.com shekhovt@cmp.felk.cvut.cz carrot@microsoft.com vnk@adastral.ucl.ac.uk philiptorr@brookes.ac.uk 2 Microsoft Research Cambridge, Oxford Brookes University Czech Technical University in Prague, 3 University College London, Abstract We consider the problem of optimizing multilabel MRFs, which is in general NP-hard and ubiquitous in low-level computer vision. One approach for its solution is to formulate it as an integer linear programming and relax the integrality constraints. The approach we consider in this paper is to first convert the multi-label MRF into an equivalent binarylabel MRF and then to relax it. The resulting relaxation can be efficiently solved using a maximum flow algorithm. Its solution provides us with a partially optimal labelling of the binary variables. This partial labelling is then easily transferred to the multi-label problem. We study the theoretical properties of the new relaxation and compare it with the standard one. Specifically, we compare tightness, and characterize a subclass of problems where the two relaxations coincide. We propose several combined algorithms based on the technique and demonstrate their performance on challenging computer vision problems. posterior (map) solution in graphical models such as Markov Random Fields (mrf) and Conditional Random Fields (crf), which is also often referred to as energy minimization. A number of powerful algorithms are present in the literature which deal with the problem. For certain subclasses of the problem, it is possible to compute the exact solution in polynomial time: MRFs of bounded tree-width, e.g . (Lauritzen, 1998); with convex pairwise potentials (Ishikawa, 2003); with submodular potentials of binary (Hammer, 1965; Kolmogorov & Zabih, 2004) or multi-label (Schlesinger & Flach, 2000; Kovtun, 2004) variables; with permuted submodular potentials (Schlesinger, 2007). However, the problem of minimizing a general energy function is NPhard. Nevertheless it is just these sorts of general energies that occur in many vision problems and making progress towards their solution is of paramount importance. Energy Minimization as a Linear Program General discrete energy minimization can be seen as an integer programming problem. Dropping integrality constraints leads to an attractive linear programming relaxation (LP-1). Unfortunately, linear programs arising from this scheme in vision applications are of very large scale, and are not practical to solve with general methods. A number of algorithms have been developed (Schlesinger, 1976; Koval & Schlesinger, 1976; Wainwright et al., 2003; Kolmogorov, 2006; Werner, 2007) which attempt to solve this relaxation by exploiting the special structure of the problem. However, their common drawback is that they may converge to a suboptimal point. Other developed methods for energy minimization include local search algorithms (Boykov et al., 2001), primal-dual method (Komodakis & Tziritas, 2005), subgradient methods (Schlesinger & Giginyak, 2007; Komodakis et al., 2007). Some local search algorithms provide 1. Intro duction One of the ma jor advances in computer vision in the past few years has been the development of efficient deterministic algorithms for solving discrete labeling problems. Labeling problems occur in many places from dense stereo and image segmentation (Boykov et al., 2001; Szeliski et al., 2006) to the use of pictorial structures for ob ject recognition (Felzenszwalb & Huttenlocher, 2000). They can be shown to be equivalent to the problem of estimating the maximum a Appearing in Proceedings of the 25 th International Conference on Machine Learning, Helsinki, Finland, 2008. Copyright 2008 by the author(s)/owner(s). On Partial Optimality in Multi-lab el MRFs approximation ratio guarantee for (semi-)metric energies (Boykov et al., 2001; Komodakis & Tziritas, 2005). Finally, there are methods which output a partial assignment of labels with guaranteed optimality certificate for binary (Hammer et al., 1984; Boros et al., 1991; Boros et al., 2006; Rother et al., 2007) and multi-label (Kovtun, 2003; Kovtun, 2004) problems. Dead-end elimination is another related method for identifying non-optimal assignments based on local sufficient conditions, it was originally proposed (Desmet et al., 1992) for predicting and designing the structures of proteins. In this paper we develop a novel method for obtaining partial optimal solutions of functions of multi-label variables. Our method works by first transforming the multilabel energy function to a function involving binary variables (Schlesinger & Flach, 2006). This binary energy is then minimized by applying the roof dual relaxation (Boros & Hammer, 2002; Hammer et al., 1984), which can be solved efficiently using a single graph cut. More importantly, solving the roof dual relaxation results in an assignment of a subset of the variables which is guaranteed to be valid for any optimal solution. This partially optimal solution can be used to constrain the state space of the original multi-label problem. As we show, this approach may be viewed as a different LP-relaxation of the multi-label energy minimization problem (LP-2). Comparing LP-1 with LP-2 We present a number of theoretical results studying properties of LP-2 and relating LP-2 with LP-1. Our first result is that LP-1 is a tighter relaxation of the energy minimization problem compared to LP-2. We show in the paper that solutions of LP-1 necessarily satisfy the constraints derived by LP-2, so additional guarantees for methods based on LP-1 may follow. We also identify a subclass of problems for which LP-2 is as tight as LP-1. Thus, for problems of this subclass LP-1 can be solved exactly and efficiently using combinatorial methods. It was recently demonstrated that the roof dual relaxation performs well for a number of computer vision applications (Kolmogorov & Rother, 2007; Rother et al., 2007) which are naturally formulated as a binary energy minimization. However, it turns out that when multi-label problems are formulated as binary energy minimization the roof dual relaxation leaves many variables unassigned. We therefore use recently proposed enhancements of the roof dual technique called "probing" (Boros et al., 2006; Rother et al., 2007) which can often help resolve these ambiguities. Our last contribution is providing an alternative formulation of LP-2: we prove that it is equivalent to computing a decomposition of the energy into submodular and supermodular parts so that the sum of the lower bounds for each part is maximized. Precise details of this theoretical result are given in (Shekhovtsov et al., 2008, section 10). Although this is primarily a theoretical paper, we have performed a number of experiments with various energy models arising in vision applications, including image restoration, ob ject-based segmentation, and image stitching. Our experiments show that the proposed method outperforms the competing method of (Kovtun, 2003) by labelling many more random variables. We also demonstrate that it may help solving difficult problems by reducing their state space and applying other methods to the reduced problem. 2. Energy Minimization Let L = {1 . . . K } be a set of labels. Let G = (V , E ) be a graph, where the set of edges E V × V is antisymmetric and antireflexive, i.e . (s, t) E (t, s) E . / We denote an ordered pair (s, t) E simply by st. Let each graph node s V be assigned a label xs L and let a labeling (or configuration) be defined as x = {xs | s V }1 . Let {s (i) R | i L, s V } be univariate potentials and {st (i, j ) R | i, j L, st E } be pairwise potentials of a random field. Let in addition const be a constant term, and let a concatenated vector of potentials, including the constant term, be denoted as = (, const ) = RI {const} , where set of indices I = {(s, i) | s V , i L} {(st, ij ) | st E , i, j L} (1) corresponds to all univariate and pairwise terms. Notation I will thus refer to all components of but the constant term. The energy of a configuration x of the random field is defined as: s s E (x|) = s (xs ) + st (xs , xt ) + const . (2) V tE 2.1. LP-relaxation We will study two different relaxations of minimization of (2). Both relaxations can be written using the same formulation but will differ in the graph, number of labels and potential vector involved. Energy function (2) can be conveniently written using a scalar product in as E (x|) = µ(x), , where µ(x) {0, 1}I {const} is defined by µ(x)s (i) = {xs =i} , µ(x)st (i, j ) = {xs =i} {xt =j } and µ(x)const = 1. In this notation minimization of E is expressed as: xLV 1 min µ(x), . (3) Notation {xs |s S } (bold brackets), where S is a finite set, will stand for the concatenated vector of variables xs , rather than the set of their values. On Partial Optimality in Multi-lab el MRFs The LP-relaxation of (3) reviewed in, e.g ., (Werner, 2007) is constructed as follows. For each variable xs , a set of relaxed variables µs (i) [0, 1], i L is introduced. These variables are required to satisfy the normalization constraints i µs (i) = 1, s V . (4) L Further, for each pair (xs , xt ), st E the relaxed variables µst (i, j ) [0, 1], i, j L are introduced which must satisfy the marginalization constraints: j µst (i, j ) = µs (i), st E , i L, L i (5) µst (i , j ) = µt (j ), st E , j L. L It is easy to see that pseudo-Boolean optimization, energy minimization with 2 labels and the MIN-CUT problem are all equivalent problems, and can be simply converted one into another. It is also known that polynomially solvable MIN-CUT problems (those having weights of all edges in the graph non-negative) correspond to quadratic pseudo-Boolean problems with all weights st being non-positive, which is equivalent to the condition of submodularity of E (·| ). 2.3. LP-relaxation of Binary Problems As shown in (Hammer et al., 1984), the LP relaxation (6) for the case of binary variables has special properties, which in general do not hold in the multi-label case. First, there exists a half-integral optimal relaxed labeling µ , i.e. all components are 0, 1 or 1. Second, 2 if µ is integral for some node s (i.e. µ () = 0), then s there exists a global minimum z of the original function in which zs = . In other words, by solving the LP relaxation we can obtain constraints on the global minima of the binary energy. These constraints can be expressed as zmin z zmax , (9) The concatenated vector µ satisfying these constraints will be called a relaxed labeling. Indeed, a vector µ with all integral components uniquely represents a labeling x. When the integrality constraints are dropped we get the following relaxation of (3): µG,L min µ, , (6) µ where G,L = + | AµI = 0, B µI = 1, µconst = i 1 s called the local (Wainwright et al., 2003) polytope of graph G. Here set + denotes vectors from with all nonnegative components, equalities AµI = 0 express marginalization constraints (5), and equalities B µI = 1 express normalization constraints (4). 2.2. Binary Energy Minimization Energy minimization problems with 2 labels (|L| = 2) are conveniently described in terms of binary (or Boolean) variables, i.e . with set of labels being B = {0, 1}. For clarity we will denote binary configurations by z. Univariate and pairwise terms of (2) can be written as: s (zs ) = s (1)zs + s (0)(1 - zs ), st (zs , zt ) = st (1, 1)zs zt + st (0, 1)(1 - zs )zt +st (1, 0)zs (1 - zt ) + st (0, 0)(1 - zs )(1 - zt ). (7) Expanding brackets in (7) it is clear that (2) can be transformed to the form: s s E (z| ) = s zs + st zs zt + const , (8) t which is a quadratic function of binary variables. Functions of the form BV R are called pseudoBoolean (Boros & Hammer, 2002) and minimization (or maximization) of (8) is called quadratic Pseudoboolean optimization. Calculating coefficients from is equivalent to choos^ ing the reparametrization with non-zero ele^ ^ ^ ments being only s (1), st (1, 1) and const . where zmin , zmax BV and inequalities are componentwise. For instance, 0 zs 1 implies no constraints on zs , while 0 zs 0 implies that zs is constrained to be 0. If (9) holds for all optimal solutions z, then the pair (zmin , zmax ) is said to define strong persistency; if (9) holds for some optimal solution z then (zmin , zmax ) defines weak persistency (Boros & Hammer, 2002). It is important to note that the LP relaxation can be solved very efficiently by computing minimum cut/maximum flow in an appropriately constructed graph. The technique in (Boros et al., 1991) is perhaps the most efficient; we will refer to it as the Qudratic PseudoBoolean Optimization (QPBO) method2 . It yields a pair (zmin , zmax ) defining strong persistency. Recently, two techniques were introduced which extend the QPBO method. The first one is Probing (Boros et al., 2006), or QPBO-P. It fixes a certain node s to a particular label , runs QPBO thus obtaining some information about global minimizers of the energy. This information is incorporated into the energy (e.g. if we learn that zs = zt for all optimal solutions then we contract nodes s and t), and the "probing" is performed for other nodes until convergence. An efficient implementation of QPBO-P was described in (Rother et al., 2007). The second method 2 Following (Rother et al., 2007) we use the abbreviation QPBO to denote the max-flow algorithm for computing the roof-dual (Boros et al., 1991) rather then the optimization problem itself. On Partial Optimality in Multi-lab el MRFs is Improve, or QPBO-I (Rother et al., 2007). It takes an input labeling z and tries to improve its energy by fixing a subset of nodes to labels specified by z and running QPBO. These operations guarantee not to increase the energy, and in practice do often decrease it. x 4 3 z (t,4) xt (s, 4) 2 xs 1 s (s, 3) (t ,3) 3. Solving Multi-lab el Problems We now address the problem of minimizing energy functions involving multi-label variables. 3.1. Converting Multi-lab el Problems Into Binary Ones As was discussed in Sec. 2.2, there are simple transitions between energy minimization with two labels, MIN-CUT problem and the quadratic pseudo-Boolean optimization. Thus, it is not essentially important to which of those forms a multi-label problem will be reduced. The construction (Ishikawa, 2003; Kovtun, 2004; Schlesinger & Flach, 2006) adopted to our notation of binary energies is as follows. We start the transformation procedure by obtaining a ^ reparametrization which satisfies the following: ^ ^ st (1, j ) = st (i, 1) = 0 ^ s (1) = 0 st E , i, j L s V. (10) (t ,2) t (s, 2) Figure 1. Converting multi-label problems into binary ones. Left: an interaction pair st E of the multi-label energy function; a labeling x is shown by black circles; low^ est labels are dashed since all weights in associated with them are 0. Right: binary variables z(s,i) , z(t,j ) used for encoding the multi-label problem; labeling z(x) is shown by black. Note that if the link (xs = 2, xt = 3) is active (left) then two links [(s, 2), (t, 2)] and [(s, 2), (t, 3)] are active (right) . · Binary energy function u u E (z| ) = H (z) + u zu + V v AE uv zu zv + const , (13) where weights are set such that ^ E (z(x)| ) = E (x|) = E (x|), x LV . (14) This reparametrization is easy to construct. For ex^ ample, to achieve st (i, 1) = 0 one needs to subtract the value c (i) = st (i, 1) from st (i, j ) and add it to s (i), which does not change the energy, and so on, see (Shekhovtsov et al., 2008) for details. Note that in ^ the case of two labels, this reparametrization immediately provides coefficients for writing a binary energy in the form (8). Let the tuple (L, G, ) define a multi-label energy min~ imization problem. Let L to refer to the set of the last ~ K - 1 labels of L, i.e. L = {2 . . . K }. The components of the equivalent binary energy minimization problem are given as follows (Fig 1): ~ · Graph N = (V , A), where V = V × L and A = ( . ~ AE AV . AE = (s, i), (t, j )) | st E , i, j L ( . AV = (s, i), (s, i - 1)) | s V , i = 3 . . . K · Binary configuration z BV . For a configuration x LV the corresponding binary configuration z(x) is defined by z(x)(s,i) = {ixs } , (s, i) V . (11) In particular pairwise terms uv are assigned as ^ (s,i),(t,j ) = Dij st ~ st E , i, j L, (15) where Dij st = st (i, j ) + st (i - 1, j - 1) - st (i, j - 1)-st (i-1, j ). Hard constraints H are as follows: u H (z) = h(zu , zv ), (16) v AV where h(z(s,i) , z(s,i-1) ) = 0 if z(s,i) z(s,i-1) and otherwise (see Fig. 1). Hard constraints ensure that any z with finite energy is in the form (11). It is already known that the above defined transformation can be used together with st-mincut algorithms to efficiently and exactly solve lattice-submodular multilabel problems. In this paper, we broaden its applicability by showing how it can be used in conjunction with roof-duality to obtain partial optimal solutions for general problems. An important aspect of the transformation is that (11) depends on the ordering of L. This will lead to certain limitations in the sequel. An interesting question raised by reviewers is whether it is possible to use a different reduction to binary variables which does not depend on the order. This does not look straightforward. For example, a rather natural reduction suggested by reviewers is to use binary indicator variables z(s,i) = {xs =i} · For a binary configuration z, the corresponding multi-label configuration x (denoted as x(z)) is found as: i xs = 1 + z(s,i) . (12) ~ L On Partial Optimality in Multi-lab el MRFs and enforce constraint z(s,i) 1 via K (K - 1)/2 i hard pairwise terms and constraints z(s,i) 1 by adding sufficiently large negative value to all unary terms. Unfortunately, the LP relaxation of the resulting binary problem can be shown to be degenerate (see (Shekhovtsov et al., 2008)). 3.2. Multi-lab el QPBO Let (G, K, ) define a multi-label energy minimization problem, and (N , B, ) define the corresponding binary energy minimization problem. The LP-relaxation of the multi-label problem is defined as: µG,L i min µ, (LP-1) Proof sketch. We have already used the mapping (11) to relate integral solutions of the two problems such that the energy is preserved. It is quite straightforward to extend it to an injective mapping of relaxed labelings µ to relaxed labelings , preserving the associated primal costs of LP-1 and LP-2. However, inverting this mapping is not always possible, so there might be a solution of LP-2, for which there is no corresponding solution µ of LP-1. Under conditions of the theorem a correction to a solution can be applied such that it remains optimal and has a preimage in the mapping feasible to LP-1. See details in (Shekhovtsov et al., 2008). Corollary 1. It is known that LP-2 can be solved using a network flow algorithm (Hammer et al., 1984). This implies that for a subclass of problems (defined by conditions of the above theorem) there exist efficient fully combinatorial algorithms to solve LP-1, which is an improvement over, e.g ., message passing algorithms such as TRW-S. But currently, we do not see applications for the case where a part of interactions is submodular and the other part is supermodular. The next result shows that strong persistency constraints (17) can be also extended to relaxed labelings: Theorem 2. Let xmin = x(zmin ), xmax = x(zmax ) be the output of MQPBO, and let µ G,L be an optimal solution of LP-1. Then µs;i = 0 for labels i outside the interval [xmin , xmax ] for al l s V . s s Proof sketch. Assume µ violates constraints of the theorem. Let then = µ. For the binary problem it follows from the roof duality that a "truncated" solution, may be constructed, which has non-zero weights ¯ m m u (a) only for labels a B such that zu in a zu ax , ¯ u V and such that the primal cost is decreased: , < , . It can then be mapped back to a so¯ lution µ = -1 of LP-1 of a strictly lower cost than ¯ ¯ µ. This contradicts to the optimality of µ. See details in (Shekhovtsov et al., 2008). The theorem shows that LP-1 never selects nodes which are rejected by LP-2, this may be useful in the analysis of the algorithms related to LP-1. while that of the binary problem defined as: N,B min , . (LP-2) We attempt minimization of E (x|) by applying QPBO and its extensions -P, -I (Boros et al., 2006; Rother et al., 2007) to the binary energy E (·| ). We call the new methods multi-label QPBO (-P,-I), or short MQPBO (-P,-I). As the original QPBO methods efficiently solves LP-2, it is important to see how LP-2 is related to the original problem minx E (x|) and to its relaxation LP-1. The following results apply. Statement 1. Let (zmin , zmax ) define strong persistency for E (·| ) such that E (zmin ) < and E (zmax ) < . Then any optimal configuration x argminLV E (·|) must satisfy xmin x xmax , where xmin = x(zmin ), xmax = x(zmax ). The proof (Shekhovtsov et al., 2008) is simply by using the relation (12). Thus for each variable s there is an interval of labels [xmin , xmax ] outside of which no label may be selected s s in an optimal solution. All labels outside the interval may therefore be safely discarded. As is seen, the ordering of L turns to be very important. While in many practical application there is a natural ordering defined, generally, constraints in the form of intervals derived from arbitrary ordering may be very weak. A pairwise term st is called submodular (resp. supermodular) if Dij st 0 (resp. 0 ), i, j = 2 . . . K. (18) (17) 4. Enhanced Algorithms In this section we discuss in more detail the "probing" and "improve" versions of MQPBO and show how they could be used in combination with other algorithms for minimization of multi-label energy functions. MQPBO-P. This enhancement applies the probing technique (Boros et al., 2006; Rother et al., 2007) to binarized energy functions. It computes stronger constraints of the form (17) on the set of optimal config- Theorem 1. If the term st is either submodular or supermodular for each edge st E , the relaxations LP-1 and LP-2 coincide, and there exist a mapping between their optimal solutions. On Partial Optimality in Multi-lab el MRFs Figure 3. Effect of non-convexity: the number of unlabelled variables in the MQPBO-P solution for different values of pairwise strength and truncation T . Figure 2. The number of labelled variables in the partially optimal solutions obtained by using MQPBO-P and the algorithm (Kovtun, 2003) (denoted by A-K). Results are shown for energy functions involving variables taking 3, 5 and 7 labels. urations. Our results show that these constraints allow us to isolate the optimal labels for many random variables of the original energy function. In fact for certain energy functions we obtained the global minimum configuration. If latter is not the case then constraints (17) lead to a simplified minimization problem with a smaller or restricted solution space, which can be further approached by any other minimization algorithms. As was mentioned above, MQPBO, and hence the probing extension, is not invariant to permutations of labels. While we are using a fixed ordering in all our experiments, the method could be potentially run under different orderings thus extracting multiple constraints. MQPBO-P + X. Similar to QPBO+X (Rother et al., 2007), restriction of the energy function obtained by MQPBO(-P) is then minimized using any other minimization algorithm X. In our experiments we used max-product BP (Pearl, 1988), TRW-S (Kolmogorov, 2006) and -expansion algorithm (Boykov et al., 2001). MQPBO-I. By using QPBO-I (Rother et al., 2007) on the binarized problem any complete labelling of the multi-label MRF can be updated such that its energy never increases. This procedure can be seen as a local search algorithm. thetic energy functions. Synthetic Problems. The energy functions corresponding to the synthetic problems contained 50×50 multi-label variables which interacted under a 4connected neighborhood. We used different numbers of labels and strengths of pairwise potentials in our experiments. Unary potentials s (xs ) are sampled uniformly in {0,1. . . 100}. The pairwise potentials had the form of a linear truncated model st (xs , xt ) = T min(|xs - xt |, T ), where T is the truncation and is the pairwise strength. Fig. 2 shows comparison of MQPBO-P to (Kovtun, 2003), truncation T is fixed to 1. It is seen that the proposed method labels more variables for a range of parameters. To study the effect of non-convexity, we varied truncation T and strength of the pairwise terms (Fig. 3). The number of labels in this case is fixed to 7. Our experiments show Original Noisy Image MQPBO-P (E=65382) BP (E=65424) TRW-S (E=65398) Expansion (E=65386) 5. Exp erimental Results We now provide the results of using our method to minimize energy functions encountered in computer vision problems. To get a good understanding of the performance of our method we also tested it on syn- Figure 4. Image Denoising: results obtained by different energy minimization algorithms. The energy used for this experiment has |LI | = 7, = 14 and T = 4. Results are annotated with their respective energy costs. All algorithms were run untill convergence. Observe that MQPBOP labels all variables and thus obtains the globally optimal solution for this energy. On Partial Optimality in Multi-lab el MRFs Figure 5. Ob ject Segmentation and Recognition using (Shotton et al., 2006). The first row contains an image from the MSRC (Shotton et al., 2006) dataset and the results of running BP and TRW-S on the full energy. Different levels of gray denote different ob ject classes such as "sky" and "road". The partially optimal solution obtained by running MQPBO-P and A-K (Kovtun, 2003) is shown in the bottom row, left image. Unlabeled pixels are shown in green. This solution is used to obtain a restricted energy. Running BP (bottom, middle) and TRW-S (bottom, right) on the restricted energy gives solutions with lower energy. Hence running A-K + MQPBO-P + "X" is better than running "X" alone. In all cases BP and TRW-S were run for 50 iterations. Figure 6. In this application we are stitching together four images (already rectified) to a panoramic image. Running alpha expansion gives result (a) and a zoom-in (dashed rectangle) is shown in (b). The red arrow indicates a visible cut. Image (c) shows the number of possible labels for this image area, where white means all four images overlap and very dark means only one image is possible for those pixels. When applying MQPBO and MQPBO-P to this image portion we obtain labelling (d) and (e) respectively, where green means unlabeled and the different gray scales represent different labels. We see that MQPBO-P is able to label more pixels than MQPBO. It is also worth noting that the visible cut in (b) is indeed the global minimum which can be seen from labelling (e). that MQPBO-P finds the globally optimal solution of energy functions where the pairwise term is small in magnitude or is nearly convex. As expected, the number of variables labelled by the algorithm decrease with increase in the strength and non-convexity of the pairwise terms (Fig. 3). Image Denoising. We now test the MQPBO-P algorithm on the problem of image denoising and restoration. There is a random variable for each pixel in the image. The label set for the problem is the set of intensities LI the pixels can take. The unary cost for taking a particular label (intensity) is defined as s (xs ) = |Is - (xs )| where Is is the intensity of the pixel s in the image, and the function maps the labels to their corresponding intensity levels. The pairwise terms of the energy are defined as: st (xs , xt ) = min(|xs - xt |, T ) where is a model parameter and T is the truncation used. Our experiments showed that the MQPBO-P algorithm performed quite well on the energy function and in some cases obtained the globally optimal solution which was not achieved by other energy minimization algorithms (see Fig. 4). Ob ject based Segmentation. We now show the results of using the MQPBO-P method for restricting the energy functions. Our results show that the restriction significantly reduces the number of variables and makes them amenable for minimization using other algorithms. We test the algorithm on the problem of ob ject segmentation and recognition. We use the energy function formulated in (Shotton et al., 2006). The binarized energy function corresponding to this problem has around 107 variables and running MQPBO-P on it directly is quite time consuming. To reduce the size of the problem we first run the partial optimality algorithm described in (Kovtun, 2003), referred to as A-K. MQPBO-P is run on the restriction obtained using A-K. This combined procedure leaves 694 variables unlabelled. The results are shown in Fig. 5. Image Stitching. Finally, we investigated an application where MQPBO-P shows its limitations. For panoramic stitching the unary terms are either zero or infinity, depending on the presence or absence of an image, and consequently the pairwise terms dominate the energy. We use the panoramic stitching formulation from (Agarwala et al., 2004) where pairwise terms model the visibility of a transition, different for each pair of images. The results are discussed in fig 6. 6. Conclusions This paper addressed the problem of minimizing nonsubmodular multi-label energy functions. These are used extensively in computer vision and are generally NP-hard to minimize. We present a method for obtaining partially optimal solutions of such energies derived from roof-dual based methods for binary energy functions. We give new theoretical insights in the underlying LP relaxation, being efficiently solved by the method. Although this work is mainly theoretical in nature we hope to inspire people to use these ideas to develop better optimization algorithms. We also believe that this approach is useful for other impor- On Partial Optimality in Multi-lab el MRFs tant problems in computer vision such as MRF/CRF learning. Komodakis, N., & Tziritas, G. (2005). A new framework for approximate labeling via graph cuts. ICCV (pp. 1018­1025). Koval, V., & Schlesinger, M. (1976). Two-dimensional programming in image analysis problems. Automatics and Telemechanics, 2, 149­168. In Russian. Kovtun, I. (2003). Partial optimal labeling search for a NPhard subclass of (max, +) problems. DAGM-Symposium (pp. 402­409). Kovtun, I. (2004). Image segmentation based on sufficient conditions of optimality in NP-complete classes of structural label ling problem. Doctoral dissertation. In Ukrainian. Lauritzen, S. L. (1998). Graphical models. No. 17 in Oxford Statistical Science Series. Oxford Science Publications. Pearl, J. (1988). Probabilistic reasoning in intel ligent systems: Networks of plausible inference. Morgan Kaufmann. Rother, C., Kolmogorov, V., Lempitsky, V., & Szummer, M. (2007). Optimizing binary MRFs via extended roof duality. CVPR (pp. 1­8). Schlesinger, D. (2007). Exact solution of permuted submodular minsum problems. EMMCVPR (pp. 28­38). Springer. Schlesinger, D., & Flach, B. (2006). Transforming an arbitrary minsum problem into a binary one (Technical Report TUD-FI06-01). Dresden University of Technology. Schlesinger, M. (1976). Syntactic analysis of twodimensional visual signals in noisy conditions. Kibernetika, Kiev, 4, 113­130. In Russian. Schlesinger, M. I., & Flach, B. (2000). Some solvable subclasses of structural recognition problems. Czech Pattern Recognition Workshop. Schlesinger, M. I., & Giginyak, V. V. (2007). Solution to structural recognition (MAX,+)-problems by their equivalent transformations. Control Systems and Computers, 1,2. Shekhovtsov, A., Kolmogorov, V., Kohli, P., Hlavac, V., Rother, C., & Torr, P. (2008). LP-relaxation of binarized energy minimization. Research Report CTU­ CMP­2007­27). Czech Technical University. Shotton, J., Winn, J. M., Rother, C., & Criminisi, A. (2006). TextonBoost: Joint appearance, shape and context modeling for multi-class ob ject recognition and segmentation. ECCV (1) (pp. 1­15). Szeliski, R., Zabih, R., Scharstein, D., Veksler, O., Kolmogorov, V., Agarwala, A., Tappen, M. F., & Rother, C. (2006). A comparative study of energy minimization methods for Markov random fields. ECCV (2) (pp. 16­ 29). Wainwright, M., Jaakkola, T., & Willsky, A. (2003). Exact MAP estimates by (hyper)tree agreement. In Advances in neural information processing systems 15, 809­816. Werner, T. (2007). A linear programming approach to max-sum problem: A review. PAMI, 29, 1165­1179. Acknowledgments We would like to thank the anonymous reviewers for their useful comments. A. Shekhovtsov thanks the European Commission grant 215078 (DIPLECS) and Czech government grant MSM6840770038 for support. V. Kolmogorov thanks EPSRC for support. P. Torr thanks EPSRC and PASCAL, EU for support. References Agarwala, A., Dontcheva, M., Agrawala, M., Drucker, S. M., Colburn, A., Curless, B., Salesin, D., & Cohen, M. F. (2004). Interactive digital photomontage. ACM Trans. Graph., 23, 294­302. Boros, E., & Hammer, P. (2002). Pseudo-boolean optimization. Discrete Applied Mathematics, 155­225. Boros, E., Hammer, P. L., & Sun, X. (1991). Network flows and minimization of quadratic pseudo-Boolean functions (Technical Report RRR 17-1991). RUTCOR. Boros, E., Hammer, P. L., & Tavares, G. (2006). Preprocessing of unconstrained quadratic binary optimization (Technical Report RRR 10-2006). RUTCOR. Boykov, Y., Veksler, O., & Zabih, R. (2001). Fast approximate energy minimization via graph cuts. PAMI, 23, 1222­1239. Desmet, J., Maeyer, M. D., Hazes, B., & Lasters, I. (1992). The dead-end elimination theorem and its use in protein side-chain positioning. Nature, 356, 539­542. Felzenszwalb, P. F., & Huttenlocher, D. P. (2000). Efficient matching of pictorial structures. CVPR (pp. 66­73). Hammer, P., Hansen, P., & Simeone, B. (1984). Roof duality, complementation and persistency in quadratic 0-1 optimization. Math. Programming, 121­155. Hammer, P. L. (1965). Some network flow problems solved with pseudo-Boolean programming. Operation Research, 13, 388­399. Ishikawa, H. (2003). Exact optimization for Markov random fields with convex priors. PAMI, 25, 1333­1336. Kolmogorov, V. (2006). Convergent tree-reweighted message passing for energy minimization. PAMI, 28(10), 1568­1583. Kolmogorov, V., & Rother, C. (2007). Minimizing nonsubmodular functions with graph cuts ­ a review. PAMI, 29, 1274­1279. Kolmogorov, V., & Zabih, R. (2004). What energy functions can be minimized via graph cuts? PAMI, 26, 147­ 159. Kolmogorov, V. N., & Wainwright, M. J. (2005). On optimality of tree-reweighted max-product message-passing. Appeared in Uncertainty in Artificial Intel ligence. Komodakis, N., Paragios, N., & Tziritas, G. (2007). MRF optimization via dual decomposition: Message-passing revisited. ICCV (pp. 1­8).