https://github.com/abhayy-kumar/food-image-classification
A deep learning technique that leverages transfer learning to classify images into different food categories.
https://github.com/abhayy-kumar/food-image-classification
deep-learning image-classification mobilenetv2 tensorflow trasfer-learning
Last synced: 3 months ago
JSON representation
A deep learning technique that leverages transfer learning to classify images into different food categories.
- Host: GitHub
- URL: https://github.com/abhayy-kumar/food-image-classification
- Owner: Abhayy-Kumar
- Created: 2025-03-21T05:18:17.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-21T05:22:12.000Z (over 1 year ago)
- Last Synced: 2025-06-02T00:29:35.922Z (about 1 year ago)
- Topics: deep-learning, image-classification, mobilenetv2, tensorflow, trasfer-learning
- Language: Jupyter Notebook
- Homepage:
- Size: 512 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Food Image Classification
This repository contains a deep learning project that classifies images of 101 different foods. The project utilizes a pretrained MobileNetV2 model from TensorFlow/Keras and fine-tunes it with additional dense layers to achieve accurate food category predictions.
## Overview
The objective of this project is to build an image classification system that identifies the food present in a given image. We employ a TensorFlow/Keras pretrained MobileNetV2 model, which is further fine-tuned with additional fully connected layers to classify images into 101 food categories. The project also includes steps for data preparation, train-test splitting, model training with early stopping, and evaluation using confusion matrices and classification reports.
## Features
- **Data Preparation:**
- Downloads the Food-41 dataset from Kaggle.
- Unzips and organizes images into a structured DataFrame.
- **Data Splitting & Augmentation:**
- Splits the dataset into training, validation, and testing sets.
- Uses TensorFlow's `ImageDataGenerator` with MobileNetV2 preprocessing.
- **Modeling & Transfer Learning:**
- Leverages MobileNetV2 as a feature extractor (with frozen weights).
- Adds two Dense layers and a softmax output layer to classify 101 food categories.
- **Training & Early Stopping:**
- Uses the Adam optimizer and categorical crossentropy loss.
- Incorporates early stopping to prevent overfitting.
- **Evaluation & Visualization:**
- Evaluates the model on a test set.
- Generates confusion matrices and classification reports.
- Visualizes the confusion matrix using Seaborn and Matplotlib.
### Dataset link - https://www.kaggle.com/datasets/kmader/food41