Food Image Detection Using CNN and Machine Learning
Machine Learning is used everywhere. From detecting lanes or detecting objects to real-time food detection, machine learning is the key player in every field nowadays. From tech giants to online shopping apps like Amazon, Flipkart or even music apps, machine learning is used almost in every aspect of today’s life.
As the name suggests, the main objective of this project is to detect food in real-time. We will be using CNN and deep learning to detect food images. Deep learning is very useful in image processing, whether it be lane detection, object detection or even food detection.
- Basic understanding of Machine Learning Algorithm.
- In-depth knowledge of Python programming language (preferable Python 3 or above)
- Understanding of CNN (Neural networks and deep learning)
What Is CNN?
CNN is used for image processing purpose. You can thing this as human neurons. These neurons take small input from the previous layer. There are many layers in a typical neural network and each layer passes through different filtering techniques. These filters are known as kernels.
Latest projects on Machine Learning
Want to develop practical skills on Machine Learning? Checkout our latest projects and start learning for free
- Collect data set. You have to collect different images of foods that will help to detect different types of foods in real-time.
- You can snap a picture of a meal and name the place from where the food belongs. You can do it on your own or can take help from the internet to collect data. You will tons of data available on the internet.
- You can take help of any food app that will help you to gather information about foods.
- Take as many images as possible. More the input, more accurate the detection is.
- Take most frequently ordered meals from the data set. In our case, the top 10 frequent items were rice, pizza, momo, rolls etc. Your data may differ from mine.
- Here we will use Local response normalization. Scale the data set in 80 X 80 format, however, python will crop this to 64 X 64 format.
- Divide the data set in some sets. We have taken 6 sets. Four will be used for training and rest two will be used for the test.
- Conduct 6-fold cross-validation. In our case, we got 70% accuracy when we used CNN.
- You shall use 2 step LRN because that will give you a more accurate result.
- Prepare three methods based on SVM recognition. Using colour histogram will help you to detect with better accuracy.
- Collect some images of non-food images too. That will help you to understand whether your model is able to detect foods and non-foods.
- Now the last step. Apply 10-fold cross-validation. While the baseline method gave us an almost 60% accuracy, this cross-validation will give you a 93% accuracy.
CNN is very effective in image processing. You can also get the desired result after 10 or 12 trials. More the trials, more accurate is the result.
Did you know
Skyfi Labs helps students learn practical skills by building real-world projects.
You can enrol with friends and receive kits at your doorstep
You can learn from experts, build working projects, showcase skills to the world and grab the best jobs.
Get started today!
Kit required to develop Food Image Detection Using CNN and Machine Learning :
Technologies you will learn by working on Food Image Detection Using CNN and Machine Learning :
Real Time food detection using machine learning