presenting the background of the work (section \[sec:background\]), the paper describes the following contributions.]{}

-   [We show that this stochastic computing implementation of BNNs allows achieving high network performance in terms of recognition rate on the Fashion-MNIST and CIFAR-10 datasets. Stochastic BNN quickly approaches standard BNN performance when several stochastic binarized images are presented to the network. We also evidence that strategy for training stochastic computing BNNs should differ from the one used for conventional BNNs (section \[sec:network\]).]{}

-   [We design a full hardware ASIC in-memory BNN, which allows showing that the stochastic computing BNN strategy can save important area ($62\%$ on Fashion-MNIST) and energy (factor $2.1$ on Fashion-MNIST with an accuract reduction of $1.4\%$ with regards to a standard BNN (section \[sec:hardware\]). These numbers are discussed with regards to different alternative implementations.]{}

Background of the Work {#sec:background}
======================

Binarized Neural Networks
-------------------------

In this section, we first introduce the general principles of Binarized Neural Networks, an approach to considerably reduce the computation cost of inference in neural networks [@courbariaux2016binarized; @rastegari2016xnor]. In a conventional neural network with $L$ layers, the activation values of the neurons of layer $k$, $a^{[k]}_i$, are obtained by applying a non-linear activation function $f$ to the 