Skip to content

This repository contains the dataset and the source code for the classification of Indian food categories from meal images using a CNN trained model and tensorflow

License

Notifications You must be signed in to change notification settings

gnpaone/Indian-food-classification

Repository files navigation

Indian-Food-Classification

Table of Contents

About

Indian food dataset is a labelled data set with different food classes. Each food class contains 1000s of images. Using the data provided, a deep learning model built on TensorFlow is trained to classify into various classes in dataset.


Epoches: 200
Batch_size: 32

Images are split to train and test set with 4020 images belonging to 80 different classes.

Exploratory Data Analysis

Let's preview some of the images.

The size of the images are inconsistent, so all the images are scaled to same size, so we dont have to worry about inconsistency.

Model

To create a convolution neural network to classfied the images, Sequential model is used.

model = models.Sequential([
    resize_and_rescale,
    data_augmentation,
    layers.Conv2D(32,(3,3),activation = 'relu',input_shape = input_shape),
    layers.MaxPooling2D((2,2)),
    layers.Conv2D(64,(3,3),activation = 'relu'),
    layers.MaxPooling2D((2,2)),
    layers.Conv2D(64,(3,3),activation = 'relu'),
    layers.MaxPooling2D((2,2)),
    layers.Conv2D(128,(3,3),activation = 'relu'),
    layers.MaxPooling2D((2,2)),
    layers.Flatten(),
    layers.Dense(256,activation = 'relu'),
    layers.Dense(n_classes,activation = 'softmax'),
])

Training

Model accuracy increased over each epoch, overfitting started at around 40 epochs. The model achieved validation accuracy of 92.94% with a 0.2418 cross entropy validation loss.

Results Evaluation

Preview some predictions from the model:

First Image to Predict:

Actual Label: imarti

Predicted Label: imarti

Now, let's examine in more detail how the model performs and evaluate those predictions.

Conclusion

With the given data sets for 80 classes of Indian food, the model final accuracy reached 92.94% with cross entropy validation loss of 0.2418.

Reference

Indian food Dataset

⭐ Please consider starring this repository if it helped you! ⭐

About

This repository contains the dataset and the source code for the classification of Indian food categories from meal images using a CNN trained model and tensorflow

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published