Application for Nutrition Assistant

 

1.     Introduction

This project is based on Fruits-Vegetable classification. It is a simple web application that every user can use it. User need to upload the Image of any fruit or vegetable. Our system will automatically classify the Image and it will give you the prediction about the name of fruit or vegetable, and now we have added one another module which will give you the calories of the predicted object. This is web application, so user can directly use it in any browser. So let’s see how project is working in the backend.

2.     Tools & Libraries

In this topic we are going to see about tools and libraries that I am using to develop the project.


No

Tools & Library Name

Usage

1

Keras

We are using for deep learning tasks like creating model, predicting the object etc.

2

Pillow

Pillow we are using for preprocessing the images of our dataset.

3

Streamit

It is backend framework for developing the web application.

4

Beautifulsoup, Requests

We are using it for scraping the calories from the internet for the predicted object.

5

Numpy

We are using it for the Image matrix handling.

3.     Architecture, Dataset & Workflow

v  Architecture: - We are using the MobilenetV2 architecture. MobileNetV2 is a convolutional neural network architecture that seeks to perform well on mobile devices. It is based on an inverted residual structure where the residual connections are between the bottleneck layers. Mobilenet support any input size greater than 32 x 32

è In MobileNetV2, there are two types of blocks. One is residual block with stride of another one is block with stride of 2 for downsizing.

è There are 3 layers for both types of blocks.

è This time, the first layer is 1×1 convolution with ReLU6.

è The second layer is the depth wise convolution.

è The third layer is another 1×1 convolution but without any non-linearity. It is claimed that if RELU is used again, the deep networks only have the power of a linear classifier on the non-zero volume part of the output domain.



 


Figure 1. MobilenetV2 Architecture

v  Dataset: - In this project we are using the “Fruit and Vegetable Image Recognition” dataset. This dataset have 36 classes, and almost 100 images for each class so we can say we have 3600+ training images. We have 10 images for each category in Train/Validation

v  Workflow: - In this we are going to see how our web-application is working. We have divided our modules so our task is going to be easy. Our frontend-backend will be handled by the Streamlit. As a normal user, user will visit our application by URL. There will be upload button so user can upload the image. After the uploading the Image our system will do the task automatically.

è User, will upload the Image. That image will be stored into the local system.

è Now pillow will resize the image according to our model shape, it will convert into vector.

è Now this vector will be passed to our model, our model will classify the class of category.

è We will get the ID of category, now we need to map the labels according to the ID.

è Now our system will do web-scrap the calories for predicted object. Our application will display the Result and Calories into our application.

 

4.     Code

Code is open source and published into GitHub with read-me file.

5.     Output

Some screenshots of our working application.







Conclusion Using Artificial Intelligence, Nutrition Assistant a web based application in which normal people can interact to match their own day to day nutritional needs in few inputs.

Post a Comment

0 Comments