Graph Matching for Shape Retrieval

Benoit Huet, Andrew D. J. Cross, Edwin R. HancockNeurIPS 1998

Abstract

This paper introduces a robust Bayesian framework for retrieving specific shapes from large image databases by representing them as graphs. By combining structural graph matching with "geometric histograms" that capture local spatial relationships, the authors achieve high retrieval accuracy even in the presence of significant image distortion and noise.

Introduction

While humans excel at recognizing shapes regardless of size, orientation, or slight deformations, computers struggle with this task—especially when searching through massive image databases. Traditional graph matching is a powerful tool for this because it analyzes the relationships between parts (e.g., how lines connect) rather than just raw pixels. However, graph matching has historically suffered from two major limitations:

  1. Computational Complexity: It is often too slow for data-mining across large libraries.
  2. Fragility: If an image is distorted (e.g., suffering from a "barrel" effect from a camera lens) or has missing parts, the graph structure breaks, causing the match to fail.

The authors aim to bridge this gap, elevating graph matching from a niche one-to-one comparison tool to a scalable one-to-many retrieval system.

Methodology

The authors represent shapes as Attributed Relational Graphs (ARGs). In their system, nodes represent line segments, and edges connect a segment to its six nearest neighbors.

The core innovation of their approach lies in how these nodes are described:

  • Geometric Histograms: Instead of recording absolute coordinates, the system creates a 2D histogram for every single line segment. This histogram tracks the relative angle and relative length of that segment compared to all others in the pattern. This makes the description "Euclidean invariant"—meaning it remains consistent even if the image is rotated, scaled, or translated.
  • Bhattacharyya Distance: This statistical measure is used to compare histograms. It essentially evaluates how much the "neighborhood" of a line in the query resembles the "neighborhood" of a line in the database.
  • Two-Step Bayesian Framework:
    1. Correspondence: The algorithm first finds the most likely node-to-node mapping (matching lines in Image A to lines in Image B) using a Maximum A Posteriori (MAP) approach.
  • Recognition: Once the optimal mapping is established, it calculates the overall probability that the two graphs represent the same object.

Experimental Setup

The researchers evaluated their system on a database of 2,500 line patterns, each containing over a hundred lines. The data was sourced from diverse and challenging domains:

  • Digital Maps: Utilized as the "query" shapes.
  • Aerial Infra-red Images: Serving as the "targets." Crucially, these images were taken at different altitudes and suffered from severe barrel distortions, meaning they did not perfectly match the geometry of the digital maps.
  • Trademarks and Logos: Added to the database to provide a large variety of non-matching shapes, rigorously testing the system's resistance to noise.

Key Insights and Results

The authors compared several strategies, ranging from simple attribute matching to their full persistent 2D histogram method, yielding several critical insights:

  • Persistence is Key: A major finding was that attributes (the histograms) should be used persistently. While many algorithms use attributes only to generate a starting guess and then rely solely on graph structure, this paper demonstrates that keeping attribute data involved throughout the entire iterative matching process leads to significantly higher accuracy.
  • Global Context in Local Nodes: By using histograms of all pairwise relationships for each node, every single node carries a "summary" of the entire shape's geometry. This makes the system incredibly robust; even if half the graph is missing, the remaining nodes retain the overall shape context.
  • Perfect Accuracy and High Efficiency: The "2D Histogram (Persistent)" strategy achieved a perfect 100% retrieval accuracy on their test set. Furthermore, the system was remarkably fast, typically converging on the correct match in just 3.12 iterations.
  • Robustness to Distortion: The system successfully retrieved aerial images significantly distorted by camera lenses, a scenario that would likely cause simpler geometric matching algorithms to fail.

Limitations and Future Directions

While the results are impressive, the authors acknowledge that the heavy lifting of graph matching remains computationally expensive. To handle the 2,500-image database, they employed a two-step pruning process:

  1. A global histogram was used to quickly filter the database down to the top 10% of candidates.
  2. Detailed graph matching was only performed on that refined 10% subset.

For future work, the authors suggest exploring Gestalt psychology principles to group line segments into more meaningful higher-level structures (like curves or closed loops) prior to matching. They also propose using Bayes decision trees to make the initial pruning step even more efficient, potentially allowing the system to scale to larger big data applications.

Summary updated

BibTeX
@inproceedings{huet1998graph,
  author = {Benoit Huet and Andrew D. J. Cross and Edwin R. Hancock},
  title = {{Graph Matching for Shape Retrieval}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {1998},
}
Figure