<p>This is not connected to Keras. The batch size, together with the learning rate, are critical hyper-parameters for training neural networks with mini-batch stochastic gradient descent (SGD), which entirely affect the learning dynamics and thus the accuracy, the learning speed, etc.</p>

<p>In a nutshell, SGD optimizes the weights of a neural network by iteratively updating them towards the (negative) direction of the gradient of the loss. In mini-batch SGD, the gradient is estimated at each iteration on a subset of the training data. It is a noisy estimation, which helps regularize the model and therefore the size of the batch matters a lot. Besides, the learning rate determines how much the weights are updated at each iteration. Finally, although this may not be obvious, the learning rate and the batch size are related to each other. <a href="https://arxiv.org/abs/1711.04623" rel="nofollow noreferrer">[paper]</a></p>
Why does different batch-sizes give different accuracy in Keras?
<p>I was using Keras' CNN to classify MNIST dataset. I found that using different batch-sizes gave different accuracies. Why is it so?  </p>

<p><a href="https://i.stack.imgur.com/Ad4oO.png" rel="nofollow noreferrer">Using Batch-size 1000</a> (Acc = 0.97600)</p>

<p><a href="https://i.stack.imgur.com/CRLd3.png" rel="nofollow noreferrer">Using Batch-size 10</a>  (Acc = 0.97599)</p>

<p>Although, the difference is very small, why is there even a difference?
<strong>EDIT - I have found that the difference is only because of precision issues and they are in fact equal.</strong></p>