This is my learning project when taking Machine Learning 0-Master course on Udemy. The goal of this project is to to use deep learning for multil-class image classification using TrensorFlow Hub. The original project is from Kaggle.
dentify the breed of a dog giving an image of a dog.
When I am sitting at a cafe and take a piture of a dog, I want to know what breed of the dog it is.
The data we are using is from Kaggle's dog breed identification competition
https://www.kaggle.com/c/dog-breed-identification/data
Python version: 3.7 Packages: pandas, numpy, matplotlib, sklearn, tensorflow, tensorflow_hub, IPython, os, datetime
I looked into the labels and the pictures in the data set, see if the numbers of labels (dog breed names) and pictures are matched with each other, or the number of picture of each label. I also checked if the picture is correctly labeled with the right breed name.
the number of picture of each label
tibetan_mastiff
Converting data into the form that is ready for training:
- Turning labels into arraies of boolean, then into integers.
- Split the data into training and validation data sets.
- Convert image into Numpy array, then into a Tensor
- Turning the data into batch (batch size 32), then create training and validation data batch.
- Visualize the data batch:
- Set up the input and ouput shapes (the images shape, in the form of Tensors) to the model
- Set up model URL from Tensors Hub: Keras deep learning model : https://www.tensorflow.org/guide/keras/sequential_model
- Create TensorBoard callback and early stopping callback
- First train the model with a subset of data as a test, to check and develope the fucntion to visualize our predictions and evaluate the model
- Train the moedel with the full data set, then make predictions on the test data.
- Make custom image predictions