Giter VIP home page Giter VIP logo

pneumonia-image-classification's Introduction

Explainable-AI

Computer Vision classification for medical baterical and viruses

Folder Structure

.
├── conf
│   └── base
│       └── logging.yaml
|
├── docker
│   ├── docker-compose.yaml
│   ├── fastapi.Dockerfile
│   ├── fastapi_requirements.txt
│   ├── sl.Dockerfile
│   └── sl_requirements.txt
|
├── model_assets
│   └── model.pt
|
├── notebooks
│   ├── 1. EDA.ipynb
│   ├── grad_cam.ipynb
|
├── src
│   ├── api
│   │   ├── __init__.py
│   │   ├── prediction.py
│   │   └── server.py
|   |
│   ├── EDA.py
│   ├── EDA_utils.py
│   ├── __init__.py
│   ├── model.py
│   ├── sl.py
│   ├── train.py
│   └── utils.py
|
└── tb_logs
|
├── images
|
├── LICENSE
|
├── README.md

Standard Usage

Fastapi and Streamlit

The Fastapi is dockerised and hosted on port 8000, the Streamlit frontend is dockerised and hosted on port 8501.

For the Fastapi and Front-end Streamlit run the docker compose in your terminal.

docker compose --file docker/docker-compose.yaml up

Training Pipeline

For the training pipeline run the python training pipeline file.

python src/train.py

You will be prompt for a training mode enter train or finetune for your respective use case

Images EDA

Imports

The EDA notebook imports a couple of functions from src/EDA.py and src/EDA_utils.py

Setting up of folders

Before conducting any EDA a portion of setting up the raw data into the Train/Test/Val folders is needed. This is covered in the EDA notebook in notebooks/EDA.ipynb.

Findings

An important finding was that when doing the canny edge plots for the bacteria and virus images it would seems that there were shades blocking the ribs itself.

There are others image plot counts, the aspect ratios and plot counts also explored

Model Used

Mobilenet V2

The MobileNet v2 architecture is based on an inverted residual structure where the input and output of the residual block are thin bottleneck layers opposite to traditional residual models which use expanded representations in the input. MobileNet v2 uses lightweight depthwise convolutions to filter features in the intermediate expansion layer. Additionally, non-linearities in the narrow layers were removed in order to maintain representational power.

Full Architecture of Model used

Grad_Cam

The initial pretrain model learns from the part that has a bit of shade of the images when shown clearly in the eda, this is reflected in the gradcam highlights.

Virus Pretrained

Bacteria Pretrained

After the model is trained on the data with varying x-ray images, the model looks at a much larger area of where the shades maybe this is reflected in the gradcam.

Virus Trained Model

Bacteria Trained Model

pneumonia-image-classification's People

Contributors

justinljg avatar

Watchers

Kostas Georgiou avatar  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.