GithubHelp home page GithubHelp logo

laurentveyssier / dog-identification-app-using-cnn Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 2.9 MB

App taking image as an input and using CNN network to identify dog breed

Jupyter Notebook 100.00%
pytorch cnn-classification haar-cascade-classifier vgg-16

dog-identification-app-using-cnn's Introduction

Dog-Identification-App-using-CNN

App taking image as an input and using CNN network to identify dog breed

Description

This notebook accepts 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.

This project is part of Udacity's Nanodegree "Deep Learning".

Dependencies

The notebook uses VGG16 pre-trained model which is downloaded from PyTorch library. It also uses a haarcascade classifier for human face detection. The classifier is provided in the haarcascades folder.

The training requires two datasets, one for dogs and one from human faces. Datasets can be downloaded in the notebook from these paths:

Installation

  • Download the repository
  • Download the datasets and follow instructions from the notebook to create the appropriate folders.

Run the notebook

  • Insert your own images that you would like to classify in the folder "my_images". The notebook will scan through all saved images and return a prediction.
  • Run the Jupyter notebook providing your own pictures to the model.

Notebook structure

  • Import Datasets
  • Create human face detector. This part uses a haarcascade classifier.
  • Create dog breed detector. This part uses VGG-16 pretrained model.
  • Create CNN architecture to classify dog breed from scratch
  • Create CNN model to classifiy dog breeds using transfer learning
  • Assemble algorithm of the detection App
  • Test algorithm

Results

The CNN architecture is build around five CONV2D layers with maxpooling and ReLu activation function. The last three layers use fully connected layers with softmax classifying dogs over 133 different breeds. The model was trained on GPU and achieved a poor performance.

The second architecture uses transfer learning: from the VGG-16 pretrained network, I replaced the last layer with a simple fully connected classifier using softmax. model_transfer.classifier[6] = nn.Linear(4096, num_classes)

Only the fully connected section of the model was re-trained. The performance achieved was 70% with only 10 epochs on GPU.

Detection samples:

dog-identification-app-using-cnn's People

Contributors

laurentveyssier avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.