Unifying Feature and Cost Aggregation with Transformers for Semantic and Visual Correspondence

Sunghwan Hong, Seokju Cho, Seungryong Kim, Stephen Lin

TL;DR

UFC (Unified Feature and Cost Aggregation) is a novel Transformer-based framework that breaks the traditional wall between feature and cost aggregation in dense image matching. By allowing semantic features and geometric cost volumes to mutually refine one another through specialized attention mechanisms, UFC achieves state-of-the-art performance across both semantic and geometric correspondence benchmarks.

What Problem Does This Paper Address?

Finding "dense correspondences"—identifying where every pixel in a source image moves to in a target image—is a foundational task for computer vision applications ranging from augmented reality to autonomous navigation. Historically, researchers have approached this using two distinct, often isolated, strategies:

  1. Feature Aggregation: This involves refining the "descriptors" (the mathematical fingerprints of pixels) so that similar parts of an object (like a bird's wing) look similar across images. This is excellent for understanding what an object is, but it struggles with repetitive patterns or background clutter.
  2. Cost Aggregation: This focuses on smoothing out the "cost volume" (a 4D structure representing all possible matches) to ensure that neighboring pixels have coherent movement. This is great for geometric consistency but often lacks the semantic context needed to distinguish, for example, a bird's left claw from its right.
Comparison of traditional aggregation methods versus the proposed Integrative Aggregation.

The authors identify a critical missed opportunity: these two processes are almost always treated as separate, sequential steps. UFC aims to unify them, letting features guide the cost volume and vice versa, effectively harnessing the strengths of both techniques.

Methods

The core of the paper is the Unified Feature and Cost Aggregation Transformer (UFC). It employs two novel attention layers interleaved in a coarse-to-fine pyramidal structure to promote accurate correspondence estimation.

Detailed architecture of the Integrative Self-Attention and Cross-Attention modules.
  • Integrative Self-Attention: Instead of just looking at features, this layer concatenates the feature descriptors ($D$) and the cost volume ($C$). It uses independent value embeddings for each. This allows the features to "filter" noise out of the cost volume (semantic-aware filtering) while the cost volume encourages features to become more compatible for matching.
  • Cross-Attention with Matching Distribution: Here, the network uses the cost volume as a "sharpened matching distribution." It treats the cost volume essentially as an attention map to guide the alignment of features between the two images.
  • Dense Zoom-in Inference: To handle high-resolution images without exploding memory usage, the authors use a multi-scale strategy. They partition images into local windows, compute correspondences, and use a cycle-consistency confidence score to select the most reliable flow for every single pixel.

Key Insights and Ideas

  • The "Aha" Moment: The authors visualized that feature aggregation makes semantic parts (like legs or heads) consistent, while cost aggregation suppresses noise in the matching probability. By unifying them, the model learns "discerning" representations. For example, it can finally tell the difference between a left and right claw because the cost volume provides the geometric "where" to the features' semantic "what."
  • Cost as a Guide, Not Just an Output: In most models, the cost volume is the end goal. In UFC, the cost volume is an active participant in the attention mechanism, acting as a dynamic weight that tells the features where to look.
  • Mutual Disambiguation: Features help clean up noisy cost volumes (acting as a semantic "sanity check"), and the cost volume helps features align more precisely.

Key Results

The authors evaluated UFC on a wide range of challenging benchmarks, including semantic matching (SPair-71k, PF-PASCAL, PF-WILLOW) and geometric matching (HPatches, ETH3D). UFC consistently outperformed previous state-of-the-art (SOTA) models:

  • SPair-71k: On this highly difficult dataset featuring extreme viewpoint changes, UFC achieved a PCK (Percentage of Correct Keypoints) of 64.4% at $\alpha_{bbox}=0.1$, significantly outperforming the previous best of 59.8% (CATs++).
  • HPatches: In geometric matching, UFC reduced the Average Endpoint Error (AEPE) to 1.73, a massive improvement over the previous SOTA of 2.52 (ECO-TR).
  • Ablation Success: The authors proved that their "Integrative" approach (AEPE 26.2) was far superior to simply running feature aggregation followed by cost aggregation sequentially (AEPE 36.8).

Limitations and Future Work

While highly effective, the paper notes a few trade-offs:

  • Complexity vs. Speed: Increasing the number of attention layers and pyramidal levels boosts accuracy but increases computational overhead. The authors provide a speed-accuracy analysis to help users find the "sweet spot."
  • Inference Strategy: The "Dense Zoom-in" strategy is vital for high-res accuracy but adds a layer of complexity to the inference pipeline.
  • Future Directions: The authors suggest that this integrative approach could be further specialized for specific sub-fields like optical flow or real-time stereo depth estimation.

Summary updated

BibTeX
@inproceedings{hong2024unifying,
  author = {Sunghwan Hong and Seokju Cho and Seungryong Kim and Stephen Lin},
  title = {{Unifying Feature and Cost Aggregation with Transformers for Semantic and Visual Correspondence}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=fQHb1uZzl7},
}
Figure