Faizan Shaikh — April 8, 2017
Beginner Career Data Science Deep Learning Interviews Machine Learning

Overview

  • The article explains the essential difference between machine learning & deep learning
  • Comparison between machine learning & deep learning explained with examples

 

Introduction

Machine learning and deep learning on a rage! All of a sudden every one is talking about them – irrespective of whether they understand the differences or not! Whether you have been actively following data science or not – you would have heard these terms.

Just to show you the kind of attention they are getting, here is the Google trend for these keywords,

deep learning, machine learning

Deep Learning vs. Machine Learning – the essential differences you need to know!

If you have often wondered to yourself what is the difference between machine learning and deep learning, read on to find out a detailed comparison in simple layman language. I have explained each of these term in detail. Then I have gone ahead to compare both of them and explained where we can use them.

 

Table of Contents

  1. What is Machine Learning and Deep Learning?
    1. What is Machine Learning?
    2. What is Deep Learning?
  2. Comparison of Machine Learning and Deep Learning
    1. Data Dependencies
    2. Hardware Dependency
    3. Problem Solving Approach
    4. Feature Engineering
    5. Execution time
    6. Interpretability
  3. Where is Machine Learning and Deep Learning being applied right now?
  4. Pop Quiz
  5. Future Trends

 

1.What is Machine Learning and Deep Learning?

Let us start with the basics – What is Machine Learning and What is Deep Learning. If you already know this, feel free to move to section 2.

 

1.1 What is Machine Learning?

The widely-quoted definition of Machine learning by Tom Mitchell best explains machine learning in a nutshell. Here’s what it says:

“A computer program is said to learn from experience E with respect to some class of tasks T and performance measure P if its performance at tasks in T, as measured by P, improves with experience E

Did that sound puzzling or confusing? Let’s break this down with simple examples.

 

Example 1 – Machine Learning – Predicting weights based on height

Let us say you want to create a system which tells expected weight based on height of a person. There could be several reasons why some thing like this could be of interest. You can use this to filter out any possible frauds or data capturing errors. The first thing you do is collect data. Let us say this is how your data looks like:

Each point on the graph represents one data point. To start with we can draw a simple line to predict weight based on height. For example a simple line:

Weight (in kg) = Height (in cm) - 100

can help us make predictions. While the line does a decent job, we need to understand its performance. In this case, we can say that we want to reduce the difference between the Predictions and actuals. That is our way to measure performance.

Further, the more data points we collect (Experience), the better will our model become. We can also improve our model by adding more variables (e.g. Gender) and creating different prediction lines for them.

Example 2 – Storm prediction System

Let us take slightly more complex example. Suppose you are building a storm prediction system. You are given the data of all the storms which have occurred in the past, along with the weather conditions three months before the occurrence of these storms.

Consider this, if we were to manually build a storm prediction system, what do we have to do?

We have to first scour through all the data and find patterns in this data. Our task is to search which conditions lead to a storm.

We can either model conditions like – if the temperature is greater than 40-degree celsius, humidity is in the range 80 to 100, etc. And feed these ‘features’ manually to our system.

Or else, we can make our system understand from the data what will be the appropriate values for these features.

Now to find these values, you would go through all the previous data and try to predict if there will be a storm or not. Based on the values of the features set by our system, we evaluate how the system performs, viz how many times the system correctly predicts the occurrence of a storm. We can further iterate the above step multiple times, giving performance as feedback to our system.

Let’s take our formal definition and try to define our storm prediction system: Our task ‘T’ here is to find what are the atmospheric conditions that would set off a storm. Performance ‘P’ would be, of all the conditions provided to the system, how many times will it correctly predict a storm. And experience ‘E’ would be the reiterations of our system.

 

1.2 What is Deep Learning?

The concept of deep learning is not new. It has been around for a couple of years now. But nowadays with all the hype, deep learning is getting more attention. As we did in Machine Learning, we will look at a formal definition of Deep Learning and then break it down with example.

“Deep learning is a particular kind of machine learning that achieves great power and flexibility by learning to represent the world as nested hierarchy of concepts, with each concept defined in relation to simpler concepts, and more abstract representations computed in terms of less abstract ones.”

Now – that one would be confusing. Let us break it with simple example.

 

Example 1 – Shape detection

