Abstract
Deep learning models often suffer from overfitting due to their high flexibility. While standard regularization techniques like weight decay provide point estimates via Maximum A Posteriori (MAP) estimation, they fail to capture the complex uncertainty of weight distributions. This paper introduces a novel approach using hypernetworks to implicitly estimate the posterior distribution of Convolutional Neural Network (CNN) weights. By training a hypernetwork to generate weights from a random noise source, the model learns a flexible, non-Gaussian distribution that serves as a powerful regularizer. Experimental results on CIFAR-10 and SVHN demonstrate that this method, combined with model averaging, significantly improves generalization over standard MAP baselines.
Introduction
The "richness" of deep learning models—their immense parameter space—is a double-edged sword. While it allows for learning complex functions, it also leads to memorization of training data. Traditional regularization methods, such as weight decay (L2 regularization) and dropout, are often heuristic. Bayesian Neural Networks (BNNs) offer a more principled approach by treating weights as distributions rather than fixed points. However, most BNNs rely on simple Gaussian priors that cannot capture the intricate correlations between weights in deep architectures.
Implicit Posterior Estimation via Hypernetworks
The researchers from Kobe University propose bypassing explicit mathematical definitions of weight distributions. Instead, they employ a hypernetwork $G(z; \theta)$ to generate the weights $w$ of a primary CNN $F(x; w)$.
By sampling a random noise vector $z$ from a distribution $p(z)$ and passing it through the hypernetwork, we obtain a set of weights $w = G(z; \theta)$. This defines an implicit distribution over the weights. During training, the hypernetwork parameters $\theta$ are optimized to minimize the expected loss over the generated weights, effectively performing a form of variational inference without restrictive parametric assumptions.
Strategies for Weight Generation
The authors explore two primary strategies for structuring the hypernetwork's output:
- All-in-one strategy: A single noise sample $z$ is used to generate all weights for the primary network. This enforces a global dependency across all layers.
- Block-wise strategy: Different noise samples $z_i$ are used for different residual blocks. This prevents excessive co-adaptation between blocks and often yields better performance in practice.
Model Averaging and Regularization
A key advantage of this approach is efficient model averaging. At test time, multiple weight sets can be sampled from the hypernetwork to create an ensemble of models "for free," as they all share the same hypernetwork parameters. This ensemble approach significantly boosts accuracy and provides a measure of predictive uncertainty. The choice of the input noise distribution $p(z)$ is critical; a standard Normal distribution $N(0,1)$ was found to provide more weight diversity than a Uniform distribution, leading to better gains from model averaging.
Results and Discussion
The method was evaluated on CIFAR-10, SVHN, and ImageNet. On CIFAR-10 using WideResNet-28-10, the hypernetwork approach achieved a 3.73% error rate, outperforming the 3.90% error of the MAP baseline. The block-wise strategy proved particularly effective when combined with model averaging, reducing error rates on WideResNet-28-4 from 4.70% to 4.03%.
However, challenges remain. Training a hypernetwork is computationally more expensive, roughly doubling the training time compared to standard CNNs. Furthermore, on ImageNet, the method showed slight underperformance, suggesting that for extremely large datasets, the primary network may be underfitting, making additional regularization less beneficial.
Conclusion
Hypernetwork-based implicit posterior estimation offers a scalable and flexible alternative to traditional BNNs. By learning complex weight correlations and enabling efficient model averaging, it provides a robust framework for regularizing large-scale CNNs. Future work will focus on optimizing training efficiency and balancing regularization strength for massive datasets.
Summary updated