results in terms of area and energy consumption. Typically, the largest challenge is the implementation of the non-linear activation function within the stochastic computing framework.

In this article, we suggest that stochastic computing is particularly adapted to the case of binarized neural network, as they work so naturally with bitstreams, and as the activation function is replaced by a simple thresholding operation.

(topskip=0pt, botskip=0pt, midskip=0pt) \[scale = 0.25\][stock.png]{} [(a) In a conventional BNN, the first layer is not binarized. Grayscale input images are presented to the neural network. [ (b) In a stochastic computing-based BNN, binarized images are generated stochastically based on a grayscale image.]{} Several binarized versions of the same original image can be presented sequentially to the neural network, following the basic principle of stochastic computing. \[fig:stochprinciple\]]{}

Stochastic Computing-Based Binarized Neural Network {#sec:network}
===================================================

To evaluate [the stochastic computing approach]{}, we use the Fashion-MNIST dataset, which [has]{} the same format as MNIST, but presents grayscale images of fashion items [@xiao2017fashion], and constitutes a harder task. The canonical MNIST dataset would not be appropriate for this study, as it consists in images that are mostly black and white. As in the MNIST dataset, each image in Fashion-MNIST has 28x28 