Skip to content

Deep learning model designed to classify food images and provide recipes, ingredients, and preparation time

Notifications You must be signed in to change notification settings

SanshruthR/RecipeNet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

RecipeNet

Python PyTorch Hugging Face Recipe1M Ingredients 101 License: MIT

pic1 pic4 pic2 pic3

RecipeNet is a deep learning model designed to classify food images and provide recipes, ingredients, and preparation time based on the Recipe1M dataset. The project utilizes transfer learning techniques with EfficientNet-B0 as the base model.

Table of Contents

Introduction

RecipeNet leverages the Recipe1M, Recipe5K, and Ingredients 101 datasets to create a robust food classification and recipe retrieval system. By using EfficientNet-B0 for transfer learning, the model achieves high accuracy in classifying food images and retrieving relevant recipes and ingredients.

Datasets

Recipe1M

Recipe1M is a large-scale dataset containing over one million recipes and their corresponding images. The dataset is designed to facilitate the development of AI systems capable of understanding and generating cooking recipes. More details can be found in the Recipe1M paper.

Recipe5K

Recipe5K is another dataset used for food classification tasks, containing 5,000 images and their corresponding recipes. This dataset helps improve the generalization capabilities of the model. More details are available here.

Ingredients 101

Ingredients 101 is a dataset focused on recognizing food ingredients through multi-label learning. This dataset enhances the model's ability to identify specific ingredients in food images. More details can be found in the Ingredients 101 paper.

Model Architecture

RecipeNet is built using EfficientNet-B0, a state-of-the-art convolutional neural network. The model architecture includes:

  • EfficientNet-B0 backbone pre-trained on ImageNet.
  • Custom classifier with a dropout layer and a fully connected layer.
  • Custom heads for ingredient prediction.

Model Layers

  • Input Layer: Image input of size (224, 224, 3).
  • EfficientNet-B0 Backbone: Feature extraction layers.
  • Dropout Layer: Dropout probability of 0.2.
  • Fully Connected Layer: 1280 input features and 101 output features for food categories.
  • Heads: Linear layer with 768 input features and 101 output features for ingredient classification.

Parameters

  • Optimizer: Adam
  • Learning Rate: 1e-4
  • Loss Function: Cross-Entropy Loss
  • Epochs: 50
  • Batch Size: 32

Training

The model was trained on a combination of the Recipe1M, Recipe5K, and Ingredients 101 datasets. The training process included data augmentation, learning rate scheduling, and early stopping to prevent overfitting.

Results

RecipeNet achieved high accuracy on the test set, demonstrating its effectiveness in food classification and recipe retrieval tasks. The model can predict the food category, preparation time, ingredients, and provide a link to the recipe.

Usage

To use RecipeNet, visit the following links:

References

About

Deep learning model designed to classify food images and provide recipes, ingredients, and preparation time

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published