Deep Graph Matching Under Quadratic Constraint

Quankai Gao, Fudong Wang, Nan Xue, Jin-Gang Yu, Gui-Song Xia

Abstract

Recently, deep learning based methods have demonstrated promising results on the graph matching problem, by relying on the descriptive capability of deep features extracted on graph nodes. However, one main limitation with existing deep graph matching (DGM) methods lies in their ignorance of explicit constraint of graph structures, which may lead the model to be trapped into local minimum in training. In this paper, we propose to explicitly formulate pairwise graph structures as a quadratic constraint incorporated into the DGM framework. The quadratic constraint minimizes the pairwise structural discrepancy between graphs, which can reduce the ambiguities brought by only using the extracted CNN features. Moreover, we present a differentiable implementation to the quadratic constrained-optimization such that it is compatible with the unconstrained deep learning optimizer. To give more precise and proper supervision, a well-designed false matching loss against class imbalance is proposed, which can better penalize the false negatives and false positives with less overfitting. Exhaustive experiments demonstrate that our method achieves competitive performance on real-world datasets. The code is available at: https://github.com/Zerg-Overmind/QC-DGM.

Introduction

Graph matching is the task of finding a one-to-one correspondence between nodes in two different graphs—for example, matching the "left headlight" node in a photo of a vintage car to the corresponding node in a modern car photo.

Graph matching involves finding correspondences between nodes across different images. Visual ambiguities can lead to incorrect matches (red lines).

Recent "Deep Graph Matching" (DGM) methods have relied heavily on powerful CNN features to identify nodes. However, they often ignore the explicit graph structure—the edges. If two nodes look visually similar but are positioned differently within their respective shapes, a feature-only model might incorrectly match them. Mathematically, this is often treated as a Quadratic Assignment Problem (QAP), which is notoriously NP-hard. Modern deep learning models often "relax" this problem, but in doing so, they lose the global structural consistency that classical methods provided.

Methodology

The authors propose a framework called QC-DGM (Deep Graph Matching under Quadratic Constraint) which consists of three main pillars:

  1. Quadratic Structural Constraint: They explicitly formulate the matching objective to minimize "adjacency discrepancy." This ensures that if two nodes are matched, their neighbors should also have a high probability of being matched, enforcing geometric coherence.
  2. Differentiable Frank-Wolfe Optimization: To make this structural constraint work with deep learning, they use a differentiable version of the Frank-Wolfe algorithm. This allows the model to "solve" the matching problem during the forward pass and backpropagate the errors to update the CNN and GCN weights.
  3. False Matching Loss (FM-Loss): In a matching matrix of $N \times N$ nodes, only $N$ entries are correct (matches) while $N^2 - N$ are zeros (non-matches). Standard cross-entropy loss struggles with this extreme class imbalance. The authors designed FM-Loss to specifically penalize false positives and false negatives more effectively, preventing the model from getting stuck in local minima or overfitting to the "background" of non-matches.

Experiments and Results

The model was evaluated on two standard computer vision benchmarks for graph matching: Pascal VOC with Berkeley Annotations and the Willow Object Class dataset.

Comparison of matching results. The top row (a) shows DGM without the quadratic constraint, leading to errors. The bottom row shows the proposed QC-DGM maintaining structural consistency.

Key Insights

  • Structure as a Regularizer: While CNN features are great for local description, the quadratic constraint acts as a global "sanity check," ensuring the overall geometry of the match makes sense.
  • Geometric Priors: Simply adding the 2D coordinates of nodes as a "unary geometric prior" significantly boosted performance, proving that spatial context is just as important as visual appearance.
  • State-of-the-Art Performance: On Pascal VOC, the method achieved an average accuracy of 70.3%, outperforming previous leaders like BB-GM (61.4%) and NGM (66.1%).
  • Robustness to Outliers: QC-DGM maintains much higher precision when "outlier" nodes (random points that don't have a match) are added, thanks to its structural consistency checks.

Conclusion

The QC-DGM framework demonstrates that classical structural constraints still provide significant value in the era of deep learning. By explicitly modeling pairwise structures and addressing class imbalance in matching matrices, the authors achieve superior robustness and accuracy. Future work will explore more general forms of quadratic constraints that can adapt to more diverse or noisy graph topologies.

Summary updated

BibTeX
@inproceedings{gao2021deep,
  author = {Quankai Gao and Fudong Wang and Nan Xue and Jin-Gang Yu and Gui-Song Xia},
  title = {{Deep Graph Matching Under Quadratic Constraint}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2021},
  url = {https://openreview.net/forum?id=2zGfejX4U1},
}
Figure