Learning Proposals for Practical Energy-Based Regression

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

Abstract

Energy-based models (EBMs) have experienced a resurgence within machine learning in recent years, including as a promising alternative for probabilistic regression. However, energy-based regression requires a proposal distribution to be manually designed for training, and an initial estimate has to be provided at test-time. We address both of these issues by introducing a conceptually simple method to automatically learn an effective proposal distribution, which is parameterized by a separate network head. To this end, we derive a surprising result, leading to a unified training objective that jointly minimizes the KL divergence from the proposal to the EBM, and the negative log-likelihood of the EBM. At test-time, we can then employ importance sampling with the trained proposal to efficiently evaluate the learned EBM and produce stand-alone predictions. Furthermore, we utilize our derived training objective to learn mixture density networks (MDNs) with a jointly trained energy-based teacher, consistently outperforming conventional MDN training on four real-world regression tasks within computer vision.

Introduction

Energy-Based Models (EBMs) are highly flexible tools for probabilistic regression because they can represent complex, multi-modal distributions. However, they suffer from two major practical bottlenecks. First, training complexity: training an EBM typically requires approximating an intractable partition function, usually involving Monte Carlo sampling with a manually designed and tuned "proposal distribution." Second, test-time inefficiency: EBMs do not naturally produce predictions; obtaining a single value or sample typically requires an initial guess and iterative gradient-based refinement. This work aims to make EBMs practical by learning the proposal distribution automatically, enhancing training robustness and accelerating inference.

Methodology

The core innovation is the joint training of an EBM $p(y|x; \theta)$ and a Mixture Density Network (MDN) proposal $q(y|x; \phi)$.

Architecture

As illustrated in Figure 1, the model utilizes a shared feature extractor. One head calculates the energy function $f(x, y)$, while a second head (the MDN) predicts the parameters of a Gaussian mixture.

The proposed architecture: a shared backbone with an EBM head (green) and an MDN proposal head (blue).

Unified Training Objective

The authors derive a mathematical result showing that the gradient of the KL divergence between the EBM and the proposal can be approximated using the same importance weights used to train the EBM. This allows for a single, unified objective. Training employs Noise Contrastive Estimation (NCE), where the learned MDN acts as the "noise" distribution. This creates a symbiotic relationship: the MDN learns to mimic the EBM, and the EBM uses the MDN to improve accuracy.

Efficient Inference

At test-time, the MDN facilitates importance sampling. Instead of slow gradient refinement, samples are drawn from the MDN and weighted by the EBM to determine the mean or most likely prediction, enabling fast, standalone generation.

Experiments and Results

The method was evaluated on several regression tasks, including 1D toy datasets and real-world computer vision problems such as steering angle prediction, cell counting, age estimation, and head-pose estimation.

Visualizing Convergence

Figure 2 demonstrates how the EBM and the MDN proposal both converge toward the ground truth distribution over time, even when the underlying data is highly non-linear and multi-modal.

1D regression visualization: Comparison of Ground Truth, learned EBM, and MDN proposal distributions.

Key Findings

  • Automated Proposal Design: The learned proposal achieved performance competitive with, and often superior to, NCE models using hand-tuned Gaussian mixtures, eliminating the need for manual tuning.
  • EBM as a Teacher: A significant side-effect is the ability to train better standalone MDNs. By guiding an MDN with an EBM teacher, the MDN learns a more accurate distribution than when trained on ground-truth labels alone. This is attributed to the "dense" supervision provided by the EBM over the entire space.
  • Performance Gains: On the BIWI head-pose task, the EBM-guided MDN reduced Negative Log-Likelihood (NLL) from approximately 10.7 to 8.7.

Discussion

While effective for low-dimensional regression, the approach is not yet designed for high-dimensional generative tasks like image synthesis. Additionally, training two heads increases computational overhead, though the EBM can be discarded post-training if only the MDN is required for deployment. Future work includes exploring more complex proposal architectures, such as normalizing flows, and applying the EBM-teacher framework to broader regression domains.

Summary updated

BibTeX
@inproceedings{gustafsson2022learning,
  author = {Fredrik K. Gustafsson and Martin Danelljan and Thomas B. Schön},
  title = {{Learning Proposals for Practical Energy-Based Regression}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2022},
  url = {https://openreview.net/forum?id=UdVPqo1gKYy},
}
Figure