Understanding deep Convolutional Neural Networks with a practical use-case in Tensorflow and Keras
This jupyter notebook reassembles the code of this article
It also contains a trained CNN model, so that you can use it yourself and test it.
Summary of this article
This post is a 4-part tutorial where I:
- Present an image dataset from the Cat vs. Dog Kaggle competition and explain the complexity of the image classification task
- Go over the details about Convolutional Neural Nets, explaining their inner meachanisms and the reason why they perform better than fully connected networks.
- Set up a deep learning dedicated environment on a powerful GPU-based EC2 instance from Amazon Web Services (AWS)
- Train two deep learning models: one from scratch in an end-to-end pipeline using Keras and Tensorflow, and another one by using a pre-trained network on a large dataset.
These 4 parts are independent.
If you're looking to understand the theory behind convnets please refer to the article link posted above.
Use Python 3.6: No hassle, intall the Conda distribution that encapsulates the PyData stack (SciPy, Pandas, Matplotlib, etc.). Here's the installation link
Install the lastest version of Tensorflow: https://www.tensorflow.org/install/install_windows I used a windows machine, same applies for Linux or Mac OS X
Install the following python dependencies:
pip install keras pip install tqdm pip install keras-tqdm conda install -c conda-forge opencv
[Optional] Dependencies to obtain GraphViz plots of the CNN architectures:
- Install Graphiz: http://www.graphviz.org/Download..php
- Add the Graphiz binaries to you PATH
- Install Graphiz Python bindings
pip install graphviz pip install pydot