Hello everyone, I’m trying to implement the full Image classification of the MNIST Dataset. I have gotten to the point where I have more than 2 images to label and do not which ones to label as zero or ones. Can someone kindly help me as to how I can label these 10 images? Thanks
So the MNIST classification explained in Chapter 4 is called a binary classification, and labelling them 1 or 0 works. This is because we are only trying to identify 2 classes (3 or 7). And identifying the one class (say 3) helps in identifying the other (7), and vice-versa. But when you want to classify images of all digits, 0 to 9, this strategy won’t help.
In this case, you can keep the labels 0 to 9, but what is important is to find some way that can associate a quantity to each of these labels for a given image, and then pick the one with the maximum quantity. For instance, if you have an image
im, there should be some way to do this:
[ 'P(0)': 0.01, 'P(1)': 0.02, 'P(2)': 0.8, 'P(3)': 0.01, 'P(4)': 0.01, 'P(5)': 0.01, 'P(6)': 0.03, 'P(7)': 0.0, 'P(8)': 0.1, 'P(9)': 0.01 ]
P(X) can be the probability for
im to be the number
X can be 0 to 9. In this case, the algorithm should pick
X=2 since it has the maximum probability. Also, note that
sum(P(X)) = 1.
If you are following the book this will be explained in (a better way in) the coming chapters.
Thanks a lot for the thorough explanation. One follow-up question though. would it be right to use sigmoid to squish the numbers of 0 to 9 so I can associate the output from the sigmoid as a label for the numbers?
Sigmoid can be useful but need not be directly applied to the labels as such.
Thanks a lot. This is a great eye opener