BYNQNet: Bayesian Neural Network with Quadratic Activations for Sampling-Free Uncertainty Estimation on FPGA

Hiromitsu Awano1 and Masanori Hashimoto2
1Graduate School of Information Science and Technology, Osaka University 1-5 Yamadaoka, Suita, Osaka, 565–0871, Japan
awano@ist.osaka-u.ac.jp
2JST, PRESTO 4-1-8 Honcho, Kawaguchi, Saitama, 332-0012, Japan
hasimoto@ist.osaka-u.ac.jp

ABSTRACT


An efficient inference algorithm for Bayesian neural network (BNN) named BYNQNet, Bayesian neural network with quadratic activations, and its FPGA implementation are proposed. As neural networks find applications in mission critical systems, uncertainty estimations in network inference become increasingly important. BNN is a theoretically grounded solution to deal with uncertainty in neural network by treating network parameters as random variables. However, an inference in BNN involves Monte Carlo (MC) sampling, i.e., a stochastic forwarding is repeated N times with randomly sampled network parameters, which results in N times slower inference compared to non-Bayesian approach. Although recent papers proposed sampling-free algorithms for BNN inference, they still require evaluation of complex functions such as a cumulative distribution function (CDF) of Gaussian distribution for propagating uncertainties through nonlinear activation functions such as ReLU and Heaviside, which requires considerable amount of resources for hardware implementation. Contrary to conventional BNN, BYNQNet employs quadratic nonlinear activation functions and hence the uncertainty propagation can be achieved using only polynomial operations. Our numerical experiment reveals that BYNQNet has comparative accuracy with MC-based BNN which requires N=10 forwardings. We also demonstrate that BYNQNet implemented on Xilinx PYNQ-Z1 FPGA board achieves the throughput of 131×103 images per second and the energy efficiency of 44.7×103 images per joule, which corresponds to 4.07× and 8.99× improvements from the state-of-the-art MCbased BNN accelerator.



Full Text (PDF)