Pokemon
Pokemon
In this lab, we will build a convolutional neural network capable of predicting the primary and secondary type of any
given Pokemon.
• preprocess images
• use CNNs
• do multi label classification
The project contains a zipped file of all the images of pokemons, as well as pokemon.csv file that contains the labels
of each pokemon.
The images are in multiple formats (png,jpg). However the names of images are the same in the column
Á Name of pokemon.csv.
We shall start by predicting the primary type of the Pokemon (labelled as Type 1 in pokemon.csv).
• Using the Name column, link each image to its label. Then open the image in RGB format with a size of (120 × 120).
• Normalize the three channels (./255) and then split the data into training and testing.
• Check the distribution of pokemon types. Apply the adequate method in case of imbalance (Weighted learning,
SMOTE).
In the following, we shall build a multi label classifier for detecting the primary and secondary type.
• Merge Type1 and Type2 into one column Types. You should replace any null value of Type2 by an empty string
"". The values under the Types column should be an array of the Pokemon types (eg: [grass,poison])
• Use Multi label binarizer to encode the types.
• Prepare your samples similarly to Section 1.
• Build A CNN structure using Conv2D, Max Pooling (You can build a deeper neural network) and other layers
(Dropout, Batch Normalization) to prevent overfitting. However, The output should have n_classes neurons
with sigmoid an activation function for each neuron. The goal here is that each output neuron i is capable of
predicting if a Pokemon is of type_i or not.
• Use adam gradient descent, binary cross entropy loss and accuracy metrics as parameters for training the model.
• Train the multi label CNN and evaluate its performance.
• Use the confusion matrix to show the perfomance of the model.
• Make some predictions with your model.