Let me start with a simple example which explains how things happen at a conceptual level. Let us try and understand how we recognize a square from other shapes.

The first thing our eyes do is check whether there are 4 lines associated with a figure or not (simple concept). If we find 4 lines, we further check, if they are connected, closed, perpendicular and that they are equal as well (nested hierarchy of concept).

So, we took a complex task (identifying a square) and broke it in simple less abstract tasks. Deep Learning essentially does this at a large scale.

 

Example 2 – Cat vs. Dog

Let’s take an example of an animal recognizer, where our system has to recognize whether the given image is of a cat or a dog.

If we solve this as a typical machine learning problem, we will define features such as if the animal has whiskers or not, if the animal has ears & if yes, then if they are pointed. In short, we will define the facial features and let the system identify which features are more important in classifying a particular animal.

Now, deep learning takes this one step ahead. Deep learning automatically finds out the features which are important for classification, where in Machine Learning we had to manually give the features. Deep learning works as follows:

Deep learning works as follows:

  • It first identifies what are the edges that are most relevant to find out a Cat or a Dog
  • It then builds on this hierarchically to find what combination of shapes and edges we can find. For example, whether whiskers are present, or whether ears are present, etc.
  • After consecutive hierarchical identification of complex concepts, it then decides which of this features are responsible for finding the answer.

 

2. Comparison of Machine Learning and Deep Learning

Now that you have understood an overview of Machine Learning and Deep Learning, we will take a few important points and compare the two techniques.

 

2.1 Data dependencies

The most important difference between deep learning and traditional machine learning is its performance as the scale of data increases. When the data is small, deep learning algorithms don’t perform that well. This is because deep learning algorithms need a large amount of data to understand it perfectly. On the other hand, traditional machine learning algorithms with their handcrafted rules prevail in this scenario. Below image summarizes this fact.

2.2 Hardware dependencies

Deep learning algorithms heavily depend on high-end machines, contrary to traditional machine learning algorithms, which can work on low-end machines. This is because the requirements of deep learning algorithm include GPUs which are an integral part of its working. Deep learning algorithms inherently do a large amount of matrix multiplication operations. These operations can be efficiently optimized using a GPU because GPU is built for this purpose.

 

2.3 Feature engineering

Feature engineering is a process of putting domain knowledge into the creation of feature extractors to reduce the complexity of the data and make patterns more visible to learning algorithms to work. This process is difficult and expensive in terms of time and expertise.

In Machine learning, most of the applied features need to be identified by an expert and then hand-coded as per the domain and data type.

For example, features can be pixel values, shape, textures, position and orientation. The performance of most of the Machine Learning algorithm depends on how accurately the features are identified and extracted.

Deep learning algorithms try to learn high-level features from data. This is a very distinctive part of Deep Learning and a major step ahead of traditional Machine Learning. Therefore, deep learning reduces the task of developing new feature extractor for every problem. Like, Convolutional NN will try to learn low-level features such as edges and lines in early layers then parts of faces of people and then high-level representation of a face.

2.4 Problem Solving approach

When solving a problem using traditional machine learning algorithm, it is generally recommended to break the problem down into different parts, solve them individually and combine them to get the result. Deep learning in contrast advocates to solve the problem end-to-end.

Let’s take an example to understand this.

Suppose you have a task of multiple object detection. The task is to identify what is the object and where is it present in the image.

In a typical machine learning approach, you would divide the problem into two steps, object detection and object recognition. First, you would use a bounding box detection algorithm like grabcut, to skim through the image and find all the possible objects. Then of all the recognized objects, you would then use object recognition algorithm like SVM with HOG to recognize relevant objects.

On the contrary, in deep learning approach, you would do the process end-to-end. For example, in a YOLO net (which is a type of deep learning algorithm), you would pass in an image, and it would give out the location along with the name of object.

Learn Computer Vision using Deep Learning here

2.5 Execution time

Usually, a deep learning algorithm takes a long time to train. This is because there are so many parameters in a deep learning algorithm that training them takes longer than usual. State of the art deep learning algorithm ResNet takes about two weeks to train completely from scratch. Whereas machine learning comparatively takes much less time to train, ranging from a few seconds to a few hours.

