than in a conventional neural network]{}. Therefore, a natural vision is to train BNNs on standard GPUs, and to use specialized ultra-efficient hardware only for inference.

$z^{[1]} \leftarrow  W^{[1]} \cdot X$ $a^{[1]} \leftarrow \operatorname{sign}(z^{[1]} - \mu^{[1]})$ $z^{[k]} \leftarrow \operatorname*{popcount}( \operatorname{XNOR}( W^{[k]}, a^{[k-1]}))$ $a^{[k]} \leftarrow \operatorname{sign}(z^{[k]} - \mu^{[k]})$ $z^{[L]} \leftarrow \operatorname*{popcount}( \operatorname{XNOR}( W^{[L]}, a^{[L-1]}))$ $output \leftarrow \operatorname{argmax}(z^{[L]} - \mu^{[L]}) $

In this work, we investigate how the first layer can be approximated by a stochastic input to decrease computing resources. This approach could also allow processing stochastic data for near sensor computing, which is a way to reduce considerably data transfer between sensors and data process. In addition, due to the possibility of implementing binarization from the first layer, the model can be completely generic with exactly the same architecture over the layers and allows reducing chip area.

Stochastic Computing
--------------------

Stochastic computing is an approximate computing paradigm, known since the early days of computing [@gaines1969stochastic; @alaghi2013survey]. [Nevertheless, hardware engineers have not exploited this computing scheme for processor design,as it requires applications that can be easily mapped with approximate computing. ]{} The principle is based on encoding [all data]{} as probabilities, represented as a temporal stochastic bitstreams: the number of ones 