Giter Site home page Giter Site logo

dimgag / deepfood Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 16.41 MB

Deep Food Image Recognition Project

License: MIT License

Jupyter Notebook 80.07% Python 19.93%
deep-learning machine-learning computer-vision efficientnetv2 food101 image-classification keras-tensorflow tensorflow

deepfood's Introduction

๐Ÿ• DeepFood ๐Ÿ

๐Ÿฅ– Multiclass Classification using Tensorflow on Food-101 Dataset ๐Ÿฅ

๐ŸŸ Download & Extract Food-101 Dataset ๐Ÿ”

!wget http://data.vision.ee.ethz.ch/cvl/food-101.tar.gz
!tar xzvf food-101.tar.gz

To split the dataset into Train and Test run the python/split_train_test.py in your terminal after selecting the desired directory.



๐ŸŒฏ Install requirements ๐ŸŒฎ

pip install -r requirements.txt



๐Ÿช Files Overview ๐Ÿฅ›

food-101 > images - Format of the Food-101 dataset and how to be splitted into Train and Test
         > meta
         > test
         > train 

models   > EfficientNetV2L          > assets
                                    > variables 
                                    > EfficiencyNetV2L.hdf5
                                    > EfficiencyNetV2L.log
                                    > kears_metadata.pb
                                    > saved_model.pb

         > EfficientNetV2S          > assets
                                    > variables 
                                    > EfficiencyNetV2S.hdf5
                                    > EfficiencyNetV2S.log
                                    > kears_metadata.pb
                                    > saved_model.pb

         > EfficientNetV2S_25Epochs > EfficiencyNetV2S.hdf5
                                    > EfficiencyNetV2S.log

python   > evaluate.py - Evaluate the model on the test set
         > main.py - Main script to run the model
         > models.py - Models definition + Fine Tuning
         > split_train_test.py - Create the data folders in DSRI persistent folder
         > train.py - Train the model
         > visualization.py - Visualize the model output
readme_images               - Images used in the README.md
test_images                 - images used for testing the model

vision_transformer     > vit_cifar100.py - Vision Transformer model definition
                       > vit.py - Vision Transformer model definition

DeepFood_Food101.ipynb          - Code Notebook with Models and Data
EfficientNetV2_Evaluation.ipynb - Code Notebook with Models and Data Evaluation
logs_analysis.ipynb             - Code Notebook with Logs Analysis
model_predictions.ipynb         - Code Notebook with Model Predictions

README.md                       - README
requirements.txt                - Requirements for the repository



โš™๏ธ Training Configuration โš™๏ธ

Number of Classes 101
Number of training samples 75750
Number of validation samples 25250
Input image dimensions (299, 299)
Batch size 32
Number of Epochs 100
Learning Rate 0.0001
Momentum 0.9
Optimizer Stochastic gradient descent
Loss Function Categorical crossentropy
Evaluation Metric Accuracy
GPU NVIDIA Tesla V100 SXM2 32 GB



๐Ÿš€ Models Results

Model Training Accuracy Validation Accuracy Training Loss Validation Loss # Parameters # Layers
EfficientNetV2-S 0.9129 0.8337 0.4350 0.7551 20.5M 516
EfficientNetV2-L 0.9411 0.8463 0.3394 0.7650 117.9M 1031



๐Ÿ“Š Visualization EfficientNetV2-S vs EfficientNetV2-L ๐Ÿ“ˆ

EffNetS_vs_EffNetL



๐Ÿฝ Predictions

EffNetS_vs_EffNetL



๐Ÿš€ Test the model

# Activate your python env with the requirement.txt
# Then Run 
python food_app.py



Future code to do

  • ViT for food recognition task
  • Test models on images with added noise (filters, rotations, etc).



๐Ÿบ Acknowledgements ๐Ÿป

deepfood's People

Contributors

dimgag avatar

Stargazers

 avatar  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.