Data Science | AI | DataOps | Engineering
backgroundGrey.png

Blog

Data Science & Data Engineering blogs

Understanding The Difference Between AI, ML, And DL: Using An Incredibly Simple Example

 
 

I debated whether to write this piece for a long time. This was due to several factors.

At a recent AI conference, I was asked to define Artificial Intelligence. I was initially taken aback as I would never expect someone attending an AI conference to ask what the meaning of AI is.  

However, after digesting his question and trying to formulate a clear answer, I realised the meaning of AI had not been clearly communicated by the community.

After several conversations with various people, I realised that he wasn’t the only person who did not understand Artificial Intelligence (AI) and its bedfellows, Machine Learning (ML) and Deep Learning (DL). I have even conducted a survey by asking 10 friends from various backgrounds if they knew the meaning and difference of these terms. My survey yielded ten distinct responses.

In addition, I have realised that these terms are frequently used interchangeably in social media when, in fact, they are all very different things.

What do the terms AI, ML and DL mean? How do they relate to each other?

This article aims to explain the terms and the differences using simple examples.

“A picture is worth a thousand words.”

Let’s start with a diagram.

The image below shows concentric circles demonstrating how AI, ML and DL relate to each other. The three technologies are connected in the same way that Russian Dolls are nested; each technology is essentially a subset of the preceding technology. AI is the largest “matryoshka,” whereas DL is the smallest.

 
 

Formal Definitions of Artificial Intelligence (AI), Machine Learning (ML), Deep Learning (DL)

What is Artificial Intelligence (AI)?

AI is a broad field that includes ML and DL.

There are many formal definitions available for AI. For example, the Oxford English Dictionary defines AI as: “The theory and development of computer systems able to perform tasks normally requiring human intelligence.”

Merriam-Webster on the other hand defines AI as: “A branch of computer science dealing with the simulation of intelligent behaviour in computers.”

However, one of my favourite definitions is by François Chollet, creator of Keras, who defined it in simplistic terms. He described AI as “the effort to automate intellectual tasks normally performed by humans”.

What is Machine Learning (ML)?

One of the pioneers of ML, Arthur Samuel, defined it as a “field of study that gives computers the ability to learn without being explicitly programmed”.

As shown in the diagram, ML is a subset of AI which means all ML algorithms are classified as being part of AI. However, it doesn’t work the other way and it is important to note that not all AI based algorithms are ML. This is analogous to how a square is a rectangle but not every rectangle is a square.

So, how is ML different to AI?

The key difference between AI and ML is that ML allows systems to automatically learn and improve from their experiences through data without being explicitly programmed.

What is Deep Learning?

DL is ML taken to the next level. It is a subset of ML that is inspired by how human brains work. Typically, when people use the term deep learning, they refer to deep artificial neural networks. DL effectively teaches computers to do what humans naturally do: learning by example.  

So, how is DL different to ML?

The differences between DL and ML are summarised in the table below.

  Machine Learning Deep Learning
Data Performs well on small to medium datasets Performs well on large datasets
Hardware Able to function on CPU Requires significant computing power e.g., GPU
Features Features need to be manually identified Learns features automatically
Training time Quick to train Computationally intensive

Although formal definitions are widely available and accessible, it is sometimes difficult to relate each definition to an example. So, I thought long and hard for a simple example that my 10-year-old could read and understand.

Let’s look at a simple example of how AI, ML, and DL terminologies relate to a real-world situation.

AI, ML and DL explained using an example

Mark owns a small firm that specialises in sorting fruits into different categories. The fruits are brought into the sorting plant all mixed up. The fruits must be separated and packaged into cardboard fruit trays and then shipped to local supermarkets. Bananas, apples, and oranges are among the fruits that need to be sorted.

Initially, Mark uses human labour, with employees sorting fruits based on their knowledge of what each fruit is or inspecting its label. This works well, but the business is expanding, and the throughput of the sorting plant is limited by the speed of the workforce. To overcome this, an automated system using AI is proposed to tackle this problem.

Artificial Intelligence:

An AI-based algorithm is created that segregates the fruits using decision logic within a rule-based engine. For example, if an apple is on the conveyor belt, a scanner would scan the label, informing the AI algorithm that the fruit is indeed an apple. Then the apple would be routed to the apple fruit tray via sorting rollers/arms.

Mark’s fruit sorting plant that uses AI technology to separate fruits into its respective groups.

The success of the AI-based system hinges upon the fruit being correctly labelled by the fruit pickers and having a scanning system in place that can inform the algorithm of what the fruit is.  Here, Mark utilises an AI-based system to automate intellectual tasks generally performed by humans. As this system is based upon a rule-based engine that has been hard coded by humans, it is an example of AI without ML.

With the increased throughput, the business has expanded, and the fruit supply is now coming from multiple sources where most of the fruits are not labelled. This has now provoked the need for a system to be more advanced.

Machine Learning:

Figure showing an illustration of traditional machine learning where features are manually extracted and provided to the algorithm.

An ML-based algorithm is now proposed to solve the problem of fruit sorting by enhancing the AI-based approach when labels are not present.

To create a ML model, a definition of what each fruit looks like is required: this is termed feature extraction. To do this, features and attributes that characterise each fruit are used to create a blueprint. Features such as sizes, colours, shapes, etc., are extracted and used to train the algorithm to classify the fruits accordingly.  

For example, once the ML algorithm has seen what a banana looks like many times, i.e., has been trained, when a new fruit is presented, it can then compare the attributes against the learned features to classify the fruit.

The algorithm provides a degree of confidence, which can then be used to determine whether the fruit is classified as a banana or not and routed on the conveyor belt accordingly. The system can now automatically classify fruits based on what it has learned.

The business has been doing so well at improving the throughput of the sorting plant. It has cut costs and put local competitors out of business, taking over their fruit quota. It now needs to sort even more fruit, but this time fruit it has never seen before and with an added requirement of higher classification accuracy. This has provoked discussions around DL.

Deep Learning:

A DL-based algorithm is now proposed to solve the problem of sorting any fruit by totally removing the need for defining what each fruit looks like.  

The main advantage of the DL model is that it does not necessarily need to be provided with features to classify the fruits correctly.

By providing the DL model with lots of images of the fruits, it will build up a pattern of what each fruit looks like. The images will be processed through different layers of neural network within the DL model. Then each network layer will define specific features of the images, like the shape of the fruits, size of the fruits, colour of the fruits, etc. A DL based model, however, comes at a considerable upfront cost of requiring significant computational power and vast amounts of data.

This is similar to how our brains work to classify objects. Our brains process data through many layers of neurons and then finds the appropriate identifiers to classify objects. In this example, the DL model will group the fruits into their respective fruit trays based on their statistical similarities. 

Wrapping up

All the three terms AI, ML and DL are often used interchangeably and at times can be confusing. Hopefully, this article has provided clarity on the meaning and differences of AI, ML and DL. In summary, AI is a very broad term used to describe any system that can perform tasks that usually require the intelligence of a human. ML is a subset of AI whilst DL is a subset of ML algorithms.