Efficient Linear Programming for Dense CRFs

Thalaiyasingam Ajanthan, Alban Desmaison, Rudy Bunel, Mathieu Salzmann, Philip H. S. Torr, M. Pawan Kumar

Abstract

The fully connected conditional random field (CRF) with Gaussian pairwise potentials has proven popular and effective for multi-class semantic segmentation. While the energy of a dense CRF can be minimized accurately using a linear programming (LP) relaxation, the state-of-the-art algorithm is too slow to be useful in practice. To alleviate this deficiency, we introduce an efficient LP minimization algorithm for dense CRFs. To this end, we develop a proximal minimization framework, where the dual of each proximal problem is optimized via block coordinate descent. We show that each block of variables can be efficiently optimized. Specifically, for one block, the problem decomposes into significantly smaller subproblems, each of which is defined over a single pixel. For the other block, the problem is optimized via conditional gradient descent. This has two advantages: 1) the conditional gradient can be computed in a time linear in the number of pixels and labels, and 2) the optimal step size can be computed analytically. Our experiments on standard datasets provide compelling evidence that our approach outperforms all existing baselines including the previous LP based approach for dense CRFs.

Introduction

In semantic segmentation, the goal is to assign a categorical label to every pixel in an image. Dense Conditional Random Fields (CRFs) have emerged as a powerful tool for this task because they model relationships between every pair of pixels, facilitating sharp boundaries and spatial consistency. However, the computational cost of dense CRFs is significant. While Mean Field (MF) inference is fast, it often converges to poor local minima. Linear Programming (LP) relaxation offers stronger theoretical guarantees and superior solutions but has historically been computationally prohibitive. Previous LP solvers relied on subgradient descent with $O(n \log n)$ complexity, leading to sluggish performance. This work introduces PROX-LP, the first algorithm to minimize the LP relaxation of dense CRFs with linear time complexity ($O(n)$) per iteration.

Methodology

The PROX-LP framework optimizes the LP objective by breaking it into manageable components through a proximal minimization approach. Instead of directly attacking the non-smooth LP objective, a quadratic proximal term is added to smooth the dual problem, enabling the use of efficient optimization techniques.

Dual Optimization via Block Coordinate Descent

The optimization is split into two blocks of variables:

  1. Pixel-wise Variables: This block decomposes into independent subproblems for each pixel, which can be solved efficiently in parallel.
  2. Pairwise Variables: This block is optimized using the Frank-Wolfe (conditional gradient) algorithm. Frank-Wolfe is particularly advantageous here as it is projection-free and allows for an analytical computation of the optimal step size.

Linear-Time Gradient Computation

A key breakthrough of this work is the "Modified Filtering" technique. To compute the gradient for the Frank-Wolfe step, the algorithm must handle ordering constraints (e.g., $y_a \geq y_b$). Standard fast filtering techniques like the Permutohedral Lattice assume symmetry and cannot be directly applied. The authors overcome this by discretizing pixel scores into $H$ bins and running $H$ separate lattices. This discretization allows for gradient computation in truly linear time, providing a 10–65x speedup over previous $O(n \log n)$ methods.

Experimental Results

The proposed algorithm was evaluated on the MSRC and Pascal VOC 2010 datasets. PROX-LP consistently achieved lower energy states faster than Mean Field, Difference of Convex (DC) relaxation, and previous LP subgradient methods.

Energy minimization performance over time. PROX-LP variants converge to lower energy states significantly faster than previous LP and DC baselines.

Qualitatively, the improved energy minimization translates to more accurate segmentation boundaries. On the MSRC dataset, the accelerated version, PROX-LP$_{acc}$, achieved the highest accuracy (84.16%) among all compared inference methods.

Qualitative comparison of semantic segmentation. PROX-LP variants produce results that are more consistent with the ground truth compared to Mean Field and other baselines.

Discussion and Conclusion

PROX-LP demonstrates that LP relaxation for dense CRFs can be made practical through clever optimization and filtering techniques. While the discretization of scores introduces a minor approximation, the resulting linear-time complexity makes LP methods competitive with faster heuristics.

An interesting observation from the results is that reaching a lower energy state does not always lead to a higher Intersection over Union (IoU), suggesting that while the optimizer is highly effective, the underlying CRF model parameters may require further tuning. Future work will focus on integrating this efficient solver into deep learning pipelines for end-to-end parameter learning.

Summary updated

BibTeX
@inproceedings{ajanthan2017efficient,
  author = {Thalaiyasingam Ajanthan and Alban Desmaison and Rudy Bunel and Mathieu Salzmann and Philip H. S. Torr and M. Pawan Kumar},
  title = {{Efficient Linear Programming for Dense CRFs}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2017},
  url = {https://openreview.net/forum?id=BJ-Zaa-OWr},
}
Figure