This is turn is completely reversed on testing time. At test time, deep learning algorithm takes much less time to run. Whereas, if you compare it with k-nearest neighbors (a type of machine learning algorithm), test time increases on increasing the size of data. Although this is not applicable on all machine learning algorithms, as some of them have small testing times too.

 

2.6 Interpretability

Last but not the least, we have interpretability as a factor for comparison of machine learning and deep learning. This factor is the main reason deep learning is still thought 10 times before its use in industry.

Let’s take an example. Suppose we use deep learning to give automated scoring to essays. The performance it gives in scoring is quite excellent and is near human performance. But there’s is an issue. It does not reveal why it has given that score. Indeed mathematically you can find out which nodes of a deep neural network were activated, but we don’t know what there neurons were supposed to model and what these layers of neurons were doing collectively. So we fail to interpret the results.

On the other hand, machine learning algorithms like decision trees give us crisp rules as to why it chose what it chose, so it is particularly easy to interpret the reasoning behind it. Therefore, algorithms like decision trees and linear/logistic regression are primarily used in industry for interpretability.

 

3. Where is Machine Learning and Deep Learning being applied right now?

The wiki article gives an overview of all the domains where machine learning has been applied. These include:

  • Computer Vision: for applications like vehicle number plate identification and facial recognition.
  • Information Retrieval: for applications like search engines, both text search, and image search.
  • Marketing: for applications like automated email marketing, target identification
  • Medical Diagnosis: for applications like cancer identification, anomaly detection
  • Natural Language Processing: for applications like sentiment analysis, photo tagging
  • Online Advertising, etc

 

The image given above aptly summarizes the applications areas of machine learning. Although it covers broader topic of machine intelligence as a whole.

One prime example of a company using machine learning / deep learning is Google.

In the above image, you can see how Google is applying machine learning in its various products. Applications of Machine Learning/Deep Learning are endless, you just have to look at the right opportunity!

 

4. Pop quiz

To assess if you really understood the difference, we will do a quiz. You can post your answers in this thread.

Please mention the steps below to completely answer it.

  • How would you solve the below problem using Machine learning?
  • How would you solve the below problem using Deep learning?
  • Conclusion: Which is a better approach?

 

Scenario 1:

You have to build a software component for self-driving car. The system you build should take in the raw pixel data from cameras and predict what would be the angle by which you should steer your car wheel.

 

Scenario 2:

Given a person’s credentials and background information, your system should assess whether a person should be eligible for a loan grant.

 

Scenario 3:

You have to create a system that can translate a message written in Russian to Hindi so that a Russian delegate can address the local masses.

 

5. Future Trends

The above article would have given you an overview of Machine Learning and Deep Learning and the difference between them. In this section, I’m sharing my viewies on how Machine Learning and Deep Learning would progress in the future.

  • First of all, seeing the increasing trend of using data science and machine learning in the industry, it will become increasing important for each company who wants to survive to inculcate Machine Learning in their business. Also, each and every individual would be expected to know the basics terminologies.
  • Deep learning is surprising us each and every day, and will continue to do so in the near future. This is because Deep Learning is proving to be one of the best technique to be discovered with state-of-the-art performances.
  • Research is continuous in Machine Learning and Deep Learning. But unlike in previous years, where research was limited to academia, research in Machine Learning and Deep Learning is exploding in both industry and academia. And with more funds available than ever before, it is more likely to be a keynote in human development overall.

I personally follow these trends closely. I generally get a scoop from Machine Learning/Deep Learning newsletters, which keep me updated with recent happenings. Along with this, I follow arxiv papers and their respective code, which are published every day.

 

End notes

In this article, we had a high-level overview and comparison between deep learning and machine learning techniques. I hope I could motivate you to learn further in machine learning and deep learning.  Here are the learning path for machine learning & deep learning Learning path for machine learning and Learning path for deep learning.

If you have any questions, feel free to drop them below in the comments section.

Learn, compete, hack and get hired!

About the Author

Faizan Shaikh

Faizan is a Data Science enthusiast and a Deep learning rookie. A recent Comp. Sc. undergrad, he aims to utilize his skills to push the boundaries of AI research.

Our Top Authors

Download Analytics Vidhya App for the Latest blog/Article

51 thoughts on "Deep Learning vs. Machine Learning – the essential differences you need to know!"

