Scene Labeling Through Knowledge-Based Rules Employing Constrained Integer Linear Programing

Nasim Souly, Mubarak ShaharXiv 2016

Abstract

Scene labeling task is to segment the image into meaningful regions and categorize them into classes of objects which comprised the image. Commonly used methods typically find the local features for each segment and label them using classifiers. Afterward, labeling is smoothed in order to make sure that neighboring regions receive similar labels. However, they ignore expressive and non-local dependencies among regions due to expensive training and inference. In this paper, we propose to use high-level knowledge regarding rules in the inference to incorporate dependencies among regions in the image to improve scores of classification. Towards this aim, we extract these rules from data and transform them into constraints for Integer Programming to optimize the structured problem of assigning labels to super-pixels (consequently pixels) of an image. In addition, we propose to use soft-constraints in some scenarios, allowing violating the constraint by imposing a penalty, to make the model more flexible. We assessed our approach on three datasets and obtained promising results.

Introduction

Semantic segmentation, or scene labeling, involves assigning a semantic category to every pixel in an image. While modern classifiers excel at identifying local textures, they often lack a global understanding of scene structure, leading to physically impossible label assignments. For instance, a local classifier might misidentify a blue region at the bottom of an image as "sky" simply due to its color and texture, ignoring the spatial context that sky typically appears at the top.

Example of how rules correct local classification errors in a beach scene.

To address these shortcomings, traditional methods like Conditional Random Fields (CRFs) enforce local smoothness but struggle with long-range dependencies. This paper proposes a framework to inject high-level, "common-sense" knowledge—such as "sky is above the sea"—directly into the inference process using Integer Linear Programming (ILP).

Methodology

The proposed approach utilizes a multi-stage pipeline that integrates local features, global context, and data-driven logical rules.

The proposed pipeline combining local features, global context, and rule-based constraints.

1. Feature Extraction and Initial Classification

The image is first partitioned into "super-pixels." For each segment, local features including SIFT and color histograms are extracted. An Extreme Gradient Boosting (XGBoost) forest then generates initial probability scores for each possible label.

2. Global Context Integration

To refine the search space, a Places CNN identifies the overall scene category (e.g., "forest" vs. "city"). This global information helps suppress labels that are contextually inappropriate for the detected scene type.

3. Rule Extraction and Constraint Formulation

Rather than relying solely on manual heuristics, the authors extract rules from training data by analyzing frequent spatial and co-occurrence relationships. These are categorized into:

  • Geometrical Rules: Relative positioning (e.g., "sky" is above "field").
  • Mutual Exclusion: Labels that do not co-exist in the same scene.
  • Co-occurrence: Labels that frequently appear together (e.g., "balcony" and "building").

4. Optimization via Integer Linear Programming (ILP)

The final labeling is formulated as an optimization problem. The goal is to find the label assignment that maximizes the classifier scores across all super-pixels while satisfying the extracted rules. The framework supports soft constraints, where rule violations (e.g., sky reflected in water) are permitted but penalized based on their statistical likelihood in the training set. This optimization is efficiently solved using modern ILP solvers like Gurobi.

Experimental Results

The framework was evaluated on three benchmark datasets: SIFTflow, MSRCV2, and LMSun.

  • SIFTflow: The integration of global context and rules improved accuracy from a 72.8% baseline to 80.9%, outperforming several contemporary deep learning models.
  • MSRCV2: Per-pixel accuracy reached 84.4%, a significant jump from the 76.7% baseline.
  • Qualitative Analysis: Visual results demonstrate that the ILP framework effectively removes "impossible" label placements and produces cleaner, more semantically consistent boundaries compared to local classifiers.

Conclusion

This research demonstrates that incorporating high-level knowledge through ILP constraints significantly enhances scene labeling performance. By applying these rules during inference, the method avoids the need for expensive end-to-end retraining while providing a flexible mechanism to enforce global consistency. Future work may focus on improving the initial super-pixel segmentation and automating the discovery of more complex logical relationships.

Summary updated

BibTeX
@misc{souly2016scene,
  author = {Nasim Souly and Mubarak Shah},
  title = {{Scene Labeling Through Knowledge-Based Rules Employing Constrained Integer Linear Programing}},
  year = {2016},
  eprint = {1608.05104},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1608.05104},
}
Figure