TetsumichiUmada / food_app

identify food images with CNN

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Food image classification

Food image classifier built with Convolutional Neural Networks (CNN). Given an image of food, the algorithm will identify an estimate of the food item.

Dataset

We use Food-101 dataset published by Lukas Bossard, Matthieu Guillaumin, Luc Van Gool.

The dataset contains 101 food categories with 101,000 images. For each class, 250 manually reviewed test images are provided as well as 750 training images. The training images were not cleaned on purpose, and thus still contain some amount of noise.

The data is splitted into training and test data. We split the training set into a training and validation sets. We use thier test set to evaluate the model

Final Model

We use Inception v3 as a base model. It is pre-trained on ImageNet. AveragePooling2D and Dropout layers are added to reduce variance in the data and to avoid overfitting.

The model is trained for 16 epochs on Google Compute Engine with 1 GPU NVIDIA Tesla K80. It achieved 0.5419 training loss, 87.5% accuracy, and 96.875 % top-five accuracy.

Notebooks

  • 0_dataset.ipynb -- download the dataset and set-up data directories to train the model
  • 1_food_app.ipynb -- train the model and predict given food image

How to use?

Prerequisites

The project uses python3 from anaconda and packages such as Keras for deep learning (training and testing the model), OpenCV for loading iamges, and matplotlib for plotting graphs.

Getting Started

  1. Clone the repository and navigate to the downloaded folder.
git clone https://github.com/TetsumichiUmada/food_app.git
cd food_app
  1. Create an environemnt
conda env create -f environment.yml
  1. Open the notebooks.
jupyter notebook 

References

About

identify food images with CNN


Languages

Language:Jupyter Notebook 100.0%