Gradient descent batch clustering for image classification