Giter Site home page Giter Site logo

ismael-deka / food-classification-dl Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 30 KB

A Deep-Learning model for image classification of a set of 10 food items. It uses the ResNet-50 pre-trained on ImageNet database.

License: MIT License

Python 100.00%
pytorch torchvision torchvision-datasets torchvision-model resnet-50 resnet50 deep-learning imagenet

food-classification-dl's Introduction

Food Classification Deep-Learning Model

Introduction

This project is a deep learning model for image classification of a set of 10 food items. It uses the ResNet-50 pre-trained on ImageNet database.

Dataset

The dataset this model was trained on is composed of between 3000 images of a 10 standalone food items scraped from various sources (Pinterest, tumblr, reddit, etc). Each category is composed of 300 images to keep the dataset balanced. Categories of food included in this dataset are:

  • Cheeseburger
  • Cake
  • Cookie
  • Fries
  • Hotdog
  • Pizza
  • Salad
  • Shrimp
  • Steak
  • Sushi

The Image dataset is available for download here. Make sure to save the dataset folder in the same directory as train.py, and test.py

Requirements

This project requires the following packages:

  • PyTorch 2.0.0
  • TorchVision 0.15.1
  • Matplotlib 3.5.1
  • scikit-learn 1.1.2
  • Numpy 1.23.5

Results

After training the model for 10 epochs with a batch size of 32 and a learning rate of 0.001, we achieved an accuracy of 93.33% on the train set, 93.67% on the validation set, and 92.83% on the test set(as of 04/19/2023). Class-wise accuracies following test are as follows:

Class Accuracy
Burger 98.18%
Cake 81.48%
Cookie 95.31%
Fries 91.53%
Hotdog 95.31%
Pizza 89.36%
Salad 96.83%
Shrimp 90.91%
Steak 92.96%
Sushi 94.74%

Test Confusion Matrix

License

This project is licensed under the MIT License.

food-classification-dl's People

Contributors

ismael-deka avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.