VaasuCodez / Detecting-COVID-19-with-Chest-X-Ray-using-PyTorch

Objective of this project is to create an image classification model that can predict Chest X-Ray scans that belong to one of the three classes: Normal, Viral Pneumonia, COVID-19 with a reasonably high accuracy using PyTorch.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Detecting COVID-19 with Chest X-Ray using PyTorch

Objective of this project is to create an image classification model that can predict Chest X-Ray scans that belong to one of the three classes: Normal, Viral Pneumonia, COVID-19 with a reasonably high accuracy using PyTorch.

image

Table of contents

Dataset

Dataset used: COVID-19 Radiography Dataset
This dataset has more than 3500 Chest X-Ray scans which are categorized in four classes - Normal, Viral Pneumonia, COVID and Lung Opacity (not used here).

Development

THis project uses the ResNet-18 model from PyTorch trained on the COVID-19 Radiography dataset. To take advantage of tranfer learning and use the pre-trained weights from training on the ImageNet dataset, the dataset needed to be normalized in the same way as the ImageNet dataset.

Data Visualization

images, labels = next(iter(dl_train))
show_images(images, labels, labels)

image

images, labels = next(iter(dl_test))
show_images(images, labels, labels)

image

Training

image

Final Result

show_preds()

image

References

  1. M.E.H. Chowdhury, T. Rahman, A. Khandakar, R. Mazhar, M.A. Kadir, Z.B. Mahbub, K.R. Islam, M.S. Khan, A. Iqbal, N. Al-Emadi, M.B.I. Reaz, M. T. Islam, “Can AI help in screening Viral and COVID-19 pneumonia?” IEEE Access, Vol. 8, 2020, pp. 132665 - 132676. Paper link

  2. Rahman, T., Khandakar, A., Qiblawey, Y., Tahir, A., Kiranyaz, S., Kashem, S.B.A., Islam, M.T., Maadeed, S.A., Zughaier, S.M., Khan, M.S. and Chowdhury, M.E., 2020. Exploring the Effect of Image Enhancement Techniques on COVID-19 Detection using Chest X-ray Images. Paper link

  3. Paszke A, Gross S, Massa F, Lerer A, Bradbury J, Chanan G, et al. PyTorch: An Imperative Style, High-Performance Deep Learning Library. In: Advances in Neural Information Processing Systems 32 [Internet]. Curran Associates, Inc.; 2019. p. 8024–35. Available from: Paper link

Contribute

Contributions are welcomed. For major changes, kindly open an issue first to discuss the same before creating a pull request.

License

MIT

Footer

Please note that this dataset, and the model trained in the project, can not be used to diagnose COVID-19 or Viral Pneumonia. This data is only for educational purpose.

Leave a star in the GitHub repository if you found this project helpful!

(Back to top)

About

Objective of this project is to create an image classification model that can predict Chest X-Ray scans that belong to one of the three classes: Normal, Viral Pneumonia, COVID-19 with a reasonably high accuracy using PyTorch.

License:MIT License


Languages

Language:Jupyter Notebook 100.0%