J.Manimaran
J.Manimaran says: April 08, 2017 at 9:11 am
Thank you very much, it was helped me a lot. Reply
Faizan Shaikh
Faizan Shaikh says: April 08, 2017 at 10:48 am
Thanks manimaran! Reply
Preeti Agarwal
Preeti Agarwal says: April 08, 2017 at 12:46 pm
Great Article !! Helped understand the concept in a lay man's language !! Reply
Faizan Shaikh
Faizan Shaikh says: April 08, 2017 at 12:55 pm
Thanks Preeti! Hope it helps others too Reply
Usman
Usman says: April 08, 2017 at 2:07 pm
Top Quality Stuff. Great Article Reply
Faizan Shaikh
Faizan Shaikh says: April 08, 2017 at 2:18 pm
Thanks usman! Reply
Amn
Amn says: April 08, 2017 at 4:03 pm
Thnaks for y'r explanations , i have a question .wich language is more sophisticated to deal with Deep Learning algorithmes ? Reply
Faizan Shaikh
Faizan Shaikh says: April 08, 2017 at 4:41 pm
Thanks amn! Can you clarify what "sophisticated" means? If you are asking which language is usually used in terms of deep learning, its python Reply
Vaibhav
Vaibhav says: April 09, 2017 at 5:57 am
HI Faizan, A good one. What's the units on Y axis for google trend displayed in first graphic? Reply
Faizan Shaikh
Faizan Shaikh says: April 09, 2017 at 9:03 am
Hey Vaibhav. The units are relative, and they are used to compare search history for ML with respect to DL. Reply
Krishna
Krishna says: April 09, 2017 at 4:03 pm
Excellent, Faizan. Keep up the great work! Reply
Faizan Shaikh
Faizan Shaikh says: April 09, 2017 at 4:06 pm
Thanks Krishna! Reply
Atul
Atul says: April 12, 2017 at 4:13 am
One of the best explanation I have come across on this topic. It was very insightful and simple to understand. Thanks Faizan. Keep up the great work. Reply
Faizan Shaikh
Faizan Shaikh says: April 12, 2017 at 6:15 am
Thanks Atul! Reply
tony james
tony james says: April 12, 2017 at 8:43 pm
Great Article! Thanks for writing it. Is there any library in python for applying Deep Learning similar to scikit learn for ML? Which will be an easy to learn tool for practising Deep Learning? Thanks Reply
Faizan Shaikh
Faizan Shaikh says: April 13, 2017 at 5:48 am
Hey Tony! I think keras (https://keras.io/) might fit the profile, as it is easy to use and highly abstracted library similar to sklearn Reply
Dheeraj Kura
Dheeraj Kura says: April 13, 2017 at 9:06 am
Hello Faizan, Its A Great Article ..! Appreciated..!! Lot of People are considering Data Science as Deep Learning ..But, there is way to take and solve the problem of Deep learning Reply
Faizan Shaikh
Faizan Shaikh says: April 13, 2017 at 10:12 am
Thanks dheeraj. This article was especially written for people to know that deep learning is not the answer to everything, and we should apply it only when it is essential. Reply
David Jung
David Jung says: April 17, 2017 at 12:18 am
It helped me a lot. Thanks! Reply
Aditya Jain
Aditya Jain says: April 17, 2017 at 11:02 am
Hi Faizan Thanks for the wonderful article. It would be helpful if you would also provide your take on the above quiz. Regards Reply
Nirav
Nirav says: April 19, 2017 at 9:53 am
Good article.Great work Faizan Reply
Karthic
Karthic says: April 19, 2017 at 12:46 pm
Very nice. Thanks a lot Reply
Ru
Ru says: May 06, 2017 at 10:49 pm
Great article , much appreciated! Reply
Faizan Shaikh
Faizan Shaikh says: May 24, 2017 at 8:51 am
Thanks David Reply
Faizan Shaikh
Faizan Shaikh says: May 24, 2017 at 8:52 am
Thanks Ru Reply
Faizan Shaikh
Faizan Shaikh says: May 24, 2017 at 8:53 am
Thanks karthic Reply
Faizan Shaikh
Faizan Shaikh says: May 24, 2017 at 8:53 am
Thanks Nirav Reply
Faizan Shaikh
Faizan Shaikh says: May 24, 2017 at 8:55 am
Thanks Aditya! I will give my view on the discuss post :) Reply
Krishna Mohan
Krishna Mohan says: May 26, 2017 at 5:54 pm
HI Faizan, Its very helpful material on D.L Can you please suggest a reference for web related stuff to implement on Python like heat maps and other maps stuff. I am a working guy i need to implement a web related application that should get data from AS400 via VPN. Thanks & Regards, Krishna Reply
irum
irum says: June 01, 2017 at 12:17 am
please give me a code of deep learning Reply
Faizan Shaikh
Faizan Shaikh says: June 15, 2017 at 7:15 pm
You can refer this article for a basic understanding of deep learning from scratch https://www.analyticsvidhya.com/blog/2017/05/neural-network-from-scratch-in-python-and-r/ Reply
Faizan Shaikh
Faizan Shaikh says: June 15, 2017 at 7:17 pm
You can refer this article for getting started with data science from scratch in python https://www.analyticsvidhya.com/blog/2016/01/complete-tutorial-learn-data-science-python-scratch-2/ Reply
Anand Devulapalli
Anand Devulapalli says: June 21, 2017 at 2:05 pm
Very interesting and for a layman like me - was able to at least understand it at a concept level . Reply
Faizan Shaikh
Faizan Shaikh says: July 08, 2017 at 6:07 pm
Thanks Anand Reply
Sree gowri Addepalli
Sree gowri Addepalli says: July 18, 2017 at 12:41 pm
It was a great article and it gave a crystal clear explanation! Thanks a lot! Reply
Chloe
Chloe says: July 26, 2017 at 8:08 pm
Excellent explanation! Do you mind if I translate into my mother language and post in on my blog? I will mention that it is your article and put the link on it. I want to share this article because it is great explanation about machine learning and deep learning. Reply
Faizan Shaikh
Faizan Shaikh says: August 17, 2017 at 4:32 pm
Thanks! Reply
Faizan Shaikh
Faizan Shaikh says: August 17, 2017 at 4:38 pm
Of course if it helps you! Reply
Minakshi
Minakshi says: August 29, 2017 at 9:54 am
Thnks a tonn. It was of gr8 help as a beginner. Reply
Faizan Shaikh
Faizan Shaikh says: August 30, 2017 at 7:29 pm
You are welcome Minakshi Reply
Utkarsh Pandya
Utkarsh Pandya says: September 27, 2017 at 7:50 pm
Good article for beginners. Suggest to add some real life example of ML and DL to understand better. Reply
pj
pj says: October 01, 2017 at 7:32 am
good work.. was confused with both the terms.. so deep learning for larger data, bigger processor,etc ..also a bit diffent approch Reply
Ankita Naik
Ankita Naik says: October 05, 2017 at 11:35 am
Hey Faizan, an excellent article. At the end of the article you have mentioned that you follow Machine learning and deep learning blogs to keep yourself updated. Could you suggest some blogs I could also follow? Keeping abreast with recent happenings is one essential issue I am currently facing. Reply
abdul
abdul says: October 09, 2017 at 12:44 pm
hey shaikh... what a clear explanation...by your post i have my doubt.........is their any dependency among DL and ML ...will u explain with example Reply
Tahir Hashmi
Tahir Hashmi says: October 19, 2017 at 2:31 am
Thanks Faizan. It helped me a lot in clarifying entangled concepts regarding ML and DL. Reply
Faizan Shaikh
Faizan Shaikh says: November 16, 2017 at 5:42 pm
Hey, as I explained in the article - DL is essestially a subpart of ML. So everything that DL can do, ML can do too Reply
Faizan Shaikh
Faizan Shaikh says: November 16, 2017 at 5:49 pm
Hey - the best and the purest resource to keep yourself updated is through research papers. Something like https://arxiv.org/ might be a good starting point Reply
Faizan Shaikh
Faizan Shaikh says: November 16, 2017 at 5:50 pm
Excellent summarization! Reply
Faizan Shaikh
Faizan Shaikh says: November 16, 2017 at 5:52 pm
Thanks for the suggestion Reply
Abha
Abha says: November 29, 2017 at 12:42 pm
It helped me a lot. Thanks! Reply
Manar
Manar says: December 26, 2017 at 5:47 am
Thanks, great clarification. Reply

Leave a Reply Your email address will not be published. Required fields are marked *