Potato Quality dataset is a labelled data set with 2 different quality classes. Each class contains 1000s of images. Using the data provided, a deep learning model built on TensorFlow is trained to classify into various classes in dataset.
Classes: (Defective, Non-Defective)
Epoches: 50
Batch_size: 32
Images are split to train and test set with 769 images belonging to 2 different classes.
Let's preview some of the images.
The size of the images are mostly consistent, so all the images are scaled to same size, so we dont have to worry about inconsistency.
To create a convolution neural network to classfied the images, Sequential model is used.
model = models.Sequential([
resize_and_rescale,
data_augmentation,
layers.Conv2D(32,(3,3),activation = 'relu',input_shape = input_shape),
layers.MaxPooling2D((2,2)),
layers.Conv2D(64,(3,3),activation = 'relu'),
layers.MaxPooling2D((2,2)),
layers.Conv2D(64,(3,3),activation = 'relu'),
layers.MaxPooling2D((2,2)),
layers.Conv2D(128,(3,3),activation = 'relu'),
layers.MaxPooling2D((2,2)),
layers.Flatten(),
layers.Dense(256,activation = 'relu'),
layers.Dense(n_classes,activation = 'softmax'),
])Model accuracy increased over each epoch, overfitting started at around 3 epochs. The model achieved validation accuracy of 99.34% with a 0.0397 cross entropy validation loss.
Preview some predictions from the model:
First Image to Predict:
Actual Label: Defective
Predicted Label: Defective
Now, let's examine in more detail how the model performs and evaluate those predictions.
With the given data sets for 2 classes of quality: Defective and Non-Defective, the model final accuracy reached 99.34% with cross entropy validation loss of 0.0397.
⭐ Please consider starring this repository if it helped you! ⭐



