Indian food dataset is a labelled data set with different food classes. Each food 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.
Epoches: 200
Batch_size: 32
Images are split to train and test set with 4020 images belonging to 80 different classes.
Let's preview some of the images.
The size of the images are inconsistent, 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 40 epochs. The model achieved validation accuracy of 92.94% with a 0.2418 cross entropy validation loss.
Preview some predictions from the model:
First Image to Predict:
Actual Label: imarti
Predicted Label: imarti
Now, let's examine in more detail how the model performs and evaluate those predictions.
With the given data sets for 80 classes of Indian food, the model final accuracy reached 92.94% with cross entropy validation loss of 0.2418.
⭐ Please consider starring this repository if it helped you! ⭐