GithubHelp home page GithubHelp logo

tariqshaban / disaster-classification-with-xai-server Goto Github PK

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

A RESTful API that embeds classification of an array of both natural and unnatural disasters, conducted on a previously compiled CNN network, utilizing Python

Procfile 0.79% Python 99.21%
cnn-keras fastapi rest-api

disaster-classification-with-xai-server's Introduction

Embedding a Disasters Image Classification Model into Restful APIs

This is a supplementary submission of final paper for the CIS726 course.

It contains the code necessary to host a local restful API that utilizes CNN model to predict incoming request values.

The model has the following hyperparameters:

  • 50 Epochs
  • Learning Rate of 0.001
  • Adam optimizer
  • ResNet50 has been selected as the pretrained model

The expected returned values are:

  • Lime image annotation in Base64 format
  • Grad-CAM image annotation in Base64 format
  • Grad-CAM++ image annotation in Base64 format
  • The predicted label

The weights of the model has been imported, rather than the whole architecture and configuration.

Due to hosting limitations, Lime num_samples attribute has been reduced from 1000 to 10 only.

Such hyperparameters returned the best results.

Getting Started

Clone the project from GitHub

$ git clone https://github.com/tariqshaban/disaster-classification-with-xai-server.git

It is encouraged to refer to FastAPI documentation.

You may need to configure the Python interpreter (depending on the used IDE).

You may encounter problem concerning CORS policy when the server is improperly hosted.

No further configuration is required.

Usage

Execute the uvicorn main:app command in the console, ensure that the port 8000 is not occupied, if need be, add the --port *YOUR_PORT* flag.

You can also issue direct API request using Heroku, example; Postman should be used for the image to be uploaded.


disaster-classification-with-xai-server's People

Contributors

tariqshaban 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.