Giter Club home page Giter Club logo

sid321axn / malaria-detection-app Goto Github PK

View Code? Open in Web Editor NEW
13.0 4.0 9.0 6.73 MB

Web app for Malaria detection from the human blood sample images which is trained on National Library of Medicine dataset using Flask and Python.

Home Page: https://malaria-detection-app.herokuapp.com/

Python 0.08% CSS 0.03% JavaScript 0.05% HTML 0.10% Jupyter Notebook 99.74%
deep-neural-networks convolutional-neural-networks malaria-detection heroku-deployment heroku heroku-app

malaria-detection-app's Introduction

flask/gunicorn based Heroku web app for malaria detection


About the app

This repository was created to help clarify how to utilise flask and gunicorn to easily deploy a python/keras deep learning model as a web app on Heroku. This example features code for online deployment of a binary medical image classification model, based on convolutional neural network architecture. The CNN has three hidden layers and has been trained on the following malaria parasite image dataset National Library of Medicine. The trained model achieved accuracy of more than 95% on the test set and its weights have been saved in the Models folder (see file: my_model.h5) in the very useful HDF5 format. You may use your own saved trained model! Just make sure you put it in the Models folder and name it appropriately so that the flask app may call it.

A JavaScript app running on the browser calls the Flask app (app.py) to load the model weights and return results to the JavaScript app (through the 'GET' and 'POST' methods).

This app is currently live and can be found at: Malaria Detection App.

This web application has been created and the changes to whatManu Siddhartha had already prepared were the following:

  • Inclusion of a procfile to serve the app with gunicorn on the Heroku server after upload (for uploading this python app to Heroku please follow Heroku documentation on how to use git with Heroku)
  • As per Heroku requirements for stability and reproducibility, versions of all required python environments were specified in the requirements.txt file
  • Inclusion of gunicorn to the requirements.txt file
  • Changed the app.py (flask app) file to adapt it to the required functionality according to the trained binary image classification model. The program was also modified to delete every uploaded image after providing the prediction. This will prevent exceeding capacity limits on Heroku servers. The last lines of the file have been modified to work with gunicorn.
  • The Index.html and base.html files have been modified accordingly to include references and information about the model
  • This README file has been adapted to provide instructions about heroku deployment. The part for customisation has been modified also

To create a web app that runs locally follow instructions in the README file, to run the model locally. Gevent or gunicorn may be used for local deployment too.

Customization options

Use your own model

Place your trained keras deep learning model to the models directory.

Use other pre-trained model

See Keras applications for more available models such as DenseNet, MobilNet, NASNet, etc.

UI Modification

Modify files in templates and static directory.

index.html, base.html for the UI and main.js for all the behaviors

Deployment

To deploy it for public use, you need to upload this app on heroku or other python enabled server. However heroku is pretty good at recognising and running python apps. There is also a free version!

More resources

Check Siraj's "How to Deploy a Keras Model to Production" video. The corresponding repo.

Building a simple Keras + deep learning REST API.

How to deploy a Flask App to Heroku.

"# deep-learning-malaria-detection" "# malaria-detection-web-app"

malaria-detection-app's People

Contributors

sid321axn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

malaria-detection-app's Issues

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.