How to Train Your Energy-Based Model for Regression

Fredrik K. Gustafsson, Martin Danelljan, Radu Timofte, Thomas B. Schön

TL;DR

This paper introduces NCE+, a robust and sample-efficient training method for applying Energy-Based Models (EBMs) to regression tasks like object detection and visual tracking. By extending Noise Contrastive Estimation to account for annotation noise, the authors achieve state-of-the-art performance on major tracking benchmarks while overcoming the numerical instability common in traditional EBM training.

What Problem Does This Paper Address?

Energy-Based Models (EBMs) are powerful tools that represent probability densities directly through a scalar "energy" function. While they have flourished in generative image modeling, their application to regression—predicting continuous values like bounding box coordinates—is less explored.

The core challenge lies in the "partition function." To turn energy into a valid probability, you must divide by an integral over all possible outputs. This integral is usually intractable. Previous attempts at EBM regression relied on importance sampling to approximate this integral, but these methods are often numerically unstable and require a large number of samples to work effectively. The authors set out to find a "go-to" training method that is stable, efficient, and accurate for high-dimensional computer vision tasks.

Methods

The authors propose NCE+, an extension of Noise Contrastive Estimation (NCE).

  • Standard NCE: Instead of calculating the impossible integral, NCE treats training as a classification task: can the model distinguish the true data point from a set of random "noise" samples?
  • The "Plus" (NCE+): Real-world datasets often have noisy annotations. NCE+ accounts for this by perturbing the ground-truth label $y_i$ with a small amount of noise $\nu_i$. The model is then trained to discriminate this "noisy label" ($y_i + \nu_i$) from other noise samples.
NCE+ trains the model to distinguish a slightly perturbed label (yellow) from random noise samples (blue) relative to the ground truth (red).

The authors compared NCE+ against six other methods, including Maximum Likelihood with Importance Sampling (ML-IS), Score Matching (SM), and MCMC-based approaches.

Datasets

The study evaluates these methods across three distinct domains:

  1. 1D Regression: Synthetic datasets used for controlled analysis of how well models approximate ground-truth densities.
  2. Object Detection: The COCO 2017 dataset, focusing on refining bounding box predictions.
  3. Visual Tracking: Five major benchmarks: TrackingNet, LaSOT, UAV123, NFS, and OTB-100.

Key Insights and Ideas

  • Numerical Stability is King: Traditional methods like ML-IS and KLD-IS often fail (diverge) when the number of noise samples ($M$) is small. NCE and NCE+ remain stable even with a single noise sample, making them much more reliable for practical training.
  • Sample Efficiency: NCE+ reaches peak performance with significantly fewer samples than importance sampling methods. As shown in the figures below, NCE-based methods (purple/blue lines) outperform others at low sample counts.
  • Modeling Annotation Noise Matters: In real-world tasks like object detection, NCE+ consistently outperforms standard NCE because it explicitly acknowledges that the "ground truth" boxes in datasets aren't always perfect.
Comparison of $D_{KL}$ vs. number of samples $M$ for 1D regression. NCE+ (pink) is superior at low sample counts.
Figure 3: Detailed comparison of the top- performing methods for object detection, on the 2017 val split of COCO [32]. Missing values for ML-IS and KLD-IS correspond to failed training due to numerical issues.

Key Results

NCE+ emerged as the superior training method across the board:

  • Object Detection: On COCO 2017 test-dev, NCE+ achieved 39.7% AP, outperforming all other EBM training variants.
  • Visual Tracking: The authors' tracker, DiMP-NCE+, set new state-of-the-art records on all five tested datasets. Notably, it achieved 63.7% AUC on LaSOT and 78.7% Success on TrackingNet, while maintaining a real-time speed of 30 FPS.
Table 2: Quantitative comparison of training methods for object detection on COCO. NCE+ achieves the highest AP.

Limitations and Future Work

The primary limitation of NCE+ is the introduction of a new hyperparameter, $\beta$, which controls the scale of the annotation noise. While the authors provide a simple two-step procedure to tune this, it still adds a layer of complexity to the training pipeline.

For future work, the authors suggest exploring NCE+ in other high-dimensional regression tasks beyond bounding boxes, such as human pose estimation or depth prediction, where the expressive power of EBMs could be highly beneficial.

Summary updated

BibTeX
@inproceedings{gustafsson2020how,
  author = {Fredrik K. Gustafsson and Martin Danelljan and Radu Timofte and Thomas B. Schön},
  title = {{How to Train Your Energy-Based Model for Regression}},
  booktitle = {BMVC},
  year = {2020},
}
Figure