# Bayesian Neural Networks With Maximum Mean Discrepancy Regularization

arXiv: https://arxiv.org/abs/2003.00952 · HTML: https://mlsanity.com/paper/2003.00952/

## Key facts

- Cited by 6 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 2 Mar 2020.

## Built on by (most cited first, 6 of 6)

- [Learning Robust Statistics for Simulation-based Inference under Model Misspecification](https://mlsanity.com/paper/2305.15871/) (2023)
- [Structured Ensembles: an Approach to Reduce the Memory Footprint of Ensemble Methods](https://mlsanity.com/paper/2105.02551/) (2021)
- [Learning to solve Bayesian inverse problems: An amortized variational inference approach using Gaussian and Flow guides](https://mlsanity.com/paper/2305.20004/) (2023)
- [Ensemble-based Hybrid Optimization of Bayesian Neural Networks and Traditional Machine Learning Algorithms](https://mlsanity.com/paper/2310.05456/) (2023)
- [Variational Inference for Quantum HyperNetworks](https://mlsanity.com/paper/2506.05888/) (2025)
- [Domain-Shift Aware Neural Networks for Unbalance Characterization in Rotating Systems](https://mlsanity.com/paper/2606.18882/) (2026)

## Abstract (arXiv)

Bayesian Neural Networks (BNNs) are trained to optimize an entire distribution over their weights instead of a single set, having significant advantages in terms of, e.g., interpretability, multi-task learning, and calibration. Because of the intractability of the resulting optimization problem, most BNNs are either sampled through Monte Carlo methods, or trained by minimizing a suitable Evidence Lower BOund (ELBO) on a variational approximation. In this paper, we propose a variant of the latter, wherein we replace the Kullback-Leibler divergence in the ELBO term with a Maximum Mean Discrepancy (MMD) estimator, inspired by recent work in variational inference. After motivating our proposal based on the properties of the MMD term, we proceed to show a number of empirical advantages of the proposed formulation over the state-of-the-art. In particular, our BNNs achieve higher accuracy on multiple benchmarks, including several image classification tasks. In addition, they are more robust to the selection of a prior over the weights, and they are better calibrated. As a second contribution, we provide a new formulation for estimating the uncertainty on a given prediction, showing it performs in a more robust fashion against adversarial attacks and the injection of noise over their inputs, compared to more classical criteria such as the differential entropy.
