This project is an attempt to build a machine learning model using deep learning that will to detect instances of pneumonia (lung opacity) infections in chest radiographs (CXRs). The model will leverage a state-of-the-art object detection and instance segmentation algorithms known as Mask R-CNN that will help accurately detect the ailment. The implementation of this algorithm is provided by Matterport.
- pneumonia_detection_analysis.ipynb shows exploratory data analysis of the dataset.
- pneumonia_detection.ipynb shows how training and inference are done using Mask R-CNN, evaluation of the model on a validation set and test results of the final model.
- inspect_pneumonia_detection_model.ipynb goes in depth into the steps performed during pneumonia detection and instance segmentation.
- inspect_pneumonia_detection_data.ipynb visualizes different preprocessing steps to prepare the data for training.
pneumonia_detection
and utils
folders contain code used for configuring and preparing
the dataset for training and inference and utility functions used within the notebooks respectively.
- proposal.pdf is a report on the exploratory data analysis.
- pneumonia_detection_report.pdf is the report on the pneumonia detection problem, solution and model.
- detections.csv contains the outcomes of the detections made on the test dataset.
The first column is the patient ID. The second column contains a sequence of prediction strings of
the format
confidence x y width height [confidence x y width height ...]
.
Use the trained pneumonia detection model weights for your training; download the weights
here
and place in the logs
folder.
This project requires Python >= 3.5, Tensorflow >=1.3, Keras >= 2.0.8 and other packages
listed in the requirements.txt
file. Download the required libraries by running the
following command: pip3 install -r requirements.txt
.
Note: If running on GPU (recommended), follow the Tensorflow instructions for installation,
available here instead of installing the CPU version in
the requirements.txt
file.
The dataset is provided by Radiological Society of North America (RSNA®) via Kaggle. You will be required to accept the competition terms on Kaggle and provide your Kaggle username and key in the pneumonia_detection_analysis.ipynb and pneumonia_detection.ipynb notebooks to download the dataset.
- Rui P, Kang K. National Ambulatory Medical Care Survey: 2015 Emergency Department Summary Tables. Table 27. Available from: link
- Deaths: Final Data for 2015. Supplemental Tables. Tables I-21, I-22. Available from: link
- Franquet T. Imaging of community-acquired pneumonia. J Thorac Imaging 2018 (epub ahead of print). PMID 30036297
- Kelly B. The Chest Radiograph. Ulster Med J 2012;81(3):143-148
- Wang X, Peng Y, Lu L, Lu Z, Bagheri M, Summers RM. ChestX-ray8: Hospital-scale Chest X-ray Database and Benchmarks on Weakly-Supervised Classification and Localization of Common Thorax Diseases. IEEE CVPR 2017, paper
- UNICEF: link
- Arthur Ouaknine. Review of Deep Learning Algorithms for Object Detection. link
- Kaiming He, Georgia Gkioxari, Piotr Dollár, Ross Girshick. Mask R-CNN. paper
- Waleed Abdulla. Splash of Color: Instance Segmentation with Mask R-CNN and TensorFlow. link