Classifying images using deep CNNs
So far, we have seen that the traditional neural network predicts incorrectly for translated images. This needs to be addressed because, in real-world scenarios, various augmentations will need to be applied, such as translation and rotation, that were not seen during the training phase. In this section, we will understand how CNNs address the problem of incorrect predictions when image translation happens on images in the Fashion-MNIST dataset.
The preprocessing portion of the Fashion-MNIST dataset remains the same as in the previous chapter, except when we reshape (.view
) the input data, where instead of flattening the input to 28 x 28 = 784 dimensions, we reshape the input to a shape of (1,28,28) for each image (remember, channels are to be specified first, followed by their height and width, in PyTorch):
The following code can be found in the CNN_on_FashionMNIST.ipynb
file located in the Chapter04
folder on GitHub at https://bit...