Fast kernel learning for spatial pyramid matching

Junfeng He, Shih-Fu Chang, Lexing XieCVPR 2008

Abstract

Spatial pyramid matching (SPM) is a simple yet effective approach to compute similarity between images. Similarity kernels at different regions and scales are usually fused by some heuristic weights. In this paper, we develop a novel and fast approach to improve SPM by finding the optimal kernel fusing weights from multiple scales, locations, as well as codebooks. One unique contribution of our approach is the novel formulation of kernel matrix learning problem leading to an efficient quadratic programming solution, with much lower complexity than those associated with existing solutions (e.g., semidefinite programming). We demonstrate performance gains of the proposed methods by evaluations over well-known public data sets such as natural scenes and TRECVID 2007.

Introduction

Spatial Pyramid Matching (SPM) has become a cornerstone technique in computer vision for "Bag of Words" image representation. By dividing an image into increasingly fine grids (e.g., 1x1, 2x2, 4x4) and computing feature histograms for each cell, it captures spatial information often lost in global histograms. Traditionally, these cells are combined using fixed, heuristic weights—either treating every level equally or giving more weight to finer resolutions.

However, fixed weights ignore the fact that different regions carry varying levels of discriminative power depending on the task. For instance, in a "coast" vs. "open country" classification, the top of the image (sky) might be non-informative, while the bottom (water vs. grass) is crucial. This paper introduces Discriminative Spatial Pyramid Matching (DSPM), which automatically learns spatially adaptive weights using an efficient quadratic programming formulation, overcoming the computational bottlenecks of previous semidefinite programming (SDP) attempts.

Methodology

The core contribution is a novel formulation of the kernel matrix learning problem that aims to minimize the distance (Frobenius norm) between the combined image kernel ($K$) and an "ideal" label similarity matrix ($Y$).

  1. Quadratic Programming (QP) Solution: By constraining weights to be non-negative and sum to one, the learning task is transformed into a standard QP problem. With only a few dozen unknowns (e.g., 21 variables for a 3-level pyramid), this approach is significantly faster than SDP.
  2. Regularization: A regularization term ($\lambda ||u||^2$) is added to prevent overfitting, encouraging uniform weights unless the data strongly indicates specific regional importance.
  3. Multiple Codebooks: The framework allows for the simultaneous fusion of kernels from different spatial regions and feature types (e.g., SIFT, color, texture), enabling an "optimal fusion" of diverse descriptors.
Learned spatial weights visualized as heatmaps, showing how the model identifies discriminative regions for different scene categories.

Experimental Evaluation

The authors evaluated DSPM on two benchmarks: the Natural Scene Dataset (13 categories) and the challenging TRECVID 2007 concept detection task (36 concepts).

Key Insights

  • Spatial Context: The model successfully "discovered" important regions. For "Open Country" vs. "Forest," higher weights were automatically assigned to upper regions.
  • Contextual Boosting: Performance improved even for concepts without fixed layouts (e.g., "Car"). The model likely learns context, such as cars typically appearing on roads at the bottom of images.
  • Efficiency: The QP formulation makes kernel learning practical for real-world applications where SDP would be a bottleneck.

Performance Results

On the Natural Scene dataset, DSPM consistently outperformed heuristic SPM and SDP-based methods. In the TRECVID 2007 evaluation, the method increased Mean Average Precision (MAP) across all concepts by approximately 10% relatively. Significant boosts were observed in categories like "Building" (+26%), "Crowd" (+30%), and "TV-Screen" (+50%).

Average Precision comparison between standard SPM and the proposed DSPM method across various TRECVID concepts.

Conclusion and Future Work

DSPM provides a fast, scalable, and interpretable way to learn spatial importance in image classification. While effective, future work could address challenges like unbalanced training data, which can bias learned weights. Additionally, explicitly exploiting correlations between different concepts in multi-label datasets and further empirical investigation into multi-codebook fusion remain promising avenues for research.

Summary updated

BibTeX
@inproceedings{he2008fast,
  author = {Junfeng He and Shih-Fu Chang and Lexing Xie},
  title = {{Fast kernel learning for spatial pyramid matching}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2008},
  url = {https://openreview.net/forum?id=HyNpp1GObH},
}
Figure