Variational Autoencoders as Generative Models with Keras MNIST dataset | Variational AutoEncoders and Image Generation with Keras Each image in the dataset is a 2D matrix representing pixel intensities ranging from 0 to 255. We will first normalize the pixel values (To bring them between 0 and 1) and then add an extra dimension for image channels (as supported by Conv2D layers from Keras).