A guide to get started with Deep Learning

Hello there!

I recently built an image classifier for one of my projects. It was fun but as a newbie, it was very difficult for me to figure out where and how to get started. With a huge amount of online resources and tutorials, it becomes very difficult to understand what exactly to do. So I decided to write a blog on how I pulled off my image classifier. 

Note: this blog only contains info on how to get started. I haven't covered the concepts of deep learning. That's a topic for another day!

What is the issue?

So, for image classification, you need to build and train a model that you will use later for prediction. For image classification, we use Convolutional Neural Network(CNN). There are several ways to build and train the model. The most popular and efficient of them is TensorFlow. That being said I decided to use TensorFlow for my project and here is my experience.

One thing about TensorFlow (as per my experience) is that it is very difficult to install. 
For the installation of TensorFlow, there is a list of prerequisites that needs to be fulfilled.
You need to install python, pip package, and virtualenv beforehand. This may seem easy but managing the compatible versions of these can be confusing sometimes. Even after multiple tries and referring the documentation I was not able to install TensorFlow on my system. (When you are working on heavy topics like deep learning and neural networks, not being able to even install the required software can be very depressing and frustrating as well. Right?!).

Even if you install Tensorflow successfully, you need to use a lot of packages to successfully create and train the model. Managing all these packages can be difficult especially when you are working with multiple projects.

Speaking of multiple projects, sometimes due to compatibility issues with some packages you might have to use a different version of python or TensorFlow to pull off things. imagine having five different versions of software on your system and keeping track of which one to use with a project.
It seems like a nightmare, right?  


So what to do?

One very easy and powerful solution is using a package management system like Anaconda.


 Here is why :

  •  Anaconda is a free and open-source distribution of the Python and R programming languages for scientific computing, that aims to simplify package management and deployment. 
  • Package versions are managed by the package management system conda. So keeping track of packages won't be a problem.
  • Also, Anaconda allows you to create a virtual environment in which you can install packages related to a project with effecting the system. 
  • A virtual environment also helps to use different versions of software for different projects very easily. 
  • So, you create a suitable virtual environment, go inside the environment and you are all set.
  • Installing packages in anaconda is also very easy.
  • The best feature of Anaconda is Anaconda Navigator (my personal favorite). Anaconda Navigator is a desktop graphical user interface (GUI) included in Anaconda distribution that allows you to launch applications and easily manage conda packages, environments, and channels without using command-line commands. 
  • If you are not comfortable with the command line you can still get things done just with a click!



 So, all the issues that I mentioned earlier are solved by using Anaconda.

Anaconda also has Jupyter Notebook inbuilt. So you can launch it from within the navigator in a suitable environment as per requirement.  With all this taken care of, now you can focus on the actual model that you need to create and train. Using a package and environment manager simplifies the process and is very convenient.

Use Keras API



If you are a newbie then Tensorflow might seem a bit complicated to you. Keras.io is a very good solution to this.
Keras is a high-level neural networks API, written in Python and capable of running on top of TensorFlow, CNTK, or Theano. It was developed with a focus on enabling fast experimentation. 
Being able to go from idea to result with the least possible delay is key to doing good research.
Use Keras if you need a deep learning library that:
  • It allows for easy and fast prototyping (through user-friendliness, modularity, and extensibility).
  • Supports both convolutional networks and recurrent networks, as well as combinations of the two.
  • Runs seamlessly on CPU and GPU.

I hope this will be helpful to you. 
All the best and Cheers!



Comments