Binary Image Classification Deep Learning Model for Casting Quality Inspection Using TensorFlow Take 4

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 Casting Quality Inspection dataset is a binary classification situation where we attempt to predict one of the two possible outcomes.

INTRODUCTION: This dataset is about the casting process during the manufacturing of a product. A casting defect is an undesired irregularity in a metal casting process, and the significant problem is that most organizations carry out the inspection process manually. It is a very time-consuming process and prone to human errors. These photos are a top view of the submersible pump impeller, and the dataset contains 7348 image files. All images are the size of 300×300 pixels grey-scaled images with image augmentation.

From iteration Take1, we trained a few three-layer CNN models and evaluated them using 715 300×300 pixels test images.

From iteration Take2, we trained a few three-layer CNN models and evaluated them using 1300 512×512 pixels test images.

From iteration Take3, we trained a VGG-16 CNN model and evaluated it using the 1300 512×512 pixels test images.

In this Take4 iteration, we will train an InceptionV3 CNN model and evaluate it using the 1300 512×512 pixels test images.

ANALYSIS: From iteration Take1, the baseline model’s performance achieved an accuracy score of 99.72% after 15 epochs using the training dataset. After tuning the hyperparameters, the best model processed the validation/test dataset with an accuracy score of 99.86%.

From iteration Take2, the baseline model’s performance achieved an accuracy score of 72.62% after 15 epochs using the training dataset. After tuning the hyperparameters, the best model processed the validation/test dataset with an accuracy score of 72.62%.

From iteration Take3, the VGG16 model’s performance achieved an accuracy score of 100% after 20 epochs using the training dataset. The same model processed the validation/test dataset with an accuracy score of 73.92%.

In this Take4 iteration, the InceptionV3 model’s performance achieved an accuracy score of 99.80% after 20 epochs using the training dataset. The same model processed the validation/test dataset with an accuracy score of 79.84%.

CONCLUSION: In this iteration, the InceptionV3 CNN model appeared to be suitable for modeling this dataset. We should consider experimenting with TensorFlow for further modeling.

Dataset Used: Casting Quality Inspection Dataset

Dataset ML Model: Binary image classification with numerical attributes

Dataset Reference: https://www.kaggle.com/ravirajsinh45/real-life-industrial-dataset-of-casting-product

One potential source of performance benchmarks: https://www.kaggle.com/ravirajsinh45/real-life-industrial-dataset-of-casting-product/notebooks

The HTML formatted report can be found here on GitHub.