Convolutional Neural Networks (CNN) project developed for Udacity's Deep Learning Nanodegree. The goal of this project is 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, the app will provide an estimate of the canine’s breed. If supplied an image of a human, the app will identify the resembling dog breed.
git clone https://github.com/geoglyph/dog-project.git
cd dog-project
Tested on the following environment:
- Ubuntu 16.04.4 LTS
- NVIDIA GTX1080 (driver version 384.130)
- CUDA® Toolkit 9.0
- cuDNN v7.0
Create a Linux Conda environment with CPU backend and upgrade tensorflow:
conda env create -f requirements/dog-linux.yml
conda activate dog-project
pip install flask gevent requests pillow
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.8.0-cp36-cp36m-linux_x86_64.whl
KERAS_BACKEND=tensorflow python -c "from keras import backend"
python -m ipykernel install --user --name dog-project --display-name "dog-project"
Create a Linux Conda environment with GPU backend and upgrade tensorflow:
conda env create -f requirements/dog-linux-gpu.yml
conda activate dog-project
pip install flask gevent requests pillow
pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow_gpu-1.8.0-cp36-cp36m-linux_x86_64.whl
KERAS_BACKEND=tensorflow python -c "from keras import backend"
python -m ipykernel install --user --name dog-project --display-name "dog-project"
Tested on the following environment:
- Windows 10 Pro, 64-bit
- NVIDIA GTX1080 (driver version 385.54)
- CUDA® Toolkit 9.0
- cuDNN v7.0
Create a Windows Conda environment with CPU backend and upgrade tensorflow:
conda env create -f requirements/dog-windows.yml
conda activate dog-project
pip install flask gevent requests pillow
pip install --ignore-installed --upgrade tensorflow
set KERAS_BACKEND=tensorflow
python -c "from keras import backend"
python -m ipykernel install --user --name dog-project --display-name "dog-project"
Create a Windows Conda environment with GPU backend and upgrade tensorflow:
conda env create -f requirements/dog-windows-gpu.yml
conda activate dog-project
pip install flask gevent requests pillow
pip install --ignore-installed --upgrade tensorflow-gpu
set KERAS_BACKEND=tensorflow
python -c "from keras import backend"
python -m ipykernel install --user --name dog-project --display-name "dog-project"
Download the following datasets and copy to dog-project/dogImages
and dog-project/lfw
respectively.
Download the following pre-computed bottleneck features and copy to `dog-project/bottleneck_features.
The following jupyter notebooks were developed to support this project:
Description | Link |
---|---|
Project notebook provided by Udacity, demonstrates transfer learning with Keras | Dog App Notebook |
Demonstrates the use of data augmentation with transfer learning with Keras | Dog App Augmented Notebook |
The following python programs were developed to support this project:
Description | File |
---|---|
Runs inference on each file in /images folder using saved InceptionV3 model | predict_breed.py |
Use flask to host simple REST API providing inference on saved InceptionV3 model | predict_breed_server.py |
Used to test REST API, sends each file in /images folder to REST API for inference | server_api_test.py |
The following resources were used in developing this project:
Usage | Link |
---|---|
Python code used to visualise loss history when training a Keras model | Visualize Loss History |
Keras data augmentation example refer: cifar10-augmentation/cifar10_augmentation.ipynb Used in development of data augmentation code in Jupyter notebooks |
AIND Term 2 -- Lesson on Convolutional Neural Networks |
Keras bottleneck feature extraction refer: transfer-learning/bottleneck_features.ipynb Used in development of feature extraction code in Jupyter notebooks |
AIND Term 2 -- Lesson on Convolutional Neural Networks |
Keras bottleneck feature extraction with data augmentation Used as initial inspiration for Dog App Augmented |
The Keras Blog |
Deploying a Keras model as a REST API Used as initial inspiration for predict_breed_server.py |
The Keras Blog |