Welcome to the Convolutional Neural Networks (CNN) project in the AI Nanodegree! In this project, you will learn how to build a pipeline that can be used within a web or mobile app to process real-world, user-supplied images. Given an image of a dog, your algorithm will identify an estimate of the canine’s breed. If supplied an image of a human, the code will identify the resembling dog breed.
![Sample Output][image1]
Along with exploring state-of-the-art CNN models for classification, you will make important design decisions about the user experience for your app. Our goal is that by completing this lab, you understand the challenges involved in piecing together a series of models designed to perform various tasks in a data processing pipeline. Each model has its strengths and weaknesses, and engineering a real-world application often involves solving many problems without a perfect answer. Your imperfect solution will nonetheless create a fun user experience!
-
Clone the repository and navigate to the downloaded folder.
git clone https://github.com/udacity/dog-project.git cd dog-project
-
Download the dog dataset. Unzip the folder and place it in the repo, at location
path/to/dog-project/dogImages
. -
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. -
Donwload the VGG-16 bottleneck features for the dog dataset. Place it in the repo, at location
path/to/dog-project/bottleneck_features
. -
Obtain the necessary Python packages, and switch Keras backend to Tensorflow.
For Mac/OSX:
conda env create -f requirements/aind-dog-mac.yml source activate aind-dog KERAS_BACKEND=tensorflow python -c "from keras import backend"
For Linux:
conda env create -f requirements/aind-dog-linux.yml source activate aind-dog KERAS_BACKEND=tensorflow python -c "from keras import backend"
For Windows:
conda env create -f requirements/aind-dog-windows.yml activate aind-dog set KERAS_BACKEND=tensorflow python -c "from keras import backend"
-
Open the notebook and follow the instructions.
jupyter notebook dog_app.ipynb
Instead of training your model on a local CPU (or GPU), you could use Amazon Web Services to launch an EC2 GPU instance. Please refer to the Udacity instructions for setting up a GPU instance for this project. (link for AIND students, link for MLND students)
Augmenting the training and/or validation set might help improve model performance.
Turn your code into a web app using Flask or web.py!
Overlay a Snapchat-like filter with dog ears on detected human heads. You can determine where to place the ears through the use of the OpenCV face detector, which returns a bounding box for the face. If you would also like to overlay a dog nose filter, some nice tutorials for facial keypoints detection exist here.
Currently, if a dog appears 51% German Shephard and 49% poodle, only the German Shephard breed is returned. The algorithm is currently guaranteed to fail for every mixed breed dog. Of course, if a dog is predicted as 99.5% Labrador, it is still worthwhile to round this to 100% and return a single breed; so, you will have to find a nice balance.
Perform a systematic evaluation of various methods for detecting humans and dogs in images. Provide improved methodology for the face_detector
and dog_detector
functions.