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.
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!
- Log into AWS account, choose region as Oregon and request limit increase of
g2.2xlarge
to "1", if not opted earlier. - In the EC2 dashboard page, go to "Launch instance", search for "Ubuntu x64 with Tensorflow" in AWS Marketplace section.
- Select the instance, leave all options to default, click "review and launch".
- You will be asked to generate a private key. Save the privateKey.pem file in your computer.
- Start the instance, make a note of the IPv4 public IP. In your local computer, goto the location where you have saved the privateKey.pem file.
- Open terminal, type
ssh -i privateKey.pem ubuntu@IPv4PublicIP
- Type the below commands to clone the project and configure jupyter notebook
git clone https://github.com/udacity/dog-project.git
cd dog-project
jupyter notebook --generate-config
pip install tqdm
sed -ie "s/#c.NotebookApp.ip = 'localhost'/#c.NotebookApp.ip = '*'/g" ~/.jupyter/jupyter_notebook_config.py
- Download all files and unzip them
mkdir dogImages
cd dogImages
wget https://s3-us-west-1.amazonaws.com/udacity-aind/dog-project/dogImages.zip
cd ..
mkdir lfw
cd lfw
wget https://s3-us-west-1.amazonaws.com/udacity-aind/dog-project/lfw.zip
cd ..
mkdir bottleneck_features
cd bottleneck_features
wget https://s3-us-west-1.amazonaws.com/udacity-aind/dog-project/DogVGG16Data.npz
wget https://s3-us-west-1.amazonaws.com/udacity-aind/dog-project/DogXceptionData.npz
- Start Jupyter notebook
jupyter notebook --ip=0.0.0.0 --no-browser
- The above command will give you a URL somewhat like this:
http://0.0.0.0:8888/?token=eca2c164a11847f53aec732f0d79cca5d024120887657a19
Copy the URL, replace 0.0.0.0 with your IPv4 IP and paste the link in your browser.
Happy learning!
- 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
. -
(Optional) If you plan to install TensorFlow with GPU support on your local machine, follow the guide to install the necessary NVIDIA software on your system. If you are using an EC2 GPU instance, you can skip this step.
-
(Optional) If you are running the project on your local machine (and not using AWS), create (and activate) a new environment.
- Linux (to install with GPU support, change
requirements/dog-linux.yml
torequirements/dog-linux-gpu.yml
):
conda env create -f requirements/dog-linux.yml source activate dog-project
- Mac (to install with GPU support, change
requirements/dog-mac.yml
torequirements/dog-mac-gpu.yml
):
conda env create -f requirements/dog-mac.yml source activate dog-project
NOTE: Some Mac users may need to install a different version of OpenCV
conda install --channel https://conda.anaconda.org/menpo opencv3
- Windows (to install with GPU support, change
requirements/dog-windows.yml
torequirements/dog-windows-gpu.yml
):
conda env create -f requirements/dog-windows.yml activate dog-project
- Linux (to install with GPU support, change
-
(Optional) If you are running the project on your local machine (and not using AWS) and Step 6 throws errors, try this alternative step to create your environment.
- Linux or Mac (to install with GPU support, change
requirements/requirements.txt
torequirements/requirements-gpu.txt
):
conda create --name dog-project python=3.5 source activate dog-project pip install -r requirements/requirements.txt
NOTE: Some Mac users may need to install a different version of OpenCV
conda install --channel https://conda.anaconda.org/menpo opencv3
- Windows (to install with GPU support, change
requirements/requirements.txt
torequirements/requirements-gpu.txt
):
conda create --name dog-project python=3.5 activate dog-project pip install -r requirements/requirements.txt
- Linux or Mac (to install with GPU support, change
-
Switch Keras backend to TensorFlow.
- Linux or Mac:
KERAS_BACKEND=tensorflow python -c "from keras import backend"
- Windows:
set KERAS_BACKEND=tensorflow python -c "from keras import backend"
- Linux or Mac:
-
(Optional) If you are running the project on your local machine (and not using AWS), create an IPython kernel for the
dog-project
environment.
python -m ipykernel install --user --name dog-project --display-name "dog-project"
- Open the notebook.
jupyter notebook dog_app.ipynb
- (Optional) If you are running the project on your local machine (and not using AWS), before running code, change the kernel to match the dog-project environment by using the drop-down menu (Kernel > Change kernel > dog-project). Then, follow the instructions in the notebook.
NOTE: While some code has already been implemented to get you started, you will need to implement additional functionality to successfully answer all of the questions included in the notebook. Unless requested, do not modify code that has already been included.
Your project will be reviewed by a Udacity reviewer against the CNN project rubric. Review this rubric thoroughly, and self-evaluate your project before submission. All criteria found in the rubric must meet specifications for you to pass.
When you are ready to submit your project, collect the following files and compress them into a single archive for upload:
- The
dog_app.ipynb
file with fully functional code, all code cells executed and displaying output, and all questions answered. - An HTML or PDF export of the project notebook with the name
report.html
orreport.pdf
. - Any additional images used for the project that were not supplied to you for the project. Please do not include the project data sets in the
dogImages/
orlfw/
folders. Likewise, please do not include thebottleneck_features/
folder.
Alternatively, your submission could consist of the GitHub link to your repository.