Skip to content

This repository includes code for classifying x-ray images into three categories, Covid, Norma, Viral Pneumonia

Notifications You must be signed in to change notification settings

Astrojigs/Chest-X-ray-classification

Repository files navigation

# Chest-X-ray-classification
This repository includes code for classifying x-ray images into three categories, Covid, Norma, Viral Pneumonia

The file includes are:
main.py
generating_images.py
resizing all images.py
prediction.py

In order to run the program run uncomment the "model.save" and "model.fit" in main.py. Run the main.py, once the model model is saved, you can run prediction.py

prediction.py will select a random image from the folder and use the model from main.py to predict which of the three cases it will be.


# print(train_image_gen.class_indices) = {'Covid': 0, 'Normal': 1, 'Viral Pneumonia': 2}
classification report:
               precision    recall  f1-score   support

           0       1.00      0.76      0.87        17
           1       0.90      0.90      0.90        20
           2       0.83      1.00      0.91        20

    accuracy                           0.89        57
   macro avg       0.91      0.89      0.89        57
weighted avg       0.91      0.89      0.89        57

# Note:
1) During generating the image, remove the 'rescaling' from img_gen from main.py. This procedure is to avoid rescaling the images twice when calling ImageDataGenerator on  both test and train data.

Also, I have added more than thousand images (generated by "generate all images.py")

About

This repository includes code for classifying x-ray images into three categories, Covid, Norma, Viral Pneumonia

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages