This repository contains a project realized as part of the Deep Learning exam of the Master's degree in Artificial Intelligence, University of Bologna.
The Food Recognition challenge is a competition hosted by AIcrowd, where participants should deal with an image segmentation problem aiming to recognize individual food items in each image.
The goal of this challenge is to train models which can look at images of food items and detect the individual food items present in them.
.
├── assets
│ └── img # Images used in the report
├── report # Documentation of the project in pdf format
├── data # Dataset used for training, validation and testing
│ ├── train
│ ├── val
│ └── test
├── src # Source files
│ ├── test_scripts # Test files used to verify the correctness of custom functions
│ ├── utils
│ │ └── segmentation_utils.py # Utility functions used into notebooks
│ ├── models # Contains the notebooks used for the training of each model
│ │ ├── model_A
│ │ ├── model_B
│ │ ├── model_C
│ │ └── model_D
│ └── EvalFoodRecognition.ipynb # Notebook used for the evaluation of all models
│
├── LICENSE
└── README.md
It is needed to install pycocotools to execute the notebooks.
You can get it from pip
or from the original repo
To install on Windows, you can use Anaconda environment and you must have the Visual C++ 2015 build tools:
- Clone the repo
- Create a new environment:
conda create -n deep
- Activate the environment:
activate deep
- Install requirements:
pip install -r requirements.txt
- inside PythonAPI folder, we can find
setup.py
file. Open the file and delete the following line:extra_compile_args=[‘-Wno-cpp’, ‘-Wno-unused-function’, ‘-std=c99’]
- run command
python setup.py build_ext install
- run command
python setup.py build_ext --inplace
The dataset for the AIcrowd Food Recognition Challenge is available at https://www.aicrowd.com/challenges/food-recognition-challenge/dataset_files
This dataset contains :
- train-v0.4.tar.gz : This is the Training Set of 24120 (as RGB images) food images, along with their corresponding 39328 annotations in MS-COCO format
- val-v0.4.tar.gz: This is the suggested Validation Set of 1269 (as RGB images) food images, along with their corresponding 2053 annotations in MS-COCO format
- test_images-v0.4.tar.gz : This is the debug Test Set for Round-3, where you are provided the same images as the validation set.
In order to evaluate results produced by different models there were used three metrics:
- IoU (Intersection Over Union)
- Precision
- Recall
For same categories the accuracy of the prediction is very high, instead other categories seems to be very hard to recognize.
The best model is the last (called Model D), and it works quite well also at runtime detecting food segmentations from a video with an acceptable frame rate.
- pycocotools API
- Tensorflow + Keras
We use Git for versioning.
Reg No. | Name | Surname | Username | |
---|---|---|---|---|
997317 | Giuseppe | Murro | giuseppe.murro@studio.unibo.it |
gmurro |
985203 | Salvatore | Pisciotta | salvatore.pisciotta2@studio.unibo.it |
SalvoPisciotta |
This project is licensed under the MIT License - see the LICENSE file for details