Hotdog not Hotdog!
December 6, 2017Demo -http://nothotdog.pythonanywhere.com/
Inspired from Silicon Valley tv show’s Entrepreneur in Residence Jiyan Yang’s app
Here is an image classifier - which reads an uploaded image to classify as a hotdog or a not hotdog
Demo - http://nothotdog.pythonanywhere.com/
Working
-
Thanks to google’s codelab demos of tensorflow for image classification link.
- I fetched images for two categories
- hotdog
- non hotdogs included various other images like - sandwiches, pizzas, salads, pasta, movie covers, wallpapers etc to cover wide variety of images.
- Tensorflow is used to retrain MobileNet with a concept called Transfer learning.
- MobileNets are optimized to be small and efficient, at the cost of some accuracy, when compared to other pre-trained models
- Transfer Learning, means starting with a model that has been already trained on another problem. Deep learning from scratch can take days, but transfer learning can be done in short order.
- Once model is ready, google has tricks to reduce the size of the model
- tf includes a tool called optimize_for_inference, that removes all nodes that aren’t needed for a given set of input and outputs.
- The script also does a few other optimizations that help speed up the model, such as merging explicit batch normalization operations into the convolutional weights to reduce the number of calculations.
- The second script called quantize_graph is available for optimization which quantizes the weight of the network allowing
-
List of all Pre-trained models one can use to build an image classifier depending on usage and compute available
- Demo hosted on
Google App EnginePythonAnywhere using Flask- Images extracted from google images using Fatkun Batch Download Image
Potential
- Product #1: With enough training size and compute strength - Anyone can extend this to create the See-food App/ Shazam for food
- Product #3: App can indicate food with possible allergens
Written on December 6, 2017