Coder Social home page Coder Social logo

aryan-b / cookbook Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 154.3 MB

ML integrated dynamic web-app

Jupyter Notebook 27.86% Python 65.73% Shell 0.18% HTML 0.10% Java 2.72% CSS 1.13% JavaScript 1.23% Dockerfile 0.04% Kotlin 0.65% Batchfile 0.01% Objective-C 0.35% C 0.01%

cookbook's Introduction

Authors:

(Source: Final Report)

Aryan built the frontend web-app using ReactJS, remodeled it for android/ios display sizes, integrated spoonacular client with backend, automated cycling of API authentication keys, deployed the frontend on pm2 instance, created Cookbook service of the flask-app to be deployed on docker swarm containers and contributed for the flowcharts in the final report.

Jeremy created a machine learning model that was ultimately not picked for the final rendition of CookBook. He then focused on the secretarial side of things, such as the final report and the demo.

Ting created the final version of the machine learning model, embedded the trained model into Flask for the backend portion of the web app, completed both of the mobile apps, and helped explain her respective parts for the final report.

Rushil worked on an earlier implementation of the Android app and helped with the final report.

CookBook

It is a web and android app that takes in images of fruits and vegetables, uses a machine learning model to recognize them in the images, and then outputs various recipes that use them as ingredients. Users can either upload images from their computer, take an image straight from their camera, or type in the name of an ingredient. Each recipe’s anatomy can further be fetched to display the ingredients, instructions, prep time, serving size, wine-pairing, cuisine type and a link to the original source of the recipe.

Frontend :

The web app was created using ReactJS and various npm libraries. Most tasks have been automated using multiple asynchronous calls and await functions. The frontend has been deployed as a single pm2 instance on google cloud server.

The android app and ios app uses WebView and NSURLaddress respectively to load the URL address of the web app and change the display to be more mobile-friendly. The apps were created to enable the upload feature using camera

plot

Backend :

The backend has been implemented using Flask and is responsible for handling all the requests sent to it via the frontend. It listens on port 8080 and has 3 major functionalities — load the model.pht file and predict incoming images (:8080/recognise), create a spoonacular client instance to fetch lists of recipes using the ingredients (:8080/ingredients), and finally make a call to retrieve the complete info about a specific recipe (:8080/recipe).

The flask is deployed in multiple docker containers to parallelise the task. This was achieved using docker swarm handled by a manager node.

  • It can handle up to 10 simultaneous requests at once (current configured docker swarm as per optimal server configuration). This reduces the time to respond to concurrent API calls by 90%.
  • The downtime of our server was reduced by 99% in case of crashes or timeout error

plot plot

Machine Learning Model

We used MobileNetV2 as the architecture for the machine learning model. MobileNets are characterized by their fast inference since they are based on a streamlined architecture, using depth-wise separable convolutions to build light weight deep neural networks. MobileNetV2 features an inverted residual structure with a bottleneck between layers, which also removes non-linearities in the narrow layers. It also utilizes a novel framework known as SSDLite, which results in a prediction speed increase of up to 35% in comparison to previous versions.

We trained two separate implementations of a model on a dataset that consists of datasets from Kaggle (Fruits360, a dataset of images of fruits taken from all around it, and Fruit and Vegetable Image Recognition, a dataset include 36 species, each with around 100 images), and images from Bing Image Search(using bbid) and Google Image Search(using webdriver and selenium library).

plot



External Sources Credits : The images used on the webpages are for educational purposes only. Logos are self generated and most of the vectors,svg and gifs are free. Credits @ Google Images and various artistic creators

cookbook's People

Contributors

aryan-b avatar xwt981211 avatar jeremyng353 avatar rushp7 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.