Calibrated Reliable Regression using Maximum Mean Discrepancy

Peng Cui, Wenbo Hu, Jun Zhu

TL;DR

Deep neural networks are notorious for producing overconfident and poorly calibrated uncertainty estimates in regression tasks. This paper introduces an uncertainty calibration framework that minimizes the Maximum Mean Discrepancy (MMD) between true targets and predicted distributions. The resulting model yields well-calibrated, sharp prediction intervals across all confidence levels without requiring post-hoc recalibration or retraining.

What Problem Does This Paper Address?

While deep learning models achieve high accuracy on regression tasks, they frequently fail to reliably quantify predictive uncertainty. Instead, they produce over-confident intervals—meaning an intended 95% confidence interval might only cover 70% or 80% of real-world outcomes.

Existing calibration approaches suffer from notable trade-offs:

  • Post-processing methods (e.g., isotonic regression) require extra validation data and tend to overfit small datasets.
  • Interval-loss methods optimize for a single, fixed confidence level (e.g., only 95%), requiring the model to be entirely retrained if an analyst wants an 80% or 99% interval.
  • Bayesian and ensemble methods (like Deep Ensembles or Deep Gaussian Processes) are computationally heavy, especially as model complexity scales.

The authors set out to learn a predictive distribution that is intrinsically well-calibrated across the entire cumulative distribution function (CDF) in a single training framework.

Methods

The paper frames calibration as a distribution matching problem between the true target distribution $P$ and the predictive distribution $Q$.

  1. Base Model: The authors employ a Heteroscedastic Neural Network (HNN) that outputs both a predicted mean $\mu(x)$ and variance $\sigma^2(x)$ for each input $x$, assuming a Gaussian predictive distribution.
  2. Maximum Mean Discrepancy (MMD) Matching: To measure and minimize the distance between $P$ and $Q$ in a Reproducing Kernel Hilbert Space (RKHS), they use MMD with a mixture of RBF kernels spanning multiple bandwidths.
  3. Two-Stage Training:
  4. Stage 1 (Representation learning): Train the HNN by minimizing standard Gaussian negative log-likelihood (NLL).
  5. Stage 2 (Distribution calibration): Fine-tune the network parameters by minimizing the empirical MMD between the ground-truth targets $\{y_i\}$ and samples drawn from the predicted distribution $\{\hat{y}_i\}$.
  6. Theoretical Guarantee: Under the null hypothesis that $Q$ can approximate $P$, minimizing the MMD loss asymptotically drives the calibration error across all quantile levels $p \in [0, 1]$ to zero as sample size $N \to \infty$.

Datasets

The authors evaluated their approach on standard public benchmarks from the UCI Machine Learning Repository and Kaggle (no new benchmarks were introduced):

  • Time-Series Forecasting: Metro-traffic, Bike-sharing, Pickups, PM2.5, and Air-quality (modeled using a 2-layer LSTM with a sliding window of 5 steps to predict 1 step ahead).
  • Tabular Regression: Power Plant, Protein Structure, Naval Propulsion, and Wine (modeled using a 2-layer fully connected network with 256 units per hidden layer).

Key Insights and Ideas

  • Global quantile calibration via distribution matching: Instead of calibrating individual quantiles independently or relying on piecewise binning, aligning kernel embeddings forces the entire predictive distribution to match the true data distribution.
  • Decoupling accuracy and calibration: The two-stage training scheme allows the model first to capture input-target relationships via NLL, and then adjust its variance and dispersion via MMD without degrading base predictive power.
  • Inherent efficiency: Unlike methods using Gaussian Processes or large ensembles of models, this approach trains a single neural network with only one post-NLL optimization phase, drastically reducing memory and compute costs.

Key Results

The method was evaluated against baselines including MC-Dropout, deep ensembles, Deep Gaussian Processes (DGP), and post-hoc isotonic regression (ISR), tracking RMSE, Expected Coverage Probability Error (ECPE), and Maximum Coverage Probability Error (MCPE):

  • Consistently lower calibration error: Across all datasets, the proposed MMD method delivered the lowest ECPE and MCPE while keeping RMSE competitive:
  • On the Bike-sharing time-series task, the method achieved an ECPE of 0.006 (compared to 0.038 for Deep Ensembles and 0.042 for ISR) and an MCPE of 0.019 (compared to 0.066 for Deep Ensembles).
  • On the Wine regression dataset, ECPE dropped to 0.008 (compared to 0.012 for Deep Ensembles and 0.083 for ISR).
  • Sharpness: Qualitative and quantitative interval evaluations showed that the model’s 95% prediction intervals remained tight ("sharp") while faithfully covering ground-truth observations.
  • Computational scalability: On the Wine dataset, as the number of hidden layers grew from 1 to 6, the training time for DGP scaled substantially higher, whereas the proposed method retained low log runtime and maintained flat, minimal calibration error.

Limitations and Future Work

  • Gaussian Likelihood Assumption: The current formulation assumes a Gaussian distribution for the HNN output, which can be restrictive for multimodal or highly skewed target distributions (though mixture density networks could potentially resolve this).
  • Extension to Classification: Applying MMD distribution matching to classification remains non-trivial due to discrete label distributions, batch size sensitivity, and probability binning issues.
  • Finite-Sample Bounds: While the asymptotic calibration error converges to zero as $N \to \infty$, formal finite-sample convergence rates tailored to this two-stage calibration loss remain open for deeper theoretical investigation.

Summary updated

BibTeX
@inproceedings{cui2020calibrated,
  author = {Peng Cui and Wenbo Hu and Jun Zhu},
  title = {{Calibrated Reliable Regression using Maximum Mean Discrepancy}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2020},
  url = {https://openreview.net/forum?id=IeedzuzajE1},
}
Figure