Sample and Filter: Nonparametric Scene Parsing via Efficient Filtering

Mohammad Najafi, Sarah Taghavi Namin, Mathieu Salzmann, Lars Petersson

Introduction

Scene parsing, or semantic segmentation, is the task of assigning a categorical label to every pixel in an image. While parametric models like Convolutional Neural Networks (CNNs) dominate the field, they are often difficult to update with new data. Nonparametric methods offer a "lazy learning" alternative, transferring labels directly from a training library to a query image. Despite their flexibility, nonparametric approaches typically suffer from two major issues: the "rare class" problem, where infrequent objects are overlooked due to dataset imbalance, and extreme computational overhead when scaling to large datasets.

This paper introduces "Sample and Filter," a two-stage nonparametric approach that solves these challenges. By randomly sampling a balanced set of labeled superpixels and using high-dimensional Gaussian filtering for label transfer, the authors achieve state-of-the-art accuracy while being significantly faster than existing retrieval-based methods.

The "Sample and Filter" Framework

The authors propose a strategy to overcome the limitations of traditional nonparametric parsing through a combination of stochastic sampling and optimized signal processing.

Balanced Stochastic Sampling

Instead of the traditional approach of selecting only the top $K$ most similar images—which often excludes rare objects not present in the most visually similar scenes—this method ranks training images by similarity and then performs random sampling of superpixels. Crucially, the sampling is class-balanced, meaning an equal number of superpixels are drawn for each category. This stochasticity allows the model to maintain a "long tail" of information, significantly boosting per-class accuracy for rare objects like "fences" or "signs."

Efficient Filtering via Permutohedral Lattice

The core technical innovation lies in treating label transfer as a Gaussian filtering operation in a high-dimensional feature space. To make this computationally feasible, the authors utilize the permutohedral lattice data structure.

The three stages of Gaussian filtering on a permutohedral lattice: (a) Splatting, (b) Blurring, and (c) Slicing.

As shown in the figure above, the process involves three distinct steps:

  1. Splatting: Mapping the sampled training data (superpixels) onto the vertices of the lattice.
  2. Blurring: Performing a smoothing operation across the lattice to propagate label information.
  3. Slicing: Interpolating the filtered values back from the lattice to the query image's superpixels.

This approach reduces the complexity of label transfer from $O(N_s N_q)$ to $O(N_s + N_q)$, where $N_s$ and $N_q$ represent the number of sampled and query superpixels, respectively. This efficiency gain allows the system to process ten times more labeled data than previous methods without a speed penalty.

Experimental Evaluation

The method was benchmarked on the SIFTFlow dataset (2,688 images, 33 classes) and the massive LM-SUN dataset (45,676 images, 232 classes).

Key Results

  • Efficiency: On LM-SUN, "Sample and Filter" requires only 3.7 seconds per image, a nearly 4x speedup over the 13.1 seconds required by the "Superparsing" baseline.
  • Accuracy: The method achieved a per-class accuracy of 35.0% on SIFTFlow. Notably, the paper demonstrates that class balancing is critical; while per-pixel accuracy is often dominated by common classes like "sky," per-class accuracy better reflects the model's ability to identify diverse objects.
  • Scalability: The framework successfully handled approximately 367,000 superpixels per query, demonstrating its robustness for large-scale applications.
Qualitative comparison of scene parsing results. The top-left is the original image, followed by ground truth and various algorithmic outputs demonstrating the challenges of segmenting complex scenes.

Conclusion and Future Work

"Sample and Filter" demonstrates that nonparametric vision can be both accurate and highly scalable. By reframing label transfer as a signal processing problem and employing stochastic class balancing, the authors address the fundamental weaknesses of retrieval-based parsing. The main limitation remains the initial image ranking; if the global descriptors fail to retrieve semantically relevant images, the subsequent sampling is compromised. Future research into more robust image similarity metrics could further unlock the potential of this framework, which already shows a theoretical upper bound of 83.1% per-pixel accuracy with "ideal" ranking.

Summary updated

BibTeX
@inproceedings{najafi2016sample,
  author = {Mohammad Najafi and Sarah Taghavi Namin and Mathieu Salzmann and Lars Petersson},
  title = {{Sample and Filter: Nonparametric Scene Parsing via Efficient Filtering}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2016},
  doi = {10.1109/cvpr.2016.72},
}
Figure