Food Image Detection Using CNN and Machine Learning

Published on . Written by

Real Time food detection using 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.


Skyfi Labs Projects
Objective:

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. 

Read more..

SLNOTE
Concepts Used:

  1. Basic understanding of Machine Learning Algorithm.
  2. In-depth knowledge of Python programming language (preferable Python 3 or above)
  3. 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. 


SLLATEST
Project Implementation:

  1. Collect data set. You have to collect different images of foods that will help to detect different types of foods in real-time. 
  2. 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.
  3. You can take help of any food app that will help you to gather information about foods.
  4. Take as many images as possible. More the input, more accurate the detection is. 
  5. 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.
  6. 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.
  7. 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. 
  8. Conduct 6-fold cross-validation. In our case, we got 70% accuracy when we used CNN.
  9. You shall use 2 step LRN because that will give you a more accurate result. 
  10. Prepare three methods based on SVM recognition. Using colour histogram will help you to detect with better accuracy.
  11. 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.
  12. 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. 
Conclusion:

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.


SLDYK
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 :


Any Questions?


Subscribe for more project ideas