Deployment Prior Injection for Run-time Calibratable Object Detection

Mo Zhou, Yiding Yang, Haoxiang Li, Vishal M. Patel, Gang HuaarXiv 2024 · DOI · arXiv

TL;DR

Most object detectors are "frozen" after training, inheriting the biases of their training data. CaliDet introduces a framework that allows a detector to be calibrated at run-time by injecting a "deployment prior"—a graph of object relations. This enables adaptation to new environments or distribution shifts without retraining or fine-tuning.

The Problem: Fixed Contextual Biases

Object detectors learn more than just visual features; they learn context. For instance, a model seeing a "baseball glove" expects a "person" nearby because of the structure of training datasets like COCO. While beneficial when test data matches training data, this becomes a harmful bias when the environment changes.

Object relation changes and the advantage of calibratable detectors.

If a retail robot moves from a store where "Coke" and "Sprite" are adjacent to one where they are separated, its performance may drop. Currently, fixing this requires expensive data collection and fine-tuning. CaliDet addresses this by making detectors calibratable at run-time using an external prior.

Methodology: The CaliDet Framework

CaliDet treats contextual knowledge as an editable input rather than a fixed internal weight.

1. Graph Input and CaliFormer

The model accepts an image alongside a graph $\langle V, E \rangle$. Nodes ($V$) represent class embeddings, while edges ($E$) represent conditional probabilities $P(\text{class } i | \text{class } j)$. The CaliFormer, a lightweight modified Transformer encoder, uses these edge weights as a self-attention bias. This allows representations of highly related classes to interact more strongly.

The CaliDet architecture, featuring the CaliFormer module and weight injection mechanism.

2. Weight Injection and Training

CaliFormer produces "calibration vectors" ($V'$) that shift the classification weights in the detector's head: $\phi_c(h_m) = (W + \rho V')^T \cdot h_m + b$. This "re-biases" decision boundaries on the fly. To ensure the model utilizes the prior, the authors introduced the Logit Manipulation Loss (LoMa), which penalizes the model if it fails to improve when provided with a more accurate prior.

3. Self-Calibration

When a deployment prior is unavailable, an iterative algorithm allows the model to estimate local object relations from its own high-confidence predictions, effectively updating its own prior.

Evaluation and Results

The framework was evaluated on MS COCO 2017 and tested for cross-dataset generalization on Objects365.

  • Performance Gains: On COCO, injecting a perfect per-sample prior improved Average Precision (AP) from 49.07 to 51.94.
  • Cross-Dataset Adaptation: Moving from COCO to Objects365, CaliDet showed a clear performance jump by simply injecting the Objects365 prior, outperforming "flat" uninformed priors.
  • Efficiency: The CaliFormer module adds minimal overhead, increasing total inference time by only ~2% (1.37ms on an RTX A5000).

Key Insights

  • Disentanglement: By separating visual feature extraction from contextual reasoning, the model becomes "promptable."
  • Zero-Shot Adaptation: Accuracy can be improved in a frozen model simply by changing an input matrix, allowing for rapid adaptation to distribution shifts.
  • Asymmetric Relations: Using conditional probabilities captures realistic dependencies, such as a "wheel" being part of a "car" but not necessarily implying a car is the main subject.

Limitations

CaliDet's effectiveness is marginal in sparse scenes with single objects, as there are no relations to leverage. Additionally, while relations are editable, the class vocabulary remains tied to the training set. Finally, "Self-Calibration" depends on a baseline level of initial accuracy to generate reliable statistics.

Summary updated

Abstract

With a strong alignment between the training and test distributions, object relation as a context prior facilitates object detection. Yet, it turns into a harmful but inevitable training set bias upon test distributions that shift differently across space and time. Nevertheless, the existing detectors cannot incorporate deployment context prior during the test phase without parameter update. Such kind of capability requires the model to explicitly learn disentangled representations with respect to context prior. To achieve this, we introduce an additional graph input to the detector, where the graph represents the deployment context prior, and its edge values represent object relations. Then, the detector behavior is trained to bound to the graph with a modified training objective. As a result, during the test phase, any suitable deployment context prior can be injected into the detector via graph edits, hence calibrating, or "re-biasing" the detector towards the given prior at run-time without parameter update. Even if the deployment prior is unknown, the detector can self-calibrate using deployment prior approximated using its own predictions. Comprehensive experimental results on the COCO dataset, as well as cross-dataset testing on the Objects365 dataset, demonstrate the effectiveness of the run-time calibratable detector.
BibTeX
@misc{zhou2024deployment,
  author = {Mo Zhou and Yiding Yang and Haoxiang Li and Vishal M. Patel and Gang Hua},
  title = {{Deployment Prior Injection for Run-time Calibratable Object Detection}},
  year = {2024},
  eprint = {2402.17207},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2402.17207},
}
Figure