As we learned in Chapter 4, Representing Data and Engineering Features, there are a number of preprocessing steps we might like to apply here:
- Centering: It is important that all the digits are centered in the image. For example, take a look at all the example images of the digit 1 in the preceding diagram, which are all made of an almost-vertical strike. If the images were misaligned, the strike could lie anywhere in the image, making it hard for the neural network to find commonalities in the training samples. Fortunately, images in MNIST are already centered.
- Scaling: The same is true for scaling the digits so that they all have the same size. This way, the location of strikes, curves, and loops are important. ...