Giter VIP home page Giter VIP logo

phani943 / food_cnn_classifier Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 56.49 MB

This repository contains the code for a Convolutional Neural Network (CNN) model designed to classify images of food items into one of five categories: pizza, burger, ice cream, samosa, and sushi. The model is implemented using TensorFlow and Keras and demonstrates a complete workflow from data preprocessing to model training and evaluation.

License: MIT License

Jupyter Notebook 100.00%

food_cnn_classifier's Introduction

Food CNN Classifier

This repository contains a convolutional neural network (CNN) model trained to classify images of different types of food, including pizza, burger, ice cream, samosa, and sushi. The model was developed with own architecture without using transfer learning.

Project Overview

The goal of this project is to gain proficiency in deep learning and computer vision techniques by building a model capable of accurately classifying food images into predefined categories. The model can be used for various applications, such as food recognition in restaurant menus, dietary analysis, or food recommendation systems.

Dataset

The dataset used for training was prepared by me and consists of approximately 2,000 images across five food categories: pizza, burger, ice cream, samosa, and sushi. The images were collected from various sources, including search engines, personal collections, and image scraping techniques. Each image was manually labeled with its corresponding food category to facilitate supervised learning.

The dataset underwent preprocessing steps, including resizing to a standard size of 256x256 pixels and normalization to ensure consistency and optimal training performance. Data augmentation techniques, such as random rotations, flips, and shifts, were also applied to augment the dataset and improve model robustness.

Model Architecture

The CNN architecture consists of multiple convolutional and pooling layers followed by fully connected layers for classification. The model utilizes rectified linear unit (ReLU) activation functions and softmax activation in the output layer. Dropout regularization is applied to prevent overfitting.

Training

The model was trained using the Adam optimizer with a categorical cross-entropy loss function. Training was performed for 50 epochs with early stopping based on validation accuracy and validation loss to prevent overfitting. The training process achieved a final training accuracy of approximately 78.2% and a validation accuracy of approximately 74.06%.

Usage

To use the trained model for inference, simply load the model weights and pass input images through the network. Some example are given in the notebook demonstrating how to load and use the model for classification is provided in the repository.

Repository Structure

  • data/: Contains the dataset used for training.
  • notebooks/: Contains notebook for training and inference.

Future Work

  • Fine-tune the model architecture and hyperparameters for improved performance.
  • Explore additional data augmentation techniques to enhance model robustness.
  • Investigate transfer learning approaches using pretrained models for feature extraction.

food_cnn_classifier's People

Contributors

phani943 avatar

Stargazers

 avatar

Watchers

 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.