Binary Image Classification Deep Learning Model for Chest X-Ray Pneumonia Images Using TensorFlow Take 6

Template Credit: Adapted from a template made available by Dr. Jason Brownlee of Machine Learning Mastery.

SUMMARY: This project aims to construct a predictive model using a TensorFlow convolutional neural network (CNN) and document the end-to-end steps using a template. The Chest X-Ray Pneumonia dataset is a binary classification situation where we attempt to predict one of the two possible outcomes.

INTRODUCTION: The dataset contains chest X-ray images selected from retrospective cohorts of pediatric patients of one to five years old from Guangzhou Women and Children’s Medical Center, Guangzhou. The image collection is organized into three folders (train, test, val) and contains subfolders for each image category (Pneumonia/Normal). There are 5,863 X-Ray images with various display resolutions in this collection.

From iteration Take1, we trained a simple three-layer CNN model and used the model’s performance as the baseline.

From iteration Take2, we used the same three-layer CNN model from Take1 and applied it to the same photos with a higher resolution (from 640×480 to 1024×768).

From iteration Take3, we constructed a VGG-16 CNN model and compared it with the baseline model.

From iteration Take4, we constructed an Inception V3 CNN model and compared it with the baseline model.

From iteration Take5, we constructed a MobileNetV3Large CNN model and compared it with the baseline model.

In this Take6 iteration, we will construct a VGG-19 CNN model and compare it with the baseline model.

ANALYSIS: From iteration Take1, the baseline model’s performance achieved an accuracy score of 100% after 20 epochs using the validation dataset. However, the final model processed the test dataset with an accuracy measurement of only 72.91%.

From iteration Take2, the model’s performance achieved an accuracy score of 62.50% after ten epochs using the validation dataset. However, the final model processed the test dataset with an encouraging accuracy measurement of 83.33%.

From iteration Take3, the VGG-16 model’s performance achieved an accuracy score of 87.50% after ten epochs using the validation dataset. However, the final model processed the test dataset with an encouraging accuracy measurement of 76.44%.

From iteration Take4, the Inception v3 model’s performance achieved an accuracy score of 68.75% after 20 epochs using the validation dataset. Moreover, the final model processed the test dataset with an encouraging accuracy measurement of 67.95%.

From iteration Take5, the MobileNetV3Large model’s performance achieved an accuracy score of 100% after ten epochs using the validation dataset. Moreover, the final model processed the test dataset with an encouraging accuracy measurement of 77.72%.

In this Take6 iteration, the VGG-19 model’s performance achieved an accuracy score of 75.00% after ten epochs using the validation dataset. Moreover, the final model processed the test dataset with an encouraging accuracy measurement of 76.12%.

CONCLUSION: In this iteration, the TensorFlow CNN models appeared to be suitable for modeling this dataset, but we need to experiment with the TensorFlow model to improve its accuracy.

Dataset Used: Chest X-Ray Images (Pneumonia) Dataset

Dataset ML Model: Binary image classification with numerical attributes

Dataset References: https://www.kaggle.com/paultimothymooney/chest-xray-pneumonia, https://data.mendeley.com/datasets/rscbjbr9sj/2, and http://www.cell.com/cell/fulltext/S0092-8674(18)30154-5.

One potential source of performance benchmarks: https://www.kaggle.com/paultimothymooney/chest-xray-pneumonia

The HTML formatted report can be found here on GitHub.