Discriminatively Trained Sparse Code Gradients for Contour Detection

Xiaofeng Ren, Liefeng BoNeurIPS 2012

Overview

This paper introduces Sparse Code Gradients (SCG), a method that replaces hand-designed image features with automatically learned patch representations for contour detection. By leveraging unsupervised sparse coding and a novel "double power transform," the authors achieved a new state-of-the-art on the BSDS500 benchmark and demonstrated that the approach easily adapts to new data types like RGB-D (depth) images.

The Challenge with Hand-Designed Features

Contour detection—identifying object boundaries and interior edges—is a cornerstone of computer vision, essential for tasks like image segmentation and object recognition. For over a decade, the field relied heavily on hand-designed features, most notably the Global Pb (gPb) operator. These traditional methods use manually crafted gradients based on histograms of color and "textons" (texture prototypes).

The challenge is that hand-designed features are limited by human intuition and often fail to capture the rich, high-dimensional nuances of natural images. Furthermore, when new sensors arrive (like the Kinect’s depth camera), researchers usually have to start over and design new features from scratch. This paper asks: Can we learn better features directly from the data instead of designing them by hand?

Methodology: The SCG Pipeline

The authors propose a pipeline that moves away from manual feature engineering toward unsupervised feature learning:

The Sparse Code Gradients (SCG) pipeline
  1. Sparse Coding: They use K-SVD to learn a "dictionary" of small image patches (5x5 pixels) and Orthogonal Matching Pursuit (OMP) to represent every pixel in an image as a sparse combination of these dictionary elements.
  2. Oriented Gradients: Instead of classifying patches directly, they follow the "Pb" philosophy by computing gradients. They look at oriented half-discs around a pixel and measure the difference between the sparse code distributions in each half.
  3. Multi-Scale Pooling: To capture both fine details and broad boundaries, they pool these sparse codes across four different spatial scales.
  4. Double Power Transform: This is a key technical contribution. Sparse codes are often distributed in a way that makes linear classification difficult. By applying two different power transforms (e.g., $x^{0.25}$ and $x^{0.75}$) and concatenating them, they "re-normalize" the data into a form that a linear Support Vector Machine (SVM) can classify efficiently.
  5. Globalization: Finally, they plug these learned local gradients into the existing gPb framework, which uses spectral grouping to ensure global contour consistency.

Key Insights

  • Richness over Reduction: Traditional methods "collapse" information into a single distance metric (like Chi-square) too early. SCG maintains a high-dimensional representation, allowing the SVM to learn complex interactions between different visual patterns and scales.
  • The Power of the "Double Power": The authors found that a single power transform is good, but a double power transform is much better. It allows the classifier to pick different linear combinations for different feature dimensions, making the high-dimensional sparse codes much more "linearly separable."
  • Learning is Universal: Because the features are learned, the system doesn't care if the input is grayscale, color, or depth. It simply learns a new dictionary for the new data type. This allowed them to outperform previous depth-based contour detectors without any manual "depth-feature" engineering.
Learned dictionaries across different modalities

Datasets and Results

The researchers evaluated their approach on several key computer vision benchmarks, including the BSDS500 (Berkeley Segmentation Dataset) and the NYU Depth Dataset (v2).

  • State-of-the-Art Performance: On the BSDS500 benchmark, SCG improved the F-measure (a balance of precision and recall) to 0.74, up from the 0.71 achieved by the previous gold standard, gPb.
  • Local vs. Global: Remarkably, the local version of SCG (0.72) outperformed the global version of the previous state-of-the-art (0.71), proving that better local features are more impactful than complex global optimization.
  • RGB-D Gains: On the NYU Depth Dataset, combining color and depth gradients led to a significant jump in accuracy (ODS F-measure of 0.62 compared to 0.53 for color alone), effectively picking up contours that are invisible in color but obvious in depth (like a white chair against a white wall).
  • Efficiency: Despite the high dimensionality, the system takes about 100 seconds per image on a single-thread CPU, which is comparable to the highly optimized C++ implementation of gPb.

Limitations and Future Work

While SCG represents a significant leap, the authors note a few areas for growth:

  • Computational Overhead: While comparable to gPb, 100 seconds per image is still slow for real-time applications.
  • Segmentation Gap: The paper focuses strictly on detecting contours. Turning those contours into high-quality closed regions (segmentation) is a related but distinct challenge that the authors did not fully address here.
  • Future Directions: The authors suggest that this "principled way" of learning representations could be extended to even more complex sensor data and deeper hierarchical models for scene understanding.

Summary updated

BibTeX
@inproceedings{ren2012discriminatively,
  author = {Xiaofeng Ren and Liefeng Bo},
  title = {{Discriminatively Trained Sparse Code Gradients for Contour Detection}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2012},
  url = {https://openreview.net/forum?id=HyZraubdWB},
}
Figure