In this project for the Udacity Machine Learning Nanodegree, I implemented a CNN with AWS GPU to classify dog breeds or the most resembling dog breed among 133 available breeds when given as input an image of either a dog or a human. I used two pre-trained models ResNet-50
to detect dogs and OpenCV-Harr Cascades
to detect human faces. In addtion, by extracting the VGG16 and Xception bottleneck features, I also leveraged transfer learning to speed up my training process without sacrificing accuracy (84% test accuracy).
Starter code can be found here.
- Create an EC2 instance in which I selected the
Ubuntu x64 with Tensorflow
as my AMI by following this tutorial. - Use scp to transfer files to my instance
## cd to the folder containing privateKey.pem and the folder I want to upload
##
scp -i privateKey.pem -r folderToUpload ubuntu@Public_DNS_(IPv4):~
## replace ubuntu with ec2-user for Windows/OS
- To run Jupyter Notebook, first ssh to the instance. You can find more details in these videos.
ssh -i privateKey.pem ubuntu@Public_DNS(IPv4)
git clone https://github.com/udacity/dog-project.git
## download the dog dataset
mkdir dogImages
cd dogImages
wget https://s3-us-west-1.amazonaws.com/udacity-aind/dog-project/dogImages.zip
## download the human dataset
mkdir lfw
cd lfw
wget https://s3-us-west-1.amazonaws.com/udacity-aind/dog-project/lfw.zip
## download the VGG-16 and Xception bottleneck features
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
- To run the Jupyter notebook
jupyter notebook --ip=0.0.0.0 --no-browser
### replace localhost with IPv4 Public IP in browser