0% found this document useful (0 votes)
57 views

Food Application

This document discusses using a MobileNetV2 CNN architecture with transfer learning to create a mobile app for food recognition and nutrition estimation. The authors collected a large dataset from multiple sources containing over 119,000 images in 190 food categories for training. They used transfer learning to fine-tune a MobileNetV2 model pre-trained on ImageNet. The model was integrated with the Edamam API to provide nutritional information. Testing showed the mobile and web interfaces could accurately identify foods and display nutrition facts to help users make informed dietary decisions.

Uploaded by

soufiane.bassa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views

Food Application

This document discusses using a MobileNetV2 CNN architecture with transfer learning to create a mobile app for food recognition and nutrition estimation. The authors collected a large dataset from multiple sources containing over 119,000 images in 190 food categories for training. They used transfer learning to fine-tune a MobileNetV2 model pre-trained on ImageNet. The model was integrated with the Edamam API to provide nutritional information. Testing showed the mobile and web interfaces could accurately identify foods and display nutrition facts to help users make informed dietary decisions.

Uploaded by

soufiane.bassa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

Food Recognition and Nutrition Estimation using

MobileNetV2 CNN architecture and Transfer


Learning
Authors: Presented by:
Karima Moumane
Soufiane Elbiki
Ikram EL Asri
Taoufiq Cheniguer
Soufiane Elbiki
THE 14TH INTERNATIONAL CONFERENCE ON
22-23 November, 2023
FSTM, University Hassan II, Casablanca, Morocco
PLAN
CHALLENGES

INTRODUCTION DATASET
&IMPORTANCE IN
OUR APP

MOBILENETV2 RESULTS

API Edamam
Introduction

This project suggests creating a mobile app that will assist


users in identifying food and providing a variety of
information about it. In order to train a convolutional neural
network model that can recognize 190 different foods.
Importance of our app

Knowing the nutritional components of foods can help a person


make informed decisions about their diet.

Can aid in weight management, help prevent nutrient deficiencies,


and reduce the risk of chronic diseases.

Understanding the balance of carbohydrates, proteins and fats


in different foods can also help a person plan a balanced and
healthy diet.
Data collection: Gathering a large and diverse dataset of images of meals
is a challenge. We need to ensure that the images are representative of
the types of meals people commonly eat, and that they cover a wide
range of variations in lighting, angle, and composition.

Image preprocessing: We need to preprocess the images to ensure that they


are consistent in size and format, and that they can be easily fed into our
machine learning model.
Use a convolutional neural network (CNN) to extract features from the
images.

Train our model on the dataset of images . We may need to experiment


with different architectures and hyperparameters to find the best model
for our application.
What is deep learning

Deep learning is a subset of machine learning that involves neural


networks with multiple layers (deep neural networks)
It aims to automatically learn hierarchical representations of data,
enabling the model to perform complex tasks, such as image and
speech recognition, natural language processing, and more.
What is transfer learning

Transfer learning is a machine learning technique where a model


trained on one task is adapted for a different but related task. By
leveraging knowledge
Pre-trained models, typically deep neural
networks trained on extensive data, offer
a head start for new models. They
leverage learned features to enhance
accuracy and reduce necessary training
data.
Transfer Learning methods, like fine-
tuning, feature extraction, and model
adaptation, enable further utilization of
these pre-trained models for new tasks.
Fine-tuning involves training on new data,
feature extraction uses learned features,
and model adaptation adjusts the pre-
trained model to suit the new task.
Transfer learning for Food detection

Transfer Learning has also been applied to food Recognition


tasks
[VijayaKumari et all ,2022] proposed a recognition model that uses Transfer
Learning techniques to categorize various food items into their appropriate
categories.
[Burkapalli et all, 2020 ] proposed an Inception-V3-based custom classification
approach for food images.

In this paper, we are creating a Mobilenetv2 model designed for the recognition and
detection of food items
while providing associated nutritional information
Technical architecture

MobileNetV2, a CNN architecture, excels in Transfer


Learning for tasks such as image classification, object
detection, and semantic segmentation. This process
involves leveraging pre-trained weights from
ImageNet, enabling efficient fine-tuning on new
datasets, bolstering its adaptability.
To train our model we have collected a big data set by combining
multiple sources :

The first dataset offered by tensorflow contains 101 food and each food contains
more than 100 food images for test and 50 for validation

The second dataset contains 150 category and each category contains 100 images
for testing and 50 for validation we finished by having 190 food category and 119
000 image file for training and 29785 for validation
Model and Tuning

After using Mobilenetv2 model for food


recognition a poor accuracy of 0.56 was
achieved due to several potential reasons
Final dataset

We took all the folders in each source and


we combine both of them in one data source
where we get in the end 119 104 Images
classified to 190 food in train. and 29 785
images for Validation .
Convolutional neural network

Why we chose MobileNetV2

MobileNet V2 is designed to be lightweight and efficient, making it well-suited for


running on mobile and embedded devices

MobileNet V2 has fewer parameters than many other models, which means it
takes up less memory
Adjustment the model

we changed the number of neurons in the dense layer. A larger


number of neurons can result in the layer having more capacity to
learn complex representations , and a ReLU activation function as part
of a TensorFlow Keras model.

We used a callback function to stop epoches when the model stops learning
and the accuracy is not increasing anymore.
API Edamam

The Edamam B2B API is accessed by


sending HTTPS requests on specific URLs
as described below. The base URL is
https://api.edamam.com, and you obtain
the full URL by appending request’s path
to the base URL, for example, https:
//api.edamam.com/api/fooddatabase/v2/p
arser.
RESULTS

This project used loss= categorical


crossentrophy, metrics=accuracy. The
number of epochs used is 6. The result
obtained is as shown in the figure .
Web interface testing
Mobile interface testing
Conclusion

We used a MobileNetV2 model for food detection. The model was


trained using a dataset of food images and integrated with a web
interface to display nutritional information. The project can assist
in identifying food and making informed decisions about diet.
Perspective of evolution

Reveals Allergenic Potential and Proposes Health Alternatives.

You might also like