A web app to detect COVID-19 based on given Chest X-rays is developing using transfer learning and deployed using Falsk and Docker. The models were trained for a few epochs on around 15264 (512x512) Chest X-rays on Google Colab GPU.
This dataset consists of 15264 (512x512) chest X-ray images from a Kaggle competition: https://www.kaggle.com/competitions/stat946winter2021/data%22
The dataset contains positive and negative classes to indicate the positive and negative COVID-19 cases. You can find some examples of this dataset below:
- Download the data set from https://www.kaggle.com/competitions/stat946winter2021/data%22
- Download my repo and upload the repo folder and data set file to your Google Drive
- Go to the jupyter notebooks folder in my repo, right click the notebook you want to open and select Open with Google Colab
- Activate free Google Colab GPU for faster execution. Go to Runtime -> Change Runtime Type -> Hardware Accelerator -> GPU -> Save
It's easy to install and run it on your computer.
# 1. First, clone the repo
$ git clone https://github.com/mz-zarei/Covid_APP.git
$ cd Covid_APP_main_folder
# 2. Install Python packages
$ pip install -r requirements.txt
# 3. Run!
$ python app.py
Additionally, with Docker, you can quickly build and run the entire application in minutes 🐳
# 1. First, clone the repo
$ git clone https://github.com/mz-zarei/Covid_APP.git
$ cd Covid_APP_main_folder
# 2. Build Docker image
$ docker build -t Covid_APP .
# 3. Run!
$ docker run -it --rm -p 5000:5000 Covid_APP
Then, easily send requests similar to test_request.py
file.
- Data Loader: Since all data couldn't be loaded into memory, data loaders from pytorch are used. A data loader combines a dataset and a sampler, and provides an iterable over the given dataset.
- Mixup Data Augmentation: mixup is a domain-agnostic data augmentation technique proposed in mixup: Beyond Empirical Risk Minimization by Zhang et al. It's implemented with the following formulas: (Note that the lambda values are values with the [0, 1] range and are sampled from the Beta distribution.)
- Transfer Learning: It is a popular approach in deep learning where pre-trained models are used as the starting point on computer vision and natural language processing tasks given the vast compute and time resources required to develop neural network models on these problems and from the huge jumps in skill that they provide on related problems.
- Deploying pytorch in python via a RESR API with Falsk: https://pytorch.org/tutorials/intermediate/flask_rest_api_tutorial.html
- Deploy Keras Model with Flask as Web App: https://github.com/imfing/keras-flask-deploy-webapp