A Convolutional Neural Network that is able to detect whether a patient has pneumonia, both bacterial and viral, or not, based on an X-ray image of their chest. Implements transfer learning, using the first 16 layers of a pre-trained VGG19 Network, to identify the image classes. The final accuracy obtained by the model, after testing on 624 unseen instances, is approximately 92%.
Execution Instructions
- Install the Kaggle API, which will assist in the downloading of data:
pip install kaggle
- Retrieve the data through the following command:
python retrieve.py
- Train the Convolutional Neural Network through the following command:
python train.py
- Make predictions on new, unseen chest X-ray using the Convolutional Neural Network The default image is 'test.jpg', which does possess Pneumonia:
python predict.py -i <path-to-image>
Generated Files
- model.h5 - This stores a '.h5' version of the Convolutional Neural Network model trained.
- plot.jpg - This displays statistics regarding the training process of the model.