This project builds a pipeline to process real-world images of dogs and humans to identify dog breeds.
The goal of this project is to build an algorithm that can be used within a web or mobile app to process real-world images of dogs and humans. The algorithm will:
- Accept any user-supplied image as input
- Detect humans in images and provide an estimate of the most resembling dog breed
- Detect dogs in images and provide an estimate of the dog's breed
The project explores convolutional neural networks (CNNs) for classification and localization tasks. Design decisions are made about the user experience of the app.
The Jupyter notebook dog_app.ipynb
contains the following steps:
- Import Datasets
- Detect Humans
- Detect Dogs
- Create a CNN to Classify Dog Breeds from Scratch
- Use Transfer Learning to Create a CNN to Classify Dog Breeds
- Write the Algorithm
- Test the Algorithm
To run the app:
- Clone this repository
- Install requirements
- Run Jupyter notebook
- Open
dog_app.ipynb
- Run the notebook from top to bottom
The notebook accepts image paths as input to test the algorithm.
The algorithm uses pre-trained VGG16 model for feature extraction and a custom classifier for dog breed prediction. Humans are detected using a Haar cascade classifier.
Key points:
- VGG16 is used for feature extraction
- Custom fully-connected classifier is trained for dog breed prediction
- Haar cascade classifier detects human faces
- Dog detector checks if VGG16 prediction is between dog breeds
The algorithm achieves:
- 86% accuracy in predicting dog breeds on test set
- 100% accuracy in detecting dogs in sample dog images
- 1% false positive rate in detecting dogs in sample human images