This repository contains my solution for Udacity's second Deep Learning Nanodegree project. After achieving all the objectives of the "Dog Breed Classifier" project, an algorithm results that, given an image, detects whether there is a human face or a dog in it. In case it is a dog, the algorithm classifies the breed of the dog.
The main objectives of the project are:
- Given a Cascade Classifier, be able to detect faces in images.
- Use the VGG-16 model to dectect dogs in images, and give percentages of detected dogs in the downloaded datasets.
Percentage of human files with detected dogs: 0 %
Percentage of dog files with detected dogs: 84 %
- Create a Convolutional Neural Network to Classify Dog Breeds
- Specify the data loaders
- Define the model architecture suitable for the classifying problem
- Train and Validate the model
- Test the model in order to have more than a 10% of accuracy
Test Loss: 3.805343
Test Accuracy: 13% (111/836)
- Use Transfer Learning to classify Dog Breeds
- Choose the Convolutional Neural Network architecture that best suits the classifying problem
- Modify the network in order to classify dog breeds
- Train and Validate the model
- Test the model in order to have more than a 60% of accuracy
Test Loss: 2.204232
Test Accuracy: 64% (538/836)
-
Clone the repository and navigate to the downloaded folder.
git clone https://github.com/udacity/deep-learning-v2-pytorch.git cd deep-learning-v2-pytorch/project-dog-classification
-
Download the dog dataset. Unzip the folder and place it in the repo, at location
path/to/dog-project/dogImages
. ThedogImages/
folder should contain 133 folders, each corresponding to a different dog breed. -
Download the human dataset. Unzip the folder and place it in the repo, at location
path/to/dog-project/lfw
. If you are using a Windows machine, you are encouraged to use 7zip to extract the folder.
Notice that dogImages/
and lfw/
folders are NOT included in the repository
Python
must be installed.
The following packages must be installed:
opencv-python
jupyter
matplotlib
pandas
numpy
pillow
scipy
tqdm
seaborn
scikit-learn
scikit-image
h5py
ipykernel