Skip to content
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'…
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
haarcascades adding code to run on local machine Jan 9, 2020
images adding all the project files from local machine Dec 9, 2019
.gitattributes Track pt files Jan 10, 2020
.gitignore Initial commit Jan 10, 2020
CustomCNN.py adding code to run on local machine Jan 9, 2020
Flow.png
LICENSE
README.md update title description Jan 10, 2020
compare.png
main.py removed pynb file and add python module Jan 10, 2020
model_scratch.pt removed pynb file and add python module Jan 10, 2020
model_transfer_vgg16.pt
proposal.pdf adding all the project files from local machine Dec 9, 2019
report.pdf adding all the project files from local machine Dec 9, 2019
requirements.txt removed pynb file and add python module Jan 10, 2020
results.png adding all the project files from local machine Dec 9, 2019
review.pdf added review file from udacity Dec 9, 2019
table.png adding all the project files from local machine Dec 9, 2019

README.md

Classify-Dog-Breeds-using-CNNs

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.

Getting Started

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

Prerequisites

  • Development Environment : Python3
  • Please install the required packages using ``` pip install -r requirements.txt `

Authors

  • **Jinesh Mehta ** - Developer

License

This project is licensed under the Honeywell License - see the LICENSE.md file for details

Domain Background

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.

alt text

Problem Statement

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?

Datasets

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 /dogImages.
  • 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.

Solution Statement

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.

Benchmark Model

alt text

Evaluation Metrics

The evaluation metrics of this problem is simply the Accuracy Source for the designed algorithm.

Project Design

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.

References

Reviews & Validations

Note :

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:

Set-ExecutionPolicy RemoteSigned

You can’t perform that action at this time.