Efficient SDP Inference for Fully-connected CRFs Based on Low-rank Decomposition

Peng Wang, Chunhua Shen, Anton van den Hengel · DOI

TL;DR

Fully-connected Conditional Random Fields (CRFs) are powerful tools for capturing long-range pixel dependencies in computer vision, but their computational cost is traditionally prohibitive. This paper introduces a scalable Semidefinite Programming (SDP) relaxation algorithm combined with low-rank matrix approximations to achieve efficient, pixel-level inference. This approach breaks free from the strict Gaussian kernel constraints of previous methods, enabling state-of-the-art results on complex tasks like image co-segmentation.

What Problem Does This Paper Address?

In computer vision, understanding the context of an image requires looking at how pixels relate to one another. Standard Conditional Random Fields (CRFs) only model relationships between immediate neighbors (sparse graphs) to keep computation fast. However, this misses long-range context—like realizing a patch of green next to a blue pixel at the top of an image is likely a tree next to the sky.

Fully-connected CRFs solve this by connecting every single pixel to every other pixel. The catch? An image with $N$ pixels results in $N^2$ edges, quickly ballooning into billions of connections for standard images. Existing fast inference methods, like mean-field approximation, rely on clever filtering tricks to handle this load, but they suffer from two major flaws:

  1. They are highly sensitive to initialization and easily get stuck in poor local optima.
  2. They strictly require the pixel-relationship functions (kernels) to be Gaussian and defined over a low-dimensional Euclidean space.

The authors tackle these limitations by developing a general, highly scalable optimization framework that can handle arbitrary positive semidefinite kernels without getting trapped in local minima.

Methods

The authors frame the maximum a posteriori (MAP) inference problem as a Binary Quadratic Program (BQP) and apply a Semidefinite Programming (SDP) relaxation. To make this computationally tractable for hundreds of thousands of variables, they introduce LR-SDCut (Low-Rank SDCut), which features three core innovations:

  1. Nyström Low-Rank Approximation: Instead of computing the massive $N \times N$ pixel-relationship matrix, they use Nyström sampling (guided by $k$-means clustering) to approximate it as a product of much smaller matrices ($K \approx \Phi \Phi^T$). This reduces the complexity of the vital matrix-vector multiplication step from quadratic ($O(N^2)$) to linear ($O(N)$).
  2. Low-Rank Initialization: SDP dual problems are typically bottlenecked by expensive eigen-decompositions in the first few iterations. By perturbing the initial cost matrix using its $r$-th smallest eigenvalue, the authors artificially force the matrix to be low-rank right from the start, drastically speeding up early quasi-Newton optimization steps.
  3. Early Stopping with Random Rounding: Instead of waiting for the quasi-Newton algorithm to fully converge, the authors apply a randomized rounding scheme at every iteration. They observed that the energy drops precipitously in the first few steps, meaning they can stop the algorithm early without sacrificing solution quality.

Datasets

The algorithm was evaluated on two primary tasks using the MSRC dataset:

  • Image Segmentation: Evaluated using 93 representative images from the MSRC 21-class database.
  • Image Co-segmentation: Evaluated on three challenging object groups (Cow, Sheep, and Tree) to segment common foreground objects across multiple images simultaneously.

Key Insights and Ideas

  • Kernel Liberation: By replacing traditional bilateral filtering with Nyström low-rank approximations, the method is no longer restricted to Gaussian kernels. It can seamlessly handle any symmetric positive semidefinite (SPSD) kernel, allowing researchers to use more descriptive, non-Euclidean feature spaces.
  • Optimization over Smoothing: Unlike mean-field approximations that smooth out probabilities and get stuck in local optima, the SDP approach directly minimizes the discrete energy function more effectively.
  • True Pixel-Level Co-segmentation: Prior SDP methods for co-segmentation were so computationally heavy that they had to group pixels into "superpixels" first, losing fine details. This paper's low-rank approach scales well enough to compute true pixel-level relationships across an entire set of images.

Key Results

  • Lower Energy, Better Optimization: On the MSRC single-image segmentation task, the proposed method achieved a significantly lower energy score ($9.02 \times 10^4$) compared to the standard mean-field approach ($9.79 \times 10^4$), demonstrating superior optimization performance.
  • Co-segmentation Breakthroughs: For image co-segmentation, the method vastly outperformed competitors. On the difficult "Tree" dataset, LR-SDCut achieved a segmentation accuracy of 0.83, compared to just 0.65 for the Nyström-accelerated mean-field method.
  • Scalability: The algorithm successfully processed fully-connected graphs with up to $6.8 \times 10^5$ variables, running slightly faster than the mean-field equivalent in co-segmentation scenarios.

Limitations and Future Work

While the method achieves superior optimization and lower energy states, the authors note that lower energy did not automatically translate to higher accuracy in simple single-image segmentation. Furthermore, because the current code is unoptimized and runs on the CPU, it is significantly slower than highly optimized C++ implementations of mean-field filtering (74 seconds vs. 0.29 seconds for a single image).

The authors point out that the core bottlenecks—quasi-Newton updates and eigen-decompositions—are highly parallelizable. Transitioning the matrix-vector products to GPUs using CUDA libraries (like cublasSgemm) is highlighted as the immediate next step to unlock competitive real-time speeds.

Summary updated

BibTeX
@inproceedings{wang2015efficient,
  author = {Peng Wang and Chunhua Shen and Anton van den Hengel},
  title = {{Efficient SDP Inference for Fully-connected CRFs Based on Low-rank Decomposition}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2015},
  url = {https://openreview.net/forum?id=HyVepyGdWr},
}
Figure