Skip to content

A deep learning approach that reads XRay chest images and predicts whether the vest is affected by pneumonia or not

Notifications You must be signed in to change notification settings

azizche/chest_xray_Classification

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Chest Xray Classification

A deep learning approach that reads XRay chest images and predicts whether the chest is affected by pneumonia or not using PyTorch.

Pneumonia vs Normal Chest Xray

Pneumonia

Normal

Best model parameters

Property Values
Pretrained Model Alexnet
Optimizer used Adam optimizer
Loss function Used Binary Cross Entropy
Learning rate 0.01
Mini Batch Size 16
Epochs 10
Seed 1

Evaluation

Tensorboard accuracy tracking

** Test Accuracy: 96.62 %**

DataSet

The dataset is from huggingspace chest-xray-classification. It has up to 5 820 images of labeled Xray Chest images. The data is downloaded within the approach so you don't have to download it yourself.

How to use?

The above code can be used for Deep Transfer Learning on any Image dataset to train using whether Alexnet or Efficient Net B7 as the PreTrained network.

Steps to follow

  1. Run any model you want that are available (currently Alexnet and Efficient Net B7 are available) and choose the hyperparameters you want

python train.py --model_name <MODEL NAME> --batch_size <BATCH SIZE> --lr <Learning Rate> --epochs <EPOCHS> --seed <SEED>

  1. A folder called runs will be created in your directory. It's an ouput created bu the SummaryWriter instance of Tensorboard that saves the train/test accuracy/loss values. To visualise these values, run %load_ext tensorboard and then !tensorboard --logdir runs".

Some Predictions

Deployed model

Make sure to check out the application that I've created in huggingspace using Gradio by clicking here. You can upload any ChestXray image you like and check out what the model predicts!

Contribute

If you want to contribute and add new feature feel free to send Pull request here

To report any bugs or request new features, head over to the Issues page

To-Do

  • Add loggers functionality.
  • Add more models and find better accuracy.
  • Add Data augmentation.

About

A deep learning approach that reads XRay chest images and predicts whether the vest is affected by pneumonia or not

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages