Unit 1
Unit 1
Artificial Intelligence, Machine Learning, and Deep Learning have become the most talked-about technologies in
today’s commercial world as companies are using these innovations to build intelligent machines and applications.
And although these terms are dominating business dialogues all over the world, many people have difficulty
differentiating between them. This blog will help you gain a clear understanding of AI, machine learning, and deep
learning and how they differ from one another.
Before jumping into the technicalities, let’s look at what tech influencers, industry personalities, and authors have to
say about these three concepts.
“AI doesn't have to be evil to destroy humanity – if AI has a goal and humanity just happens in the way, it will
destroy humanity as a matter of course without even thinking about it, no hard feelings.” – Elon Musk, Technology
Entrepreneur, and Investor.
“Artificial Intelligence, deep learning, machine learning — whatever you’re doing if you don’t understand it — learn
it. Because otherwise, you’re going to be a dinosaur within 3 years.” - Mark Cuban, American entrepreneur, and
television personality.
“In deep learning, the algorithms we use now are versions of the algorithms we were developing in the 1980s, the
1990s. People were very optimistic about them, but it turns out they didn’t work too well.” - Geoffrey Hinton, Father
of Deep Learning
The three terms are often used interchangeably, but they do not quite refer to the same things.
Here is an illustration designed to help us understand the fundamental differences between artificial intelligence,
machine learning, and deep learning.
Machine Learning is a subset of artificial intelligence that helps you build AI-driven applications.
Deep Learning is a subset of machine learning that uses vast volumes of data and complex algorithms to train a
model.
Now, let’s explore each of these technologies in detail.
Amazon Echo is a smart speaker that uses Alexa, the virtual assistant AI technology developed by Amazon. Amazon
Alexa is capable of voice interaction, playing music, setting alarms, playing audiobooks, and giving real-time
information such as news, weather, sports, and traffic reports.
As you can see in the illustration below, the person wants to know the current temperature in Chicago. The person’s
voice is first converted into a machine-readable format. The formatted data is then fed into the Amazon Alexa
system for processing and analyzing. Finally, Alexa returns the desired voice output via Amazon Echo.
Now that you’ve been given a simple introduction to the basics of artificial intelligence, let’s have a look at
its different types.
Limited Memory - These systems reference the past, and information is added over a period of time. The referenced
information is short-lived.
Theory of Mind - This covers systems that are able to understand human emotions and how they affect decision
making. They are trained to adjust their behavior accordingly.
Self-awareness - These systems are designed and created to be aware of themselves. They understand their own
internal states, predict other people’s feelings, and act appropriately.
Now that we have gone over the basics of artificial intelligence, let’s move on to machine learning and see how it
works.
As per McKinsey & Co., machine learning is based on algorithms that can learn from data without relying on rules-
based programming.
Tom Mitchell’s book on machine learning 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.”
So you see, machine learning has numerous definitions. But how does it really work?
Now that you have been introduced to the basics of machine learning and how it works, let’s see the different types
of machine learning methods.
1. Supervised Learning
In supervised learning, the data is already labeled, which means you know the target variable. Using this method of
learning, systems can predict future outcomes based on past data. It requires that at least an input and output variable
be given to the model for it to be trained.
Below is an example of a supervised learning method. The algorithm is trained using labeled data of dogs and cats.
The trained model predicts whether the new image is that of a cat or a dog.
Some examples of supervised learning include linear regression, logistic regression, support vector machines, Naive
Bayes, and decision tree.
2. Unsupervised Learning
Unsupervised learning algorithms employ unlabeled data to discover patterns from the data on their own. The
systems are able to identify hidden features from the input data provided. Once the data is more readable, the
patterns and similarities become more evident.
Below is an example of an unsupervised learning method that trains a model using unlabeled data. In this case, the
data consists of different vehicles. The purpose of the model is to classify each kind of vehicle.
Some examples of unsupervised learning include k-means clustering, hierarchical clustering, and anomaly detection.
3. Reinforcement Learning
The goal of reinforcement learning is to train an agent to complete a task within an uncertain environment. The
agent receives observations and a reward from the environment and sends actions to the environment. The reward
measures how successful action is with respect to completing the task goal.
Examples of reinforcement learning algorithms include Q-learning and Deep Q-learning Neural Networks.
Product recommendations
Now that we’ve explored machine learning and its applications, let’s turn our attention to deep learning, what it is,
and how it is different from AI and machine learning.
The network has an input layer that accepts inputs from the data. The hidden layer is used to find any hidden
features from the data. The output layer then provides the expected output.
Here is an example of a neural network that uses large sets of unlabeled data of eye retinas. The network model is
trained on this data to find out whether or not a person has diabetic retinopathy.
Now that we have an idea of what deep learning is, let’s see how it works.
3. The activation function takes the “weighted sum of input” as the input to the function, adds a bias, and decides
whether the neuron should be fired or not.
4. The output layer gives the predicted output.
5. The model output is compared with the actual output. After training the neural network, the model uses the
backpropagation method to improve the performance of the network. The cost function helps to reduce the error
rate.
In the following example, deep learning and neural networks are used to identify the number on a license plate. This
technique is used by many countries to identify rules violators and speeding vehicles.
Types of Deep Neural Networks
Convolutional Neural Network (CNN) - CNN is a class of deep neural networks most commonly used for image
analysis.
Recurrent Neural Network (RNN) - RNN uses sequential information to build a model. It often works better for
models that have to memorize past data.
Generative Adversarial Network (GAN) - GAN are algorithmic architectures that use two neural networks to create
new, synthetic instances of data that pass for real data. A GAN trained on photographs can generate new
photographs that look at least superficially authentic to human observers.
Deep Belief Network (DBN) - DBN is a generative graphical model that is composed of multiple layers of latent
variables called hidden units. Each layer is interconnected, but the units are not.
Music generation
Image coloring
Object detection
Types of Machine Learning
Machine learning is a subset of AI, which enables the machine to automatically
learn from data, improve performance from past experiences, and make
predictions. Machine learning contains a set of algorithms that work on a huge amount
of data. Data is fed to these algorithms to train them, and on the basis of training, they
build the model & perform a specific task.
Based on the methods and way of learning, machine learning is divided into mainly four
types, which are:
In this topic, we will provide a detailed description of the types of Machine Learning
along with their respective algorithms:
The main goal of the supervised learning technique is to map the input variable(x)
with the output variable(y). Some real-world applications of supervised learning
are Risk Assessment, Fraud Detection, Spam filtering, etc.
o Classification
o Regression
a) Classification
Classification algorithms are used to solve the classification problems in which the
output variable is categorical, such as "Yes" or No, Male or Female, Red or Blue, etc.
The classification algorithms predict the categories present in the dataset. Some real-
world examples of classification algorithms are Spam Detection, Email filtering, etc.
Regression algorithms are used to solve regression problems in which there is a linear
relationship between input and output variables. These are used to predict continuous
output variables, such as market trends, weather prediction, etc.
o Since supervised learning work with the labelled dataset so we can have an exact
idea about the classes of objects.
o These algorithms are helpful in predicting the output on the basis of prior
experience.
Disadvantages:
o Image Segmentation:
Supervised Learning algorithms are used in image segmentation. In this process,
image classification is performed on different image data with pre-defined labels.
o Medical Diagnosis:
Supervised algorithms are also used in the medical field for diagnosis purposes. It
is done by using medical images and past labelled data with labels for disease
conditions. With such a process, the machine can identify a disease for the new
patients.
o Fraud Detection - Supervised Learning classification algorithms are used for
identifying fraud transactions, fraud customers, etc. It is done by using historic
data to identify the patterns that can lead to possible fraud.
o Spam detection - In spam detection & filtering, classification algorithms are
used. These algorithms classify an email as spam or not spam. The spam emails
are sent to the spam folder.
o Speech Recognition - Supervised learning algorithms are also used in speech
recognition. The algorithm is trained with voice data, and various identifications
can be done using the same, such as voice-activated passwords, voice
commands, etc.
In unsupervised learning, the models are trained with the data that is neither classified
nor labelled, and the model acts on that data without any supervision.
The main aim of the unsupervised learning algorithm is to group or categories the
unsorted dataset according to the similarities, patterns, and differences. Machines
are instructed to find the hidden patterns from the input dataset.
So, now the machine will discover its patterns and differences, such as colour difference,
shape difference, and predict the output when it is tested with the test dataset.
Categories of Unsupervised Machine Learning
Unsupervised Learning can be further classified into two types, which are given below:
o Clustering
o Association
1) Clustering
The clustering technique is used when we want to find the inherent groups from the
data. It is a way to group the objects into a cluster such that the objects with the most
similarities remain in one group and have fewer or no similarities with the objects of
other groups. An example of the clustering algorithm is grouping the customers by their
purchasing behaviour.
2) Association
Some popular algorithms of Association rule learning are Apriori Algorithm, Eclat, FP-
growth algorithm.
Disadvantages:
3. Semi-Supervised Learning
Semi-Supervised learning is a type of Machine Learning algorithm that lies
between Supervised and Unsupervised machine learning. It represents the
intermediate ground between Supervised (With Labelled training data) and
Unsupervised learning (with no labelled training data) algorithms and uses the
combination of labelled and unlabeled datasets during the training period.
Disadvantages:
4. Reinforcement Learning
Reinforcement learning works on a feedback-based process, in which an AI agent
(A software component) automatically explore its surrounding by hitting & trail,
taking action, learning from experiences, and improving its performance. Agent
gets rewarded for each good action and get punished for each bad action; hence the
goal of reinforcement learning agent is to maximize the rewards.
In reinforcement learning, there is no labelled data like supervised learning, and agents
learn from their experiences only.
The reinforcement learning process is similar to a human being; for example, a child
learns various things by experiences in his day-to-day life. An example of reinforcement
learning is to play a game, where the Game is the environment, moves of an agent at
each step define states, and the goal of the agent is to get a high score. Agent receives
feedback in terms of punishment and rewards.
Due to its way of working, reinforcement learning is employed in different fields such
as Game theory, Operation Research, Information theory, multi-agent systems.
o Video Games:
RL algorithms are much popular in gaming applications. It is used to gain super-
human performance. Some popular games that use RL algorithms
are AlphaGO and AlphaGO Zero.
o Resource Management:
The "Resource Management with Deep Reinforcement Learning" paper showed
that how to use RL in computer to automatically learn and schedule resources to
wait for different jobs in order to minimize average job slowdown.
o Robotics:
RL is widely being used in Robotics applications. Robots are used in the industrial
and manufacturing area, and these robots are made more powerful with
reinforcement learning. There are different industries that have their vision of
building intelligent robots using AI and Machine learning technology.
o Text Mining
Text-mining, one of the great applications of NLP, is now being implemented
with the help of Reinforcement Learning by Salesforce company.
Disadvantage
o Noisy Data- It is responsible for an inaccurate prediction that affects the decision
as well as accuracy in classification tasks.
o Incorrect data- It is also responsible for faulty programming and results
obtained in machine learning models. Hence, incorrect data may affect the
accuracy of the results also.
o Generalizing of output data- Sometimes, it is also found that generalizing
output data becomes complex, which results in comparatively poor future
actions.
2. Poor quality of data
As we have discussed above, data plays a significant role in machine learning, and it
must be of good quality as well. Noisy data, incomplete data, inaccurate data, and
unclean data lead to less accuracy in classification and low-quality results. Hence, data
quality can also be considered as a major common problem while processing machine
learning algorithms.
Further, if we are using non-representative training data in the model, it results in less
accurate predictions. A machine learning model is said to be ideal if it predicts well for
generalized cases and provides accurate decisions. If there is less training data, then
there will be a sampling noise in the model, called the non-representative training set. It
won't be accurate in predictions. To overcome this, it will be biased against one class or
a group.
Hence, we should use representative data in training to protect against being biased
and make accurate predictions without any drift.
Overfitting is one of the most common issues faced by Machine Learning engineers and
data scientists. Whenever a machine learning model is trained with a huge amount of
data, it starts capturing noise and inaccurate data into the training data set. It negatively
affects the performance of the model. Let's understand with a simple example where we
have a few training data sets such as 1000 mangoes, 1000 apples, 1000 bananas, and
5000 papayas. Then there is a considerable probability of identification of an apple as
papaya because we have a massive amount of biased data in the training data set;
hence prediction got negatively affected. The main reason behind overfitting is using
non-linear methods used in machine learning algorithms as they build non-realistic data
models. We can overcome overfitting by using linear and parametric algorithms in the
machine learning models.
Methods to reduce overfitting:
Underfitting:
Underfitting occurs when our model is too simple to understand the base structure of
the data, just like an undersized pant. This generally happens when we have limited data
into the data set, and we try to build a linear model with non-linear data. In such
scenarios, the complexity of the model destroys, and rules of the machine learning
model become too easy to be applied on this data set, and the model starts doing
wrong predictions as well.
8. Customer Segmentation
Customer segmentation is also an important issue while developing a machine learning
algorithm. To identify the customers who paid for the recommendations shown by the
model and who don't even check them. Hence, an algorithm is necessary to recognize
the customer behavior and trigger a relevant recommendation for the user based on
past experience.
Bias refers to the error introduced by approximating a real-world problem, which may be
complex, by a simplified model. Variance refers to the model's sensitivity to small fluctuations in
the training data. Models with high bias tend to underfit the data, while models with high
variance tend to overfit the data. There's a balance to strike between bias and variance to achieve
good generalization to new, unseen data.
Model Complexity: Choosing the right level of model complexity is another tradeoff. Simple
models, like linear regression, may not capture intricate relationships in the data, while complex
models, like deep neural networks, may memorize noise and overfit. A more complex model can
better fit the training data, but it might struggle to generalize to new data points. Regularization
techniques can help control model complexity.
Underfitting and Overfitting: These are two sides of the same coin. Underfitting occurs when a
model is too simple to capture the underlying patterns in the data. Overfitting occurs when a
model is too complex and fits the noise in the data. Balancing between these two extremes is
crucial for building a model that performs well on both training and test data.
Feature Selection vs. Feature Engineering: Deciding which features to include in a model is a
tradeoff. Including irrelevant or redundant features can lead to overfitting, while excluding
important features can lead to underfitting. Feature engineering involves creating new features
from existing ones, which can improve the model's performance, but also introduces complexity
and the potential for overfitting.
Interpretability vs. Performance: In many cases, more complex models offer better performance,
but they can be harder to interpret. Simple models like linear regression are highly interpretable,
while complex models like deep neural networks might provide excellent results but lack
transparency in their decision-making process.
Computational Complexity: More complex models often require more computational resources
and time for training and inference. Choosing a model that strikes a balance between
computational efficiency and predictive power is important, especially in real-time or resource-
constrained applications.
Data Quality vs. Model Performance: The quality of the input data significantly impacts the
performance of the model. Garbage in, garbage out. Cleaning and preprocessing data can be
time-consuming, but it's crucial for the model's effectiveness.
Training Set Size: The size of the training dataset affects model performance. With a small
dataset, complex models can overfit, while with a large dataset, they might perform better.
However, collecting and managing large datasets can be resource-intensive.
Model Selection: Choosing the right algorithm or model architecture is important. Different
algorithms have different strengths and weaknesses, and the choice depends on the nature of the
problem, the available data, and the desired outcomes.
Tradeoff in Evaluation Metrics: Depending on the problem, different evaluation metrics might be
relevant. For example, precision and recall are tradeoffs in binary classification problems, where
increasing one often leads to a decrease in the other.
Understanding these tradeoffs and making informed decisions about them is a key skill for
practitioners in the field of statistical learning and machine learning. It involves a mix of domain
knowledge, experimentation, and understanding the nuances of the specific problem at hand.