Pokémon Classification

Original Source Here

The softmax function is generally used as the activation function in the output layer of neural network models that predict a multinomial probability distribution. That is, softmax is used as the activation function for multi-class classification problems as in this case, we had multiple classes of Pokémon. Moreover, the softmax is very useful as it converts the scores to a normalized probability distribution, which can be later displayed to a user or can be used as input to other systems. Hence, it is usual to append a softmax function as the final layer of the neural network.

Now, as per the classification, the model was compiled using the categorical cross-entropy loss function. “Adam” is used as an optimizer, also because of its ability to adjust the learning rate of the model on its own as per the situation.


We used various callbacks in defining our model. A callback is simply an object that can perform actions at various stages of training(e.g. at the start or end of an epoch, before or after a single batch, etc). We used the following callbacks for our model:

  • Early Stopping: Used to stop training when a monitored metric has stopped improving.
  • Reduce LR On Plateau: Used to reduce learning rate when a metric has stopped improving.
  • Model Checkpoint: Used to save the Keras model or model weights at some frequency.

Model Summary

Model Summary

Model Visualisation

Model Visualisation using plot_model()


The model achieved an exceptional accuracy of 96% on the validation set and 95% of accuracy on the test set.


Trending AI/ML Article Identified & Digested via Granola by Ramsey Elbasheer; a Machine-Driven RSS Bot

%d bloggers like this: