Shape Context: A New Descriptor for Shape Matching and Object Recognition

Serge J. Belongie, Jitendra Malik, Jan Puzicha

TL;DR

This paper introduces the Shape Context, a powerful descriptor that captures the global distribution of points relative to a local reference. By representing shapes as sets of points and matching them using log-polar histograms and thin-plate splines, the authors achieved state-of-the-art recognition results on digits and 3D objects with remarkably little training data.

The Challenge of Object Recognition

In the early 2000s, object recognition often relied on treating images as high-dimensional vectors of pixel brightness. This approach is notoriously brittle: a slight shift, scale change, or rotation of an object completely alters the feature vector, requiring massive amounts of training data or complex preprocessing to compensate.

The authors argue that "shape" is a more fundamental property for recognition. However, defining a shape descriptor that is both discriminative (able to tell an 'A' from a 'B') and robust (ignoring minor deformations or noise) is difficult. Previous methods like Fourier descriptors or moments often collapsed a shape into too few numbers, losing critical detail, while others were restricted only to simple closed silhouettes.

Methods: The Shape Context Framework

The authors propose a three-step framework for shape matching that captures both local detail and global structure.

Shape context computation and matching process. (a, b) Sampled points on two shapes. (c) Log-polar bins. (d-f) Shape context histograms for specific points. (g) Resulting point correspondences.
  1. The Shape Context Descriptor: For any given shape, the system samples a discrete set of points from its contours. For each point $p_i$, it calculates the vectors to all other points in the set. These relative coordinates are then binned into a coarse histogram using a log-polar coordinate system. This histogram is the "shape context." Because it uses log-spacing, the descriptor is more sensitive to nearby points than distant ones, providing a rich local descriptor that still inherently contains global information.
  2. Point Correspondence: To compare two shapes, the algorithm finds the best one-to-one mapping between their point sets. This is treated as a bipartite matching problem, where the cost of matching point $i$ on the first shape to point $j$ on the second is the $\chi^2$ distance between their respective shape context histograms.
  3. Modeling Deformations: Once correspondences are found, the authors use Thin Plate Splines (TPS)—a flexible coordinate transformation—to "warp" one shape onto the other. This allows the system to account for non-rigid deformations, such as different handwriting styles. The final "Shape Distance" is a weighted sum of the matching costs, the appearance similarity, and the "bending energy" required to warp the shapes.

Key Insights and Advantages

  • Global Info in a Local Descriptor: Unlike traditional local features that only look at a tiny neighborhood, a single Shape Context "sees" the entire rest of the object, albeit at decreasing resolution. This makes the descriptor highly unique to each point.
  • Log-Polar Advantage: By binning points log-polarly, the descriptor is naturally invariant to translation and scaling (once normalized). It also mimics biological vision systems that prioritize central foveal detail over peripheral context.
  • The Power of Prototypes: Because the descriptor is so robust, the authors found they could achieve high accuracy using a simple Nearest Neighbor (K-NN) classifier. They even developed a $K$-medoids editing algorithm to automatically select the most representative "prototype" views of an object, significantly reducing the amount of data needed for 3D recognition.

Experimental Results

The paper evaluates the approach on two classic benchmarks, demonstrating impressive performance:

  • MNIST (Handwritten Digits): The method achieved a test error rate of 0.63% using 20,000 training examples. At the time of publication, this outperformed nearly all other techniques, including complex convolutional neural networks and boosted classifiers.
  • COIL-20 (3D Objects): The system achieved a 2.4% error rate using an average of only 4 views per 3D object. This demonstrated that the matching algorithm could generalize across significant viewpoint changes with very few examples.

Overall, the system proved highly effective at matching shapes despite translation, scaling, and moderate deformations without requiring specialized feature engineering for each case.

Limitations and Future Work

  • Computational Complexity: Solving the bipartite matching problem (the assignment problem) typically takes $O(N^3)$ time, which can be slow as the number of sampled points $N$ increases.
  • Rotation Invariance: While the basic descriptor is invariant to translation and scale, it is not inherently invariant to large rotations. The authors mention that modifications (like measuring angles relative to the local tangent) can provide rotation invariance, but it isn't the "default" behavior.
  • Occlusions and Outliers: While the use of "dummy nodes" in the matching process helps handle outliers, the paper notes that robustness to heavy occlusion was evaluated experimentally in follow-up work rather than being a theoretical guarantee of the core algorithm.

Summary updated

BibTeX
@inproceedings{belongie2000shape,
  author = {Serge J. Belongie and Jitendra Malik and Jan Puzicha},
  title = {{Shape Context: A New Descriptor for Shape Matching and Object Recognition}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2000},
}
Figure