Fractional Correspondence Framework in Detection Transformer

Masoumeh Zareapoor, Pourya Shamsolmoali, Huiyu Zhou, Yue Lu, Salvador García

TL;DR

This paper introduces the Regularized Transport Plan (RTP), a flexible matching framework for Detection Transformers (DETR) that replaces rigid one-to-one matching with soft, fractional assignments. By leveraging optimal transport theory and the differentiable Sinkhorn algorithm, RTP-DETR significantly accelerates training convergence and boosts detection accuracy—achieving an absolute gain of +1.7% mAP over DINO-DETR in just 12 epochs.

What Problem Does This Paper Address?

The Detection Transformer (DETR) revolutionized object detection by eliminating hand-crafted components like anchor boxes and non-maximum suppression (NMS). Central to its success is the Hungarian algorithm, which enforces a strict one-to-one matching between predicted bounding boxes and ground-truth objects during training.

However, this rigid binary assignment (either a perfect match or background) is a double-edged sword. It struggles to handle real-world complexities such as varying object densities, highly overlapping objects, or very small objects. Furthermore, this discrete matching strategy introduces optimization instability early in training, leading to notoriously slow convergence rates that require lengthy training schedules to overcome.

Methods

To inject flexibility into the matching process, the authors propose the Regularized Transport Plan (RTP), which re-frames bipartite matching as an Optimal Transport (OT) problem.

Instead of forcing a hard binary choice, RTP computes a continuous transport plan ($\Gamma$) where each element represents a fractional "degree of match" between a prediction and a ground truth. The core components of the method include:

  • KL-Divergence Relaxation: Standard OT strictly enforces mass conservation, which can lead to "over-splitting" (spreading matching weights too thin). The authors introduce Kullback-Leibler (KL) divergence penalties to relax these marginal constraints, making the framework robust to noisy assignments and discrepancies between the number of predictions and actual objects.
  • Entropic Regularization: By adding an entropy penalty to the optimization objective, the transport plan becomes smoother, allowing a single prediction to contribute fractionally to multiple ground truths (and vice versa).
  • Differentiable Sinkhorn Algorithm: Entropic regularization allows the model to solve the matching problem using the Sinkhorn algorithm. Unlike the Hungarian algorithm ($O(n^3)$ complexity), the Sinkhorn algorithm scales as $O(nm)$ per iteration and is highly parallelizable on GPUs.
  • Adaptive Parameter Scaling: Because scene complexity varies dynamically, the authors use an adaptive function to scale the entropy parameter based on the number of predictions ($\epsilon = \epsilon_0 / \log M$), preventing excessive regularization when the prediction count is high.
Figure 2: Cost matrix showing assignment weights (Γ𝑖𝑗) between predictions 𝑝1, 𝑝2, 𝑝3, 𝑝4, 𝑝5 (dashed colored lines) and ground- truth objects 𝑔1,𝑔2,𝑔3,𝑔4 (solid black lines) for different matching strategies: the hungarian algorithm, exact optimal transport (without entropy regularization), and regularized transport plan (RTP). The Hungarian algorithm enforces strict one-to-one assignments, treating excess predictions as background (bg). That means, for each ground-truth object, exactly one prediction is assigned, and all other predictions are ignored (0 in the matrix), and the excess predictions are treated as background (see 𝑝5 →𝑏𝑔). OT without entropy regularization tends to focus heavily on high-cost matches, thus providing hard (one-to-one) mapping; 𝑔2 is only matched to 𝑝2 while it overlapped with 𝑝3 as well. RTP uses entropy regularization to smooth assignments; each ground truth 𝑔𝑖connects to multiple 𝑝𝑖with weights distributed more evenly across the predictions; 𝑔4 has significant matches with 𝑝1 (0.75) and 𝑝5 (0.76). Unlike the Hungarian algorithm, which forces all predictions to be assigned (including to the background), OT can leave predictions unassigned if they lack a sufficiently low-cost match to any ground truth.

Datasets

The framework was trained and evaluated on two standard computer vision benchmarks:

  • MS-COCO (val2017): Consisting of over 118k training images and 5k validation images.
  • PASCAL-VOC: Fine-tuned on VOC trainval07+12 (~16.5k images) and evaluated on the test2007 set.

Key Insights and Ideas

  • Soft Prior over Hard Decisions: Forcing a network to choose exactly one bounding box when multiple overlapping predictions are equally valid creates conflicting gradients. Fractional matching stabilizes the learning signal by distributing probability mass across reasonable alternatives.
  • Algorithmic Speedups via Parallelization: While the Hungarian algorithm acts as a computational bottleneck on large-scale tasks, parallelizing the Sinkhorn algorithm on GPUs yields a ~40% speedup in the matching computation step during training.
  • Complementary to Existing Architectures: RTP is not a standalone model but a plug-and-play matching framework. It consistently improves performance when integrated into other advanced DETR variants like Deformable-DETR, Group-DETR, and DINO-DETR.

Key Results

RTP-DETR demonstrates superior accuracy and significantly faster convergence compared to traditional DETR variants:

  • Performance Boost: When using a ResNet-50 backbone on MS-COCO with a short 12-epoch schedule, RTP-DETR achieves 50.4% mAP, outperforming Deform-DETR by +3.8% and the state-of-the-art DINO-DETR baseline by +1.7%.
  • High-Threshold Accuracy: Notable improvements were observed in $AP_{75}$, demonstrating that soft matching helps the model output highly precise localizations.
  • Inference Efficiency: Despite the continuous optimization, RTP-DETR maintains a highly competitive inference speed of 23 FPS (compared to DINO-DETR's 25 FPS), proving that the accuracy gains incur negligible computational overhead.
Figure 1: Learning curves (AP) for RTP-DETR and other DETR variants using a ResNet-50 backbone across different training durations: 12 epochs (short) and 50 epochs (long). Even with fewer epochs, RTP-DETR reaches a higher (AP) compared to other models, indicating its faster convergence and overall superior performance throughout the training process. DETR shows the slowest growth and lowest overall performance, converging at ∼42 AP by epoch 50.

Limitations and Future Work

While the adaptive entropy scaling mitigates some hyperparameter sensitivity, the model still relies on manual tuning for the KL-divergence penalty weights ($\kappa_1, \kappa_2$) to balance precision and recall.

As a next step, the authors plan to extend this regularized optimal transport framework to zero-shot object detection. This direction will focus on developing transferable transport plans capable of generalizing across novel, unseen object categories and domains without requiring retraining.

Summary updated

BibTeX
@inproceedings{zareapoor2024fractional,
  author = {Masoumeh Zareapoor and Pourya Shamsolmoali and Huiyu Zhou and Yue Lu and Salvador García},
  title = {{Fractional Correspondence Framework in Detection Transformer}},
  booktitle = {ACM Multimedia},
  year = {2024},
  doi = {10.1145/3664647.3681613},
}
Figure