Fast dynamic programming for labeling problems with ordering constraints

Junjie Bai, Qi Song, Olga Veksler, Xiaodong WuCVPR 2012

Abstract

This paper introduces a globally optimal dynamic programming (DP) algorithm for the "five-parts" image labeling problem, which partitions an image into left, right, top, bottom, and center regions. By exploiting the geometric structure of the problem, the authors achieve a time complexity of $O(N^{1.5})$ and a linear space complexity of $O(N)$, outperforming previous graph-cut methods that were prone to local minima. The algorithm guarantees a globally optimal solution and demonstrates remarkable stability in execution time across varying image complexities.

Introduction

Image labeling is a fundamental task in computer vision where each pixel is assigned a semantic label (e.g., "sky," "ground," "wall"). However, many real-world scenes possess inherent geometric structures that general labeling algorithms often ignore. For instance, in a typical indoor hallway, the ceiling (top) should logically never appear below the floor (bottom). This paper addresses the challenge of enforcing such ordering constraints efficiently to improve scene parsing accuracy.

The Five-Parts Labeling Model

The authors focus on the five-parts labeling model, which enforces specific spatial relationships:

  1. Geometric Positioning: Labels for Left, Right, Top, and Bottom must correspond to their respective geometric positions.
  2. Central Rectangle: The "Center" region is constrained to be a rectangle.
  3. Transition Constraints: Pixels labeled "Center" can only have specific neighbors (e.g., "Top" must be strictly above it).
The five-parts labeling model (a) and its application to a hallway scene (b).

Previous research often utilized graph-cut techniques like $\alpha$-expansion or "order-preserving moves" (OPM). While useful, these methods frequently converge to local minima and lack guarantees for global optimality. Other exact methods existed but were hampered by prohibitive memory requirements ($O(N^{1.5})$) or slow execution times.

Methodology

The core contribution is a dynamic programming approach that ensures global optimality. The algorithm hinges on several key observations and optimizations:

  • Rectangle Guessing: Since the center region is a rectangle, the algorithm iterates through potential boundaries. A naive search would be $O(N^3)$, but the authors optimize this to $O(N^{1.5})$ by batching computations.
  • Region Decomposition: Fixing the center rectangle divides the image into nine regions. Five have fixed labels (N, W, M, E, S), while the four corners (NW, NE, SW, SE) are treated as 2-labeling problems (e.g., deciding between "Left" and "Top" in the NW corner).
  • Shortest Path on DAGs: These corner problems are mapped to finding the shortest path in a Directed Acyclic Graph (DAG). Monotonicity constraints on the label boundaries allow the shortest path to efficiently find the optimal boundary.
  • Memory Efficiency: Unlike previous DP methods that required $O(N^{1.5})$ space, this algorithm only needs $O(N)$ space, making it practical for high-resolution images.

Experimental Evaluation

The algorithm was evaluated on a standard geometric class scene labeling task using 300 indoor images (640x480) and 42 outdoor images. Images were pre-processed into superpixels, and an SVM classifier was used to generate initial "data costs" (the likelihood of a pixel belonging to a specific label).

Key Results

The DP algorithm processed a 640x480 image in approximately 17 seconds on a CPU, significantly faster than existing parallelized CUDA implementations of competing methods which took up to 90 seconds. Notably, the execution time is highly predictable, with a standard deviation near zero regardless of image content—a major advantage over graph-cut methods whose performance varies with scene complexity.

Comparison of labeling results across different methods for indoor scenes.

In terms of accuracy, the DP method achieved results comparable to the OPM method (~85%) but proved far more robust in difficult scenarios, such as scenes with heavy occlusion. When Gaussian noise was added to cost images, the DP algorithm's performance remained stable, whereas OPM's performance deteriorated significantly.

Conclusion

The proposed DP algorithm demonstrates that global optimality is attainable for structured labeling problems without the prohibitive costs of previous exact methods. Its predictable performance, robustness to noise, and potential for parallelization make it a superior choice for geometric scene parsing. Future directions include full GPU implementation to achieve sub-second processing speeds.

Summary updated

BibTeX
@inproceedings{bai2012fast,
  author = {Junjie Bai and Qi Song and Olga Veksler and Xiaodong Wu},
  title = {{Fast dynamic programming for labeling problems with ordering constraints}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2012},
  doi = {10.1109/cvpr.2012.6247868},
}
Figure