The aim of this project is to create a dog breed identification application using CNNs. The resulting algorithm could be used as part of a mobile or web app. This design can be applied to image classification problem. The code will accept any user-supplied image as input. If a dog is detected in the image, it will provide an estimate of the dog's breed. If a human is detected, it will provide an estimate of the dog breed that is most resembling.
To get started you will need to follow the step mentioned below :
Working with this repository
To simply clone this repository, run this command in your terminal.
git clone https://github.com/mehtajinesh/Classify-Dog-Breeds-using-CNNs.git
- Development Environment : Python3
- Please install the required packages using ``` pip install -r requirements.txt `
- **Jinesh Mehta ** - Developer
This project is licensed under the Honeywell License - see the LICENSE.md file for details
Convolutional neural networks (CNN) have been used to great effect in applications such as object classification, scene recognition, and their applications. In many situations, we can imagine the features (both low-level and higher-level) that are learned by the CNNs in the process of training. However, when the objects the CNNs are trying to categorize share many similar features, such as the breeds of dogs, it becomes hard to imagine the specific features that CNNs must learn in order to categorize these dogs correctly. This is especially true if we take a look at sets of images such as Fig. 1 below, where the 3 dogs share almost all the same visible features, but belong to different classes. It is therefore interesting to see how well CNNs can perform on only dog breeds, compared to labels from all classes of objects in the regular ImageNet.
Image classification is the process of taking an input (like a picture) and outputting a class (like “cat” or "dog") or a probability that the input is a particular class (“there’s a 90% probability that this input is a cat”). You can look at a picture and know that you’re looking at a terrible shot of your own face, but how can a computer learn to do that?
Make sure that you've downloaded the required human and dog datasets:
- Download the dog dataset . Unzip the folder and place it in this project's home directory, at the location
- Download the human dataset . Unzip the folder and place it in the home diretcory, at location
/lfw. Note: If you are using a Windows machine, you are encouraged to use 7zip to extract the folder.
The goal of this project is to create a dog breed identification application using convolutional neural networks. The resulting algorithm could be used as part of a mobile or web app. This design can be applied to image classification problem.
The code will accept any user-supplied image as input. If a dog is detected in the image, it will provide an estimate of the dog's breed. If a human is detected, it will provide an estimate of the dog breed that is most resembling.
The evaluation metrics of this problem is simply the Accuracy Source for the designed algorithm.
The overall flow consists of the following steps:
In building our classifier we will be following below steps:
- Import Datasets : Our first step will be to load the datasets that are divided into train, validation and test folders.
- Detect Humans : In this section, we use OpenCV's implementation of Haar feature-based cascade classifiers to detect human faces in images.
- Detect Dogs : In this section, we use a pre-trained VGG-16 model to detect dogs in images.
- Create and train a CNN to classify Dog Breeds (from scratch) : In this step, we will create a CNN-based model from scratch that classifies dog breeds. In the next step, we will use an approach based on transfer learning.
- Train a CNN to Classify Dog Breeds (via transfer learning) : We will now use transfer learning to create a CNN that can identify dog breed from images. We will reuse the data loaders that we created earlier.
- Dog breed classification algorithm :
- if a dog is detected in the image, return the predicted breed.
- if a human is detected in the image, return the resembling dog breed.
- if neither is detected in the image, provide output as other thing.
- Testing the algorithm : Lastly, We will test our algorithm on six sample images to measure the performance of our algorithm.
Reviews & Validations
- From Udacity
If you're using Windows Server 2008 R2 then there is an x64 and x86 version of PowerShell both of which have to have their execution policies set. Did you set the execution policy on both hosts?
As an Administrator, you can set the execution policy by typing this into your PowerShell window: