Introduction
Standard neural networks are often "wrong but confident," providing single-point predictions without quantifying uncertainty. This lack of reliability poses significant risks in safety-critical applications such as autonomous driving and medical diagnostics. Bayesian Neural Networks (BNNs) address this by providing a mathematical framework for uncertainty estimation. A popular implementation method is Monte Carlo Dropout (MCD), which involves multiple stochastic forward passes to generate a predictive distribution.
However, MCD is computationally demanding; running $S$ samples typically increases latency by a factor of $S$. Existing hardware accelerators for BNNs often struggle with modern, deep architectures like ResNet, being limited to simpler, shallow models. This paper introduces a high-performance FPGA-based accelerator designed to make Bayesian uncertainty estimation practical for complex deep learning tasks.
Hardware Architecture and Methods
The proposed solution centers on a versatile hardware architecture and several algorithmic optimizations to bridge the gap between BNN theory and efficient hardware implementation.
Neural Network Engine (NNE)
The core of the design is a Neural Network Engine (NNE) implemented on an Intel Arria 10 FPGA. The NNE supports standard operations—including convolutions, pooling, and residual connections—while integrating a dedicated Dropout Unit (DU) to facilitate stochastic inference.
Key Innovations
- On-the-fly Bernoulli Sampling: To avoid the memory bandwidth bottleneck of storing large random masks, the system uses Linear Feedback Shift Registers (LFSRs) to generate Bernoulli random variables at runtime.
- Intermediate-layer Caching (IC): Recognizing that not every layer needs to be Bayesian, the authors utilize "Partial BNNs." In this setup, initial layers act as a deterministic feature extractor. The accelerator caches the output of the last deterministic layer, re-computing only the subsequent Bayesian layers for each of the $S$ samples. This ensures that the computational cost of additional samples does not scale linearly with the entire network's depth.
- Automated Optimization Framework: A specialized tool maps user constraints (DSPs, memory) and accuracy requirements to the optimal hardware configuration, balancing parallelism and algorithmic parameters.
Experimental Evaluation
The framework was evaluated across several image classification benchmarks of increasing complexity:
- MNIST (LeNet-5)
- SVHN (VGG-11)
- CIFAR-10 (ResNet-18)
- ResNet-101, demonstrating scalability to much deeper architectures than previously supported by BNN hardware.
Results and Discussion
The proposed accelerator demonstrates significant improvements in both efficiency and speed:
- Compute Efficiency: Compared to state-of-the-art BNN accelerators like VIBNN and BYNQNet, this design achieves 9x better compute efficiency (measured in GOPs/s/DSP) and 4x higher energy efficiency.
- Throughput: For specific Bayesian configurations, the FPGA implementation with caching achieved up to a 15x speedup over a CPU and an 8x speedup over a GPU.
- Uncertainty Quality: The system effectively identifies out-of-distribution data. While standard NNs remain overconfident on noise, the BNN implementation correctly reflects high entropy and low confidence.
Conclusion
By combining intermediate-layer caching with a flexible FPGA architecture, this work makes Bayesian inference viable for modern deep learning models. Future work will explore higher-precision quantization schemes and Neural Architecture Search (NAS) to further optimize the trade-off between hardware performance and uncertainty estimation quality.
Summary updated