Skip to content

Two unique CNN-based models to classify whether an X-Ray is from a COVID-19 patient, Viral Pneumonia patient or a healthy person with high accuracy.

Notifications You must be signed in to change notification settings

omkmorendha/COVID-19-Image-Detection

Repository files navigation

COVID-19 X-Ray Detection

Here, I have implemented two different types of models that classify an X-ray image into three categories: Normal, Viral Pneumonia and COVID-19.

Dataset

You can find the dataset here.

It contains around 137 cleaned images of COVID-19 and 317 in total containing Viral Pneumonia and Normal Chest X-Rays structured into the test and train directories. We have downloaded this dataset from Kaggle and worked on it on the Google Colab Platform. It is a simple directory structure branched into test and train and further branched into the respective 3 classes which contains the images.

image

Pre-processing

  • Images are first resized to a standard size (200 x 200)
  • Since X-ray images were used, contrast in the images was increased using histogram equalization.
  • We also converted all images from RGB to grayscale, since colors are not relevant for X-rays and this makes training the model much quicker, since the number of parameters reduces.

Model

Model 1 is a single layered model, which is a CNN model with 4 convolution layers, 4 Pooling and 4 Neural Network layers. While Model 2 is a two layered model, where each layer is a CNN model with 4 convolution layers, 4 Pooling and 4 Neural Network layers. THe first layer classifies the image as Normal or Abnormal, and the second layer further classifies an Abnormal image as either COVID-19 or Viral Pneumonia.

Model 1 gives a test accuracy of 91% while Model 2 gives a test accuracy of 87%

The CNN Model Summary:

image

Model 1

Single-Layered Image Classification Model

Confusion Matrix:

image

Classification Report:

image

Model 2

Two-Layered Image Classification Model consisting of two CNN-based sub-models

Flowchart of the Model:

image

Confusion Matrix:

image

Classification Report:

image

About

Two unique CNN-based models to classify whether an X-Ray is from a COVID-19 patient, Viral Pneumonia patient or a healthy person with high accuracy.

Topics

Resources

Stars

Watchers

Forks