Malaria-Detection-using-Keras

This project uses Keras to detect Malaria from Images. The model used is a ResNet50 which is trained from scratch. The images in this dataset is divided into to categories

How to use

  1. Clone the repository

    git clone https://github.com/iArunava/Malaria-Detection-using-Keras.git
  2. cd to the directory

    cd Malaria-Detection-using-Keras/
  3. Get some images to infer upon

    chmod u+x ./datasets/download.sh
    ./datasets/download.sh
  4. Find an image of your choice and infer!!

    python3 train_model.py -i ./path/to/image
  5. Can even infer on a set of images in datasets/cimages_test/

    python3 train_model.py -otb True
  6. To see all the options

    python3 train_model.py --help

7.Enjoy!!

Production

The model is deployed to production and you can use the model to test on your own images!!
The model is deployed using Zeit. Quite an amazing platform!
The live link to the deployed model can be found here: https://malaria-classifier.now.sh

The code that is used to deploy the model is open sourced and can be found here

A look into the deployed model on web

malaria model - deployed classifier

How to deploy your own models using this?

  1. Download node, now, now-cli

    sudo apt install npm
    sudo npm install -g now
  2. Get a direct download link to your model

  3. Set that link equal to model_file_url - which you can find here on app/server.py/L20

  4. Run

    now
  5. The site should be deployed now!!

  6. Use a custom name for your site

    export NAME='custom-site-name'
    now alias $NAME

    your site is now also accessible at custom-site-name.now.sh

  7. Keeping the deployment alive (as it goes to sleep after some time of inactivity)

    now scale custom-site-name.now.sh sfo 1
  8. Share the link with everyone and Enjoy!!

A few examples to visualize

dl_medical_imaging_malaria_dataset

References

  1. PyImageSearch - Deep Learning and Medical Image Analysis with Keras
  2. Pre-trained convolutional neural networks as feature extractors toward improved parasite detection in thin blood smear images.
  3. NIH - Malaria Dataset
  4. Carlos Atico Azira’s excellent write up
  5. Zeit Production from fast.ai

LICENSE

The code in this repository is distributed under the MIT License.
Feel free to fork and try it on your own!