Network Flow Algorithms for Structured Sparsity
Julien Mairal, Rodolphe Jenatton, Guillaume Obozinski, Francis Bach
Introduction
By considering sums of norms of appropriate subsets, or groups, of variables, these regularizations control the sparsity patterns of the solutions. The underlying optimization problem is usually difficult, in part because it involves nonsmooth components. Proximal methods have proven to be effective in this context, essentially because of their fast convergence rates and their ability to deal with large problems . While the settings where the penalized groups of variables do not overlap or are embedded in a tree-shaped hierarchy have already been studied, sparsity-inducing regularizations of general overlapping groups have, to the best of our knowledge, never been considered within the proximal method framework.
This paper makes the following contributions:
It shows that the proximal operator associated with the structured norm we consider can be computed by solving a quadratic min-cost flow problem, thereby establishing a connection with the network flow optimization literature.
It presents a fast and scalable procedure for solving a large class of structured sparse regularized problems, which, to the best of our knowledge, have not been addressed efficiently before.
It shows that the dual norm of the sparsity-inducing norm we consider can also be evaluated efficiently, which enables us to compute duality gaps for the corresponding optimization problems.
It demonstrates that our method is relevant for various applications, from video background subtraction to estimation of hierarchical structures for dictionary learning of natural image patches.
Structured Sparse Models
We consider in this paper convex optimization problems of the form
If is a more general partition of , variables are selected in groups rather than individually. When the groups overlap, is still a norm and sets groups of variables to zero together . The latter setting has first been considered for hierarchies , and then extended to general group structures .Note that other types of structured sparse models have also been introduced, either through a different norm , or through non-convex criteria . Solving Eq. (1) in this context becomes challenging and is the topic of this paper. Following who tackled the case of hierarchical groups, we propose to approach this problem with proximal methods, which we now introduce.
In a nutshell, proximal methods can be seen as a natural extension of gradient-based techniques, and they are well suited to minimizing the sum of two convex terms, a smooth function —continuously differentiable with Lipschitz-continuous gradient— and a potentially non-smooth function (see and references therein). At each iteration, the function is linearized at the current estimate and the so-called proximal problem has to be solved:
The quadratic term keeps the solution in a neighborhood where the current linear approximation holds, and is an upper bound on the Lipschitz constant of . This problem can be rewritten as
A Quadratic Min-Cost Flow Formulation
Without loss of generality, Let denote a solution of Eq. (4). Optimality conditions of Eq. (4) derived in show that for all in , the signs of the non-zero coefficients for in are the same as the signs of the entries . To solve Eq. (4), one can therefore flip the signs of the negative variables , then solve the modified dual formulation (with non-negative variables), which gives the magnitude of the entries (the signs of these being known). we assume from now on that the scalars are all non-negative, and we constrain the entries of to be non-negative. We now introduce a graph modeling of problem (4).
We introduce a canonical graph associated with our optimization problem, and uniquely characterized by the following construction: (i) is the union of two sets of vertices and , where contains exactly one vertex for each index in , and contains exactly one vertex for each group in . We thus have . For simplicity, we identify groups and indices with the vertices of the graph. (ii) For every group in , contains an arc . These arcs have capacity and zero cost. (iii) For every group in , and every index in , contains an arc with zero cost and infinite capacity. We denote by the flow on this arc. (iv) For every index in , contains an arc with infinite capacity and a cost , where is the flow on . Note that by flow conservation, we necessarily have .
Examples of canonical graphs are given in Figures 1(a)-1(c). The flows associated with can now be identified with the variables of problem (4): indeed, the sum of the costs on the edges leading to the sink is equal to the objective function of (4), while the capacities of the arcs match the constraints on each group. This shows that finding a flow minimizing the sum of the costs on such a graph is equivalent to solving problem (4).
When some groups are included in others, the canonical graph can be simplified to yield a graph with a smaller number of edges. Specifically, if and are groups with , the edges for carrying a flow can be removed and replaced by a single edge of infinite capacity and zero cost, carrying the flow . This simplification is illustrated in Figure 1(d), with a graph equivalent to the one of Figure 1(c). This does not change the optimal value of , which is the quantity of interest for computing the optimal primal variable . We present in Appendix A a formal definition of equivalent graphs. These simplifications are useful in practice, since they reduce the number of edges in the graph and improve the speed of the algorithms we are now going to present.
2 Computation of the Proximal Operator
The general case of overlapping groups is more difficult. Hochbaum and Hong have shown in that quadratic min-cost flow problems can be reduced to a specific parametric max-flow problem, for which an efficient algorithm exists .By definition, a parametric max-flow problem consists in solving, for every value of a parameter, a max-flow problem on a graph whose arc capacities depend on this parameter. While this approach could be used to solve Eq. (4), it ignores the fact that our graphs have non-zero costs only on edges leading to the sink. To take advantage of this specificity, we propose the dedicated Algorithm 1. Our method clearly shares some similarities with a simplified version of presented in , namely a divide and conquer strategy. Nonetheless, we performed an empirical comparison described in Appendix D, which shows that our dedicated algorithm has significantly better performance in practice.
The approach of is guaranteed to have the same worst-case complexity as a single max-flow algorithm. However, we have experimentally observed a significant discrepancy between the worst case and empirical complexities for these flow problems, essentially because the empirical cost of each max-flow is significantly smaller than its theoretical cost. Despite the fact that the worst-case guarantee of our algorithm is weaker than their (up to a factor ), it is more adapted to the structure of our graphs and has proven to be much faster in our experiments (see supplementary material).
Some implementation details are crucial to the efficiency of the algorithm:
Exploiting maximal connected components: When there exists no arc between two subsets of , it is possible to process them independently to solve the global min-cost flow problem. To that effect, before calling the function computeFlow(), we look for maximal connected components and call sequentially the procedure computeFlow() for in .
Efficient max-flow algorithm: We have implemented the “push-relabel” algorithm of to solve our max-flow problems, using classical heuristics that significantly speed it up in practice (see ). Our implementation uses the so-called “highest-active vertex selection rule, global and gap heuristics” (see ), and has a worst-case complexity of for a graph . This algorithm leverages the concept of pre-flow that relaxes the definition of flow and allows vertices to have a positive excess.
Using flow warm-restarts: Our algorithm can be initialized with any valid pre-flow, enabling warm-restarts when the max-flow is called several times as in our algorithm.
Improved projection step: The first line of the procedure computeFlow can be replaced by The idea is that the structure of the graph will not allow to be greater than after the max-flow step. Adding these additional constraints leads to better performance when the graph is not well balanced. This modified projection step can still be computed in linear time .
3 Computation of the Dual Norm
In the network problem associated with (12), the capacities on the arcs , , are set to , and the capacities on the arcs , in , are fixed to . Solving problem (12) amounts to finding the smallest value of , such that there exists a flow saturating the capacities on the arcs leading to the sink (i.e., ). Equration (12) and the algorithm below are proven to be correct in Appendix B.
Applications and Experiments
Our experiments use the algorithm of based on our proximal operator, with weights set to . We present this algorithm in more details in Appendix C.
In our experiments, the regularization parameter is chosen to achieve this level of sparsity. For SG, we take the step size to be equal to , where is the iteration number, and are the best parameters selected in . For the interior point methods, since problem (1) can be cast either as a quadratic (QP) or as a conic program (CP), we show in Figure 2 the results for both formulations. Our approach compares favorably with the other methods, on three problems of different sizes, , see Figure 2. In addition, note that QP, CP and SG do not obtain sparse solutions, whereas ProxFlow does. We have also run ProxFlow and SG on a larger dataset with : after hours, ProxFlow and SG have reached a relative duality gap of and respectively.Due to the computational burden, QP and CP could not be run on every problem.
2 Background Subtraction
3 Multi-Task Learning of Hierarchical Structures
Inspired by ideas from multi-task learning , we propose to learn the tree structure by pruning irrelevant parts of a larger initial tree . We achieve this by using an additional regularization term across the different decompositions, so that subtrees of will simultaneously be removed for all signals . In other words, the approach of is extended by the following formulation:
Conclusion
Appendix A Equivalence to Canonical Graphs
Formally, the notion of equivalence between graphs can be summarized by the following lemma:
Let be the canonical graph corresponding to a group structure with weights . Let be a graph sharing the same set of vertices, source and sink as , but with a different arc set . We say that is equivalent to if and only if the following conditions hold:
Arcs of outgoing from the source are the same as in , with the same costs and capacities.
Arcs of going to the sink are the same as in , with the same costs and capacities.
For every arc in , with in , there exists a unique path in from to with zero costs and infinite capacities on every arc of the path.
Conversely, if there exists a path in between a vertex in and a vertex in , then there exists an arc in .
Then, the cost of the optimal min-cost flow on and are the same. Moreover, the values of the optimal flow on the arcs , in , are the same on and .
Proof. We first notice that on both and , the cost of a flow on the graph only depends on the flow on the arcs , in , which we have denoted by in .
We will prove that finding a feasible flow on with a cost is equivalent to finding a feasible flow on with the same cost . We now use the concept of path flow, which is a flow vector in carrying the same positive value on every arc of a directed path between two nodes of . It intuitively corresponds to sending a positive amount of flow along a path of the graph.
According to the definition of graph equivalence introduced in the Lemma, it is easy to show that there is a bijection between the arcs in , and the paths in with positive capacities on every arc. Given now a feasible flow in , we build a feasible flow on which is a sum of path flows. More precisely, for every arc in , we consider its equivalent path in , with a path flow carrying the same amount of flow as . Therefore, each arc in has a total amount of flow that is equal to the sum of the flows carried by the path flows going over . It is also easy to show that this construction builds a flow on (capacity and conservation constraints are satisfied) and that this flow has the same cost as , that is, .
Conversely, given a flow on , we use a classical path flow decomposition (see Proposition 1.1 in ), saying that there exists a decomposition of as a sum of path flows in . Using the bijection described above, we know that each path in the previous sums corresponds to a unique arc in . We now build a flow in , by associating to each path flow in the decomposition of , an arc in carrying the same amount of flow. The flow of every other arc in is set to zero. It is also easy to show that this builds a valid flow in that has the same cost as .
Appendix B Convergence Analysis
We show in this section the correctness of Algorithm 1 for computing the proximal operator, and of Algorithm 2 for computing the dual norm .
We now prove that our algorithm converges and that it finds the optimal solution of the proximal problem. This requires that we introduce the optimality conditions for problem (4) derived in , since our convergence proof essentially checks that these conditions are satisfied upon termination of the algorithm.
The primal-dual variables are respectively solutions of the primal (3) and dual problems (4) if and only if the dual variable is feasible for the problem (4) and
Note that these optimality conditions provide an intuitive view of our min-cost flow problem. Solving the min-cost flow problem is equivalent to sending the maximum amount of flow in the graph under the capacity constraints, while respecting the rule that the flow outgoing from a group should always be directed to the variables with maximum residual .
Before proving the convergence and correctness of our algorithm, we also recall classical properties of the min capacity cuts, which we intensively use in the proofs of this paper. The procedure computeFlow of our algorithm finds a minimum -cut of a graph , dividing the set into two disjoint parts and . is by construction the sets of nodes in such that there exists a non-saturating path from to , while all the paths from to are saturated. Conversely, arcs from to are all saturated, whereas there can be non-saturated arcs from to . Moreover, the following properties hold
There is no arc going from to . Otherwise the value of the cut would be infinite. (Arcs inside have infinite capacity by construction of our graph).
There is no flow going from to (see properties of the minimum -cut ).
The cut goes through all arcs going from to , and all arcs going from to .
All these properties are illustrated on Figure 5.
Recall that we assume (cf. Section 3.1) that the scalars are all non negative, and that we add non-negativity constraints on . With the optimality conditions of Lemma 3 in hand, we can show our first convergence result.
Algorithm 1 converges in a finite and polynomial number of operations.
Suppose for instance that . In this case, the capacity of the min-cut is equal to , and the value of the max-flow is . Using the classical max-flow/min-cut theorem , we have equality between these two terms. Since, by definition of both and , we have for all in , , we obtain a contradiction with the existence of in such that .
Conversely, suppose now that . Then, the value of the max-flow is still , and the value of the min-cut is . Using again the max-flow/min-cut theorem, we have that . Moreover, by definition of , we also have , leading to a contradiction with the existence of in such that . This proof holds for any graph that is equivalent to the canonical one. After proving the convergence, we prove that the algorithm is correct with the next proposition.
Algorithm 1 solves the proximal problem of Eq. (3).
Proof. For a group structure , we first prove the correctness of our algorithm if the graph used is its associated canonical graph that we denote . We proceed by induction on the number of nodes of the graph. The induction hypothesis is the following: For all canonical graphs associated with a group structure with weights such that , computeFlow solves the following optimization problem:
Since , it is sufficient to show that to prove the proposition.
We initialize the induction by , corresponding to the simplest canonical graph, for which ). Simple algebra shows that is indeed correct.
The algorithm then computes a max-flow, using the scalars as capacities, and we now have two possible situations:
If for all in , the algorithm stops; we write for in , and using Eq. (8), we obtain
Since all the quantities in the previous sum are positive, this can only hold if for all ,
Moreover, by definition of the max flow and the optimality conditions, we have
By Lemma 3, we have shown that the problem (7) is solved.
Let us now consider the case where there exists in such that . The algorithm splits the vertex set into two parts and , which we have proven to be non-empty in the proof of Proposition 1. The next step of the algorithm removes all edges between and (see Figure 5). Processing and independently, it updates the value of the flow matrix , and the corresponding flow vector . As for , we denote by , and , .
Then, we notice that and are respective canonical graphs for the group structures , and .
Writing for in , and using the induction hypotheses and , we now have the following optimality conditions deriving from Lemma 3 applied on Eq. (7) respectively for the graphs and :
We will now combine Eq. (10) and Eq. (11) into optimality conditions for Eq. (7). We first notice that since there are no arcs between and in (see the properties of the cuts discussed before this proposition). It is therefore possible to replace by in Eq. (10). We will show that it is possible to do the same in Eq. (11), so that combining these two equations yield the optimality conditions of Eq. (7).
More precisely, we will show that for all and , , in which case can be replaced by in Eq. (11). This result is relatively intuitive: and being an -cut, all arcs between and are saturated, while there are unsaturated arcs between and ; one therefore expects the residuals to decrease on the side, while increasing on the side. The proof is nonetheless a bit technical.
Let us show first that for all in , . We split the set into disjoint parts:
As previously, we denote and . We want to show that is necessarily empty. We reason by contradiction and assume that .
According to the definition of the different sets above, we observe that no arcs are going from to , that is, for all in , . We observe as well that the flow from to is the null flow, because optimality conditions (10) imply that for a group only nodes such that receive some flow, which excludes nodes in provided ; Combining this fact and the inequality (which is a direct consequence of the minimum -cut), we have as well
Let , if then for some such that receives some flow from , which from the optimality conditions (10) implies ; by definition of , . But since at the optimum, , this implies that , and in turn that . Finally,
We now have that for all in , . The proof showing that for all in , uses the same kind of decomposition for , and follows along similar arguments. We will therefore not detail it.
To recap, we have shown that for all and , . Since there is no flow from to , i.e., for in and in , we can now replace the definition of in Eq. (11) by , the combination of Eq. (10) and Eq. (11) gives us optimality conditions for Eq. (7).
The proposition being proved for the canonical graph, we extend it now for an equivalent graph in the sense of Lemma 2. First, we observe that the algorithm gives the same values of for two equivalent graphs. Then, it is easy to see that the value given by the max-flow, and the chosen -cut is the same, which is enough to conclude that the algorithm performs the same steps for two equivalent graphs.
Similarly to the proximal operator, the computation of dual norm can itself shown to solve another network flow problem, based on the following variational formulation, which extends a previous result from :
Proof. By definition of , we have
with the additional conic constraints . This primal problem is convex and satisfies Slater’s conditions for generalized conic inequalities, which implies that strong duality holds . We now consider the Lagrangian defined as
After simplifying the Lagrangian and flipping the sign of , the dual problem then reduces to
which is the desired result. We now prove that Algorithm 2 is correct.
Algorithm 2 computes the value of the dual norm of Eq. (12) in a finite and polynomial number of operations.
Proof. The convergence of the algorithm only requires to show that the cardinality of in the different calls of the function computeFlow strictly decreases. Similar arguments to those used in the proof of Proposition 1 can show that each part of the cuts are both non-empty. The algorithm thus requires a finite number of calls to a max-flow algorithm and converges in a finite and polynomial number of operations.
Let us now prove that the algorithm is correct for a canonical graph. We proceed again by induction on the number of nodes of the graph. More precisely, we consider the induction hypothesis defined as: for all canonical graphs associated with a group structure and such that , dualNormAux solves the following optimization problem:
We first initialize the induction by (i.e., with the simplest canonical graph, such that ). Simple algebra shows that is indeed correct.
We next consider a canonical graph such that , and suppose that is true. After the max-flow step, we have two possible cases to discuss:
If for all in , the algorithm stops. We know that any scalar such that the constraints of Eq. (13) are all satisfied necessarily verifies . We have indeed that is the value of an -cut in the graph, and is the value of the max-flow, and the inequality follows from the max-flow/min-cut theorem . This gives a lower-bound on . Since this bound is reached, is necessarily optimal.
We now consider the case where there exists in such that , meaning that for the given value of , the constraint set of Eq. (13) is not feasible for , and that the value of should necessarily increase. The algorithm splits the vertex set into two non-empty parts and and we remark that there are no arcs going from to , and no flow going from to . Since the arcs going from to are saturated, we have that . Let us now consider the solution of Eq. (13). Using the induction hypothesis , the algorithm computes a new value that solves Eq. (13) when replacing by and this new value satisfies the following inequality . The value of has therefore increased and the updated flow now satisfies the constraints of Eq. (13) and therefore . Since there are no arcs going from to , is feasible for Eq. (13) when replacing by and we have that and then .
To prove that the result holds for any equivalent graph, similar arguments to those used in the proof of Proposition 1 can be exploited, showing that the algorithm computes the same values of and same -cuts at each step.
Appendix C Algorithm FISTA with duality gap
In this section, we describe in details the algorithm FISTA when applied to solve problem (1), with a duality gap as stopping criterion.
in place of (1). Based on Fenchel duality arguments ,
is a duality gap for (14). where is the Fenchel conjugate of . Given a primal variable , a good dual candidate can be obtained by looking at the conditions that have to be satisfied by the pair at optimality . In particular, the dual variable is chosen to be
Consequently, computing the duality gap requires evaluating the dual norm . We sum up the computation of the duality gap in Algorithm 3.
Appendix D Additional Experimental Results
As shown in , min-cost flow problems, and in particular, the dual problem of (3), can be reduced to a specific parametric max-flow problem. We thus compare our approach (ProxFlow) with the efficient parametric max-flow algorithm proposed by Gallo, Grigoriadis, and Tar- jan and a simplified version of the latter proposed by Babenko and Goldberg in . We refer to these two algorithms as GGT and SIMP respectively. The benchmark is established on the same datasets as those already used in the experimental section of the paper, namely: (1) three datasets built from overcomplete bases of discrete cosine transforms (DCT), with respectively and variables, and (2) images used for the background subtraction task, composed of 57600 pixels. For GGT and SIMP, we use the paraF software which is a C++ parametric max-flow implementation available at http://www.avglab.com/andrew/soft.html. Experiments were conducted on a single-core 2.33 Ghz.
We report in the following table the execution time in seconds of each algorithm, as well as the statistics of the corresponding problems:
Although we provide the speed comparison for a single value of (the one used in the corresponding experiments of the paper), we observed that our approach consistently outperforms GGT and SIMP for values of corresponding to different regularization regimes.