Efficient inference for fully-connected CRFs with stationarity

Yimeng Zhang, Tsuhan ChenCVPR 2012

Abstract

This work addresses the computational bottleneck of fully connected Conditional Random Fields (CRFs) in image segmentation. By leveraging the assumption of spatial stationarity—where object relationships depend on relative rather than absolute positions—the authors transform the inference process into a series of convolutions. This allows for the application of Fast Fourier Transforms (FFT), reducing computational complexity from $O(N^2)$ to $O(N \log N)$. The resulting algorithm achieves state-of-the-art accuracy on standard benchmarks while reducing inference time from hours to seconds.

Introduction

In semantic image segmentation, the objective is to assign a categorical label to every pixel. While standard "grid CRFs" effectively smooth local noise by connecting immediate neighbors, they lack the global context necessary to model long-range spatial dependencies (e.g., "sky" typically appears above "road"). Fully connected CRFs offer a solution by modeling interactions between all pixel pairs, but their $O(N^2)$ complexity makes traditional inference methods like Belief Propagation computationally prohibitive for high-resolution images.

Methodology

The proposed approach maintains pixel-level resolution while achieving global connectivity through several key innovations:

Spatial Stationarity and FFT

The core contribution is the assumption of spatial stationarity: the spatial relationship between two labels depends only on their relative offset. Under this assumption, the message-passing step in CRF inference becomes a convolution. By utilizing the Fast Fourier Transform (FFT), these convolutions are computed in $O(N \log N)$ time.

Bilateral Filtering

To incorporate color contrast—ensuring similar colors receive similar labels—the authors adapt bilateral filtering techniques. By discretizing color values, they maintain sharp object boundaries without the need for exhaustive pairwise pixel comparisons.

Visualization of the inference process for the "Face" label, showing how spatial relations and message passing refine the initial probability maps.

As shown in Figure 6, the model iteratively refines label probabilities. Spatial relations act as filters that propagate "messages" across the image, allowing the model to correctly identify a "Face" based on its expected position relative to the "Body" and "Grass."

Experimental Results

The model was evaluated on the Sowerby-7 and MSRC-23 datasets, as well as synthetic noisy data.

Performance and Accuracy

On the MSRC-23 dataset, the proposed method achieved a global accuracy of 87.0%, significantly outperforming standard 4-neighbor grid CRFs (84.1%). Crucially, the inference time was reduced to under 3 seconds per image, a massive improvement over the hours required by standard Belief Propagation on a fully connected graph.

Qualitative comparison of segmentation results. (a) Original image. (b) Grid CRF results in fragmented labels like "sheep" and "road". (c) Previous state-of-the-art $P^n$+Co. (d) The proposed method correctly identifies the "face" and "body" layout.

Qualitative Analysis

Figure 1 demonstrates the model's ability to recover correct object layouts even when local unary potentials are ambiguous. While the grid CRF misidentifies parts of the child as "sheep" or "road," the proposed fully connected model uses global spatial context to correctly segment the "face" and "body."

Conclusion

By treating CRF inference as a signal processing problem, this research demonstrates that global context can be integrated at the pixel level without sacrificing computational efficiency. The "stationarity" prior proves to be a robust mechanism for guiding segmentation in complex scenes. Future work may explore non-stationary spatial relationships and joint learning of unary and edge potentials to further enhance performance.

Summary updated

BibTeX
@inproceedings{zhang2012efficient,
  author = {Yimeng Zhang and Tsuhan Chen},
  title = {{Efficient inference for fully-connected CRFs with stationarity}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2012},
  doi = {10.1109/cvpr.2012.6247724},
}
Figure