Introduction
In modern deep learning, preventing overfitting typically relies on parameter-space regularization, such as weight decay ($L_2$ regularization). While effective at constraining the magnitude of weights, these methods are essentially "blind" to the actual predictive behavior of the model. They do not allow practitioners to encode specific preferences regarding the function the network learns, often resulting in models that are confidently incorrect when presented with out-of-distribution (OOD) data.
This paper introduces Function-Space Empirical Bayes (FS-EB), a mathematically grounded yet computationally efficient framework for regularizing neural networks. By specifying how predictive functions should behave on certain "context points," FS-EB achieves superior uncertainty calibration and OOD detection with minimal overhead compared to traditional Bayesian methods.
Methodology: Function-Space Empirical Bayes (FS-EB)
The core of FS-EB is a two-stage probabilistic approach that bridges the gap between simple parameter penalties and complex function-space methods like Gaussian Processes.
- The Auxiliary Problem: The user defines a set of "context points"—inputs where specific model behavior is desired. A simple stochastic linear model is used to define a "prior" distribution of functions over these points. This effectively says: "On these specific points, the neural network should behave like this simpler, well-behaved reference model."
- The Primary Problem: This functional prior is converted into an empirical prior over the neural network's parameters. During training, the standard loss function is augmented with a squared Mahalanobis distance term. This term penalizes the discrepancy between the network’s current predictions on context points and the desired prior behavior.
The resulting optimization objective combines parameter-space penalties (keeping weights small) with function-space penalties (ensuring sane output behavior). This approach is flexible enough to be used with both Maximum A Posteriori (MAP) estimation and Variational Inference (VI).
Visualizing Predictive Behavior
A key insight of FS-EB is the importance of where regularization occurs. By using context points that represent "not-my-data" (e.g., using KMNIST digits as context while training on FashionMNIST), the model learns to distinguish between known and unknown semantic space.
As shown in the visualization above, standard networks (PS-MAP) often maintain high confidence even far from the training data. In contrast, FS-EB forces the model's confidence to drop gracefully as inputs move into unexplored territory, leading to much more reliable uncertainty estimates.
Key Results and Robustness
The authors evaluated FS-EB across diverse benchmarks, including image classification (CIFAR-10, FashionMNIST) and real-world medical imaging tasks (blindness detection, skin cancer classification).
- OOD Detection: FS-EB achieved near-perfect results, with an AUROC of 99.9% on FashionMNIST (vs. KMNIST) and 99.4% on CIFAR-10 (vs. SVHN), significantly outperforming standard weight decay.
- Calibration: Expected Calibration Error (ECE) was nearly halved in many instances, dropping from 3.6% to 1.8% on FashionMNIST.
- Robustness to Corruption: The model's ability to maintain accuracy while properly signaling uncertainty is particularly evident under data corruption.
As illustrated in the corruption benchmarks, FS-EB consistently maintains higher selective accuracy than standard MAP. This indicates that when the model is allowed to "reject" low-confidence predictions (based on a threshold $\tau$), the remaining predictions are significantly more likely to be correct, even under heavy noise or blur.
Conclusion and Future Work
FS-EB provides a "plug-and-play" regularizer that is as easy to implement as a standard loss function but offers the principled benefits of Bayesian function-space modeling. While it introduces a roughly 3x computational overhead due to Jacobian calculations, it remains far more scalable than full Bayesian Neural Networks.
Future research may focus on automating the selection of "optimal" context points to better represent the boundaries of training distributions without requiring manual dataset selection. Nonetheless, FS-EB represents a significant step toward building neural networks that know what they don't know.
Summary updated