Data augmentation is a cornerstone of modern deep learning. By applying transformations like rotations, crops, or color jitters to a single image, we teach models to be invariant to irrelevant changes. However, while this works exceptionally well in practice, it creates a fundamental crisis for Bayesian inference.
In a standard Bayesian framework, we update our beliefs based on observed evidence. Data augmentation breaks this process by treating synthetic, perturbed versions of the same image as independent pieces of evidence. This leads to a mathematical "overcounting" of information that distorts the posterior distribution.
The Problem of Overcounting Information
The core of the issue lies in the independent and identically distributed (i.i.d.) assumption. Standard likelihood functions assume that each data point in a training set provides a fresh, independent piece of information about the world.
When we use data augmentation, we violate this assumption. As Ibrahim Merad, Stéphane Gaïffas, and colleagues point out in About contrastive unsupervised representation learning for classification and its convergence, these augmented "views" are highly correlated. If a model sees ten different rotations of the same cat, it hasn't actually seen ten different cats.
Seth Nabarro and Mark van der Wilk argue in Data augmentation in Bayesian neural networks and the cold posterior effect that treating these dependent samples as independent artificially inflates the likelihood. In Bayesian terms, this makes the model overconfident, as if it has seen much more data than it actually has.
Data Augmentation and the Cold Posterior Effect
This overcounting provides a compelling explanation for the Cold Posterior Effect (CPE)—the empirical observation that Bayesian Neural Networks (BNNs) perform better when their posteriors are artificially "sharpened" or "cooled" using a temperature parameter $T < 1$.
In How Tempering Fixes Data Augmentation in Bayesian Neural Networks, Gregor Bachmann and Thomas Hofmann demonstrate that tempering acts as a necessary correction for likelihood misspecification. Because data augmentation creates correlated errors across transformations, the "effective sample size" of the augmented dataset is much smaller than its nominal size. Tempering the posterior essentially scales the influence of the data back down to its true informational value.
Vincent Fortuin and Richard E. Turner further explore this in Bayesian Neural Network Priors Revisited, noting that this violation of independence is a primary reason why theoretically grounded posteriors often underperform compared to "cold" ones in computer vision tasks.
Moving Toward Principled Invariance
If "hacking" data augmentation into a BNN breaks the math, how can we achieve robustness more formally? Researchers have proposed several paths to bake invariances directly into the model structure rather than the data pipeline:
- Invariance in Kernels: Mark van der Wilk and James Hensman suggest using the marginal likelihood to learn symmetries. In Learning Invariances using the Marginal Likelihood, they show that by building symmetries directly into Gaussian Process kernels, the model can automatically discover which transformations it should ignore without needing synthetic data.
- Invariance in Priors: Eric Nalisnick and Padhraic Smyth propose encoding these requirements into the Bayesian prior itself. In Learning Priors for Invariance, they argue that this maintains theoretical consistency by updating beliefs based only on actual observed evidence, while still achieving the robustness typically granted by augmentation.
By shifting from "augmenting the data" to "constraining the model," these approaches aim to reconcile the undeniable power of invariant representations with the rigorous requirements of Bayesian probability.