The Jupyter-Notebook-File dog_app.ipynb includes my solution to the Dog-Breed-Classifier-Project in the Deeplearning-Nanodegree.
An algorithm with the following functionality is implemented: Given an arbitrary image it first decides if a human or a dog or neither of the two is shown. If the image shows a dog it then detects the breed of the shown dog. If it shows a person the algorithm outputs the most resembling dog breed.
The code is written in python and the pytorch library is used for the implementation of convolutional neural networks.
As explained above, the algorithm first tries to decide if a given image shows a human, a dog or neither of the two. This is done via the following strategies:
- How does the algorithm decide if a human being is shown?: OpenCV's implementation of Haar feature-based cascade classifiers is used to recognize faces.
- How does the algorithm decide if a dog is shown?: A VGG-16 model which is already pre-trained on the ImageNet dataset is used to recognize dogs.
In the second part the algorithm estimates the dog breed of a shown dog (respectively the most resembling dog breed for a shown person). This is done via deep convolutional neural networks. Two different networks get tested:
- A newly trained newly architectured deep convolutional neural network.
- A pre-trained VGG-16 model (again pre-trained on the ImageNet dataset).
The 1. model consists of three convolutional layers (each followed by a maxpooling layer) and three fully connected layers at the end. For backpropagation a stochastic gradient descent optimizer is used.
- Learning rate: 0.01
- Epochs: 30