MNIST: The 'Hello World' of Machine Learning Programming
The MNIST database of handwritten digits, has a training set of 60,000 examples, and a test set of 10,000 examples.
This is considered to be the Hello World of machine learning programming. That is, any learner's first machine learning model is ought to be the one that can tell the numeral digits by looking at their shape.
Here, I've used a pre-trained model to predict digits from 0 to 9 that you may draw on the canvas below.
Many thanks to Bob Hammell. For the front-end, I've built upon the code he has provided here.
Draw a single digit (0-9) in the box to the left, then click Predict.
A machine learning model trained against the MNIST character dataset will classify the image. Scores for each classification label are plotted below.
A Reason to Donate
The page has no or minimal advertisement. If you want to contribute towards keeping this website running, think about donating a small amount.
This helps in reducing the number of ads as well.
You can decide the amount on the payment page. Thanks!
An interesting thing that's happening here is that the model is getting served from TensorFlow Serving container. This is a convenient and efficient way of productionalizing models, i.e. for serving pre-trained models in production environment. The (docker) container is lightweight, and it doesn't even need to have TensorFlow installed. Just install tensorflow_model_server, copy your model into the docker image, and get a REST API that will give predicted results!
I've deliberately left the model not well-trained, so that for some cases it returns multiple results. This is just to get the feel of what's happening behind the scenes. You'll also get to see how by changing just a minute detail, the model classifies the shape to a different numeral. These are the things that we fine tune the model for, in production ready systems.
Finally, just to ease server load, I've used a little bit of request throttling in the background. Unless you are sending hundreds of predict requests per hour, this won't be visible to you.
This is an ongoing effort which means more chapters are being added and the current content is being enhanced wherever needed.
For attribution or use in other works, please cite this book as: Manisar, "Neural Networks - What's Happening? An Intuitive Introduction to Machine Learning", SKKN Press, 2020.