AI - Notes (Introduction To AI& AI Project Cycle)
AI - Notes (Introduction To AI& AI Project Cycle)
Intelligence
AI
Refers to any technique that enables computers to mimic human intelligence. It gives the ability to
machines to recognize a human’s face; to move and manipulate objects; to understand the voice
commands by humans, and also do other tasks. The AI-enabled machines think algorithmically and
execute what they have been asked for intelligently.
Self-Driving Cars
This is a concept developed under AI. AI can be used to create fully autonomous cars to travel between
destinations without a human operator.
Snapchat Filters
Snapchat filters are based on Machine Learning concept. They use augmented reality and machine
learning to enhance your selfies with flowers, cat ears spectacles etc.
Netflix
The Netflix recommendation system is powered by Machine Learning (ML) algorithms and that is what
makes their system so good in predicting the movies that you are most likely to watch, and show them as
suggestions to you.
Google Translate
Translating from one language (say English) to another language (say Spanish) is now just a click away; it
is using Deep Learning algorithms.
Introduction to AI Domains
AI models can be broadly categorised into three domains:
AI Ethics
Moral Issues: Self-Driving Cars
Scenario 1:
Let us imagine that we are in year 2030. Self-Driving cars which are just a concept in today’s time are now
on roads. People like us are buying them for ease and are using it for our daily transits. Of-course because
of all the features which this car has, it is expensive. Now, let us assume one day, your father is going to
office in his self-driving car. He is sitting in the back seat as the car is driving itself. Suddenly, a small boy
comes in front of this car. The incident was so sudden that the car is only able to make either of the two
choices:
1. Go straight and hit the boy who has come in front of the car and injure him severely.
2. Take a sharp right turn to save the boy and smash the car into a metal pole thus damaging the car as
well as injuring the person sitting in it.
With the help of this scenario, we need to understand that the developer of the car goes through all such
dilemmas while developing the car’s algorithm. Thus, here the morality of the developer gets transferred
into the machine as what according to him/her is right would have a higher priority and hence would be
the selection made by the machine.
Page 3 of 11
Here, the choices might differ from person to person and one must understand that nobody is wrong in
this case. Every person has a different perspective to look at things and hence he/she takes decisions
according to their moralities.
Data Privacy
The world of Artificial Intelligence revolves around Data. Every company whether small or big is mining
data from as many sources as possible. More than 70% of the data collected till now has been collected in
last 3 years which shows how important data has become in recent times.
One of the major sources of data for many major companies is the device which all of us have in our
hands all the time: Smartphones. Smartphones have nowadays become an integral part of our lives. Most
of us use smartphones more than interacting with people around us. Smartphones in today’s era provide
us with a lot of facilities and features which have made our lives easier.
Another feature of smartphones nowadays is that they provide us with customised recommendations and
notifications according to our choices.
Remember whenever you download an app and install it, it asks you for several permissions to access
your phone’s data in different ways. If you do not allow the app these permissions , you normally cannot
access it. And to access the app and make use of it, we sometimes don’t event give it a thought and allow
the app to get all the permissions that it wants. Hence every now and then, the app has the permission to
access various sensors which are there in your smartphone and gather data about you and your
surroundings. We forget that the smartphone which we use is a box full of sensors which are powered all
the time while the phone is switched on.
We need to understand that the data which is collected by various applications is ethical as the
smartphone users agree to it (by clicking on allow when it asks for permission and by agreeing to all the
terms and conditions). But at the same time if one does not want to share his/her data with anyone,
he/she can opt for alternative applications which are of similar usage and keep your data private
AI Bias
Another aspect to AI Ethics is bias.
When we talk about a machine, we know that it is artificial and cannot think on its own. It can have
intelligence but we cannot expect a machine to have any biases of its own. But any bias can transfer from
the developer to the machine while the algorithm is being developed. Let us look at some of the
examples:
1. Majorly, all the virtual assistants have a female voice. It is only now that some companies have
understood this bias and have started giving options for male voices but since the virtual assistants came
into practice, female voices are always preferred for them over any other voice. Can you think of some
reasons for this?
2. If you search on Google for salons, the first few searches are mostly for female salons. This is based on
the assumption that if a person is searching fora salon, in all probability it would be a female. Do you
think this is a bias? If yes, then is it a Negative bias or Positive one?
Various other biases are also found in various systems which are not thought up by the machine but have
got transferred from the developer intentionally or unintentionally.
Page 4 of 11
AI Access
Since Artificial Intelligence is still a budding technology, not everyone has the opportunity to access it. The
people who can afford AI enabled devices make the most of it while others who cannot are left behind.
AI creates unemployment
AI is making people’s lives easier. Most of the things nowadays are done in just a few clicks. In no time AI
will manage to be able to do all the laborious tasks which we humans have been doing since long.
Maybe in the coming years, AI enabled machines will replace all the people who work as labourers. This
may start an era of mass unemployment where people having less or no skills would be left without jobs
and others who keep up with their skills according to what is required would flourish.
Here, we need to understand that to overcome such an issue, one needs to be open to changes. As
technology is advancing with time, humans need to make sure that they are a step ahead and understand
this technology with its pros and cons.
AI for kids
As we all can see, kids nowadays are smart enough to understand technology from a very early age. As
their thinking capabilities increase, they start becoming techno-savvy and eventually they learn
everything more easily than an adult.
Page 5 of 11
Starting with Problem Scoping, you set the goal for your AI project by stating the problem which you wish
to solve with it. Under problem scoping, we look at various parameters which affect the problem we wish
to solve so that the picture becomes clearer.
Problem Scoping
It is a fact that we are surrounded by problems. They could be small or big, sometimes ignored or
sometimes even critical. Many times, we become so used to a problem that it becomes a part of our life.
Identifying such a problem and having a vision to solve it, is what Problem Scoping is about. A lot of times
we are unable to observe any problem in our surroundings.
Scoping a problem is not that easy as we need to have a deeper understanding around it so that the
picture becomes clearer while we are working to solve it. Hence, we use 4Ws Problem Canvas to help us
out.
Who?
What?
Where?
Why?
Who?
The “Who” block helps you in analysing the people getting affected directly or indirectly due
to it. Under this, you find out who the ‘Stakeholders’ to this problem are and what you know
about them. Stakeholders are the people who face this problem and would be benefitted
with the solution.
What?
Under the “What” block, you need to look into what you have on hand. At this stage, you
need to determine the nature of the problem. What is the problem and how do you know
Page 6 of 11
that it is a problem? Under this block, you also gather evidence to prove that the problem
you have selected actually exists. Newspaper articles, Media, announcements, etc are some
examples.
Where?
Now that you know who is associated with the problem and what the problem actually is;
you need to focus on the context/situation/location of the problem. This block will help you
look into the situation in which the problem arises, the context of it, and the locations where
it is prominent.
Why?
You have finally listed down all the major elements that affect the problem directly. Now it is
convenient to understand who the people that would be benefitted by the solution are; what
is to be solved; and where will the solution be deployed. These three canvases now become
the base of why you want to solve this problem. Thus in the “Why” canvas, think about the
benefits which the stakeholders would get from the solution and how would it benefit them
as well as the society.
The Problem Statement Template helps us to summarise all the key points into one single Template
so that in future, whenever there is need to look back at the basis of the problem, we can take a look
at the Problem Statement Template and understand the key elements of it.
Data Acquisition
As we move ahead in the AI Project Cycle, we come across the second element which is : Data
Acquisition. As the term clearly mentions, this stage is about acquiring data for the project. Let us
first understand what is data. Data can be a piece of information or facts and statistics collected
together for reference or analysis. Whenever we want an AI project to be able to predict an output,
we need to train it first using data.
For example, If you want to make an Artificially Intelligent system which can predict the salary of any
employee based on his previous salaries, you would feed the data of his previous salaries into the
machine. This is the data with which the machine can be trained. Now, once it is ready, it will predict
his next salary efficiently. The previous salary data here is known as Training Data while the next
salary prediction data set is known as the Testing Data.
For any AI project to be efficient, the training data should be authentic and relevant to the problem
statement scoped.
Data Features
Look at your problem statement once again and try to find the data features required to address this
issue. Data features refer to the type of data you want to collect.
There can be various ways in which you can collect data. Some of them are:
Surveys
Web Scraping
Sensors
Cameras
Page 7 of 11
Observations
API(Application Program Interface)
One of the most reliable and authentic sources of information, are the open-sourced websites
hosted by the government. These government portals have general information collected in suitable
format which can be downloaded and used wisely.
Data Exploration
In the previous modules, you have set the goal of your project and have also found ways to acquire
data. While acquiring data, you must have noticed that the data is a complex entity – it is full of
numbers and if anyone wants to make some sense out of it, they have to work some patterns out of
it.
Thus, to analyse the data, you need to visualise it in some user-friendly format so that you can:
● Quickly get a sense of the trends, relationships and patterns contained within the data.
● Define strategy for which model to use at a later stage.
● Communicate the same to others effectively. To visualise data, we can use various types of visual
representations.
Bar chart
Area Chart
Bubble chart
Pie chart
Visual
Representations
Bar Graphs
Modelling
In the previous module of Data exploration, we have seen various types of graphical representations
which can be used for representing different parameters of data. The graphical representation makes
the data understandable for humans as we can discover trends and patterns out of it. But when it
comes to machines accessing and analysing data, it needs the data in the most basic form of
numbers (which is binary – 0s and 1s) and when it comes to discovering patterns and trends in data,
the machine goes in for mathematical representations of the same. The ability to mathematically
describe the relationship between parameters is the heart of every AI model. Thus, whenever we talk
about developing AI models, it is the mathematical approach towards analysing data which we refer
to.
Generally, AI models can be classified as follows:
AI Models
1. Learning Based
Machine Learning
Deep Learning
2. Rule Based
Rule Based Approach
Refers to the AI modelling where the rules are defined by the developer. The machine follows the
rules or instructions mentioned by the developer and performs its task accordingly. For example, you
have a dataset which tell you about the conditions on the basis of which one can decide if an
elephant may be spotted or not while on safari. The parameters are Outlook, Temperature, Humidity
and Wind. Now, you take various possibilities of these parameters and see in which case the
elephant may be spotted and in which case it may not. After looking through all the cases, you feed
this data in to the machine along with the rules which tell the machine all the possibilities. The
Page 8 of 11
machine trains on this data and now is ready to be tested. While testing the machine, you tell the
machine that Outlook = Overcast, Temperature = Normal, Humidity = Normal and Wind = Weak. On
the basis of this testing dataset now the machine will if the elephant has been spotted before or not
and will display the prediction to you. This is known as a rule-based approach because you fed the
data along with rules to the machine and the machine after getting trained on them is now able to
predict answers for the same.
A drawback/feature for this approach is that the learning is static. The machine once trained, does
not take into consideration any changes made in the original training dataset.
Learning Based Approach
Refers to the AI modelling where the machine learns by itself. Under the Learning Based approach,
the AI model gets trained on the data fed to it and then is able to design a model which is adaptive to
the change in data. That is, if the model is trained with X type of data and the machine designs the
algorithm around it, the model would modify itself according to the changes which occur in the data
so that all the exceptions are handled in this case. For example, suppose you have a dataset
comprising of 100 images of apples and bananas each. These images depict apples and bananas in
various shapes and sizes. These images are then labelled as either apple or banana so that all apple
images are labelled ‘apple’ and all the banana images have ‘banana’ as their label. Now, the AI model
is trained with this dataset and the model is programmed in such a way that it can distinguish
between an apple image and a banana image according to their features and can predict the label of
any image which is fed to it as an apple or a banana. After training, the machine is now fed with
testing data. Now, the testing data might not have similar images as the ones on which the model
has been trained. So, the model adapts to the features on which it has been trained and accordingly
predicts if the image is of an apple or banana. In this way, the machine learns by itself by adapting to
the new data which is flowing in.
The learning-based approach can further be divided into three parts:
Supervised Learning
Unsupervised Learning
Reinforcement Learning
Supervised Learning
In a supervised learning model, the dataset which is fed to the machine is labelled. In other words, we can
say that the dataset is known to the person who is training the machine only then he/she is able to label
the data. A label is some information which can be used as a tag for data. For example, students get
grades according to the marks they secure in examinations.
There are two types of Supervised Learning models:
Classification: Where the data is classified according to the labels. For example, in the grading system,
students are classified on the basis of the grades they obtain with respect to their marks in the
examination. This model works on discrete dataset which means the data need not be continuous.
Regression: Such models work on continuous data. For example, if you wish to predict your next salary,
then you would put in the data of your previous salary, any increments, etc and would train the model.
Here, the data which has been fed to the machine is continuous.
Unsupervised Learning
An unsupervised learning model works on unlabelled dataset. This means that the data which is fed to
the machine is random and there is a possibility that the person who is training the model does not have
any information regarding it. The unsupervised learning models are used to identify relationships,
patterns and trends out of the data which is fed into it. It helps the user in understanding what the data is
about and what are the major features identified by the machine in it.
For example, you have a random data of 1000 dog images and you wish to understand some pattern out
of it, you would feed this data into the unsupervised learning model and would train the machine on it.
After training, the machine would come up with patterns which it was able to identify out of it. The
Page 9 of 11
Machine might come up with patterns which are already known to the user like colour or it might even
come up with something very unusual like the size of the dogs.
Unsupervised learning models can be further divided into two categories:
Clustering: Refers to the unsupervised learning algorithm which can cluster the unknown data according
to the patterns or trends identified out of it. The patterns observed might be the ones which are known to
the developer or it might even come up with some unique patterns out of it.
Dimensionality Reduction: We humans are able to visualise upto 3-Dimensions only but according to a
lot of theories and algorithms, there exists various entities which exist beyond 3-Dimensions. For
example, in Natural language Processing, the words are considered to be N-Dimensional entities. Which
means that we cannot visualise them as they exist beyond our visualisation ability. Hence, to make sense
out of it, we need to reduce their dimensions. Here, dimensionality reduction algorithm is used.
As we reduce the dimension of an entity, the information which it contains starts getting distorted. For
example, If you have a ball in your hand, it is 3-Dimensions right now. But if you click its picture, the data
transforms to 2-D as an image is a 2-Dimensional entity. Now, as soon as you reduce one dimension, at
least 50% of the information is lost as now you will not know about the back of the ball. Whether the ball
was of same colour at the back or not? Or was it just a hemisphere? If you reduce the dimensions further,
more and more information would get lost.
Hence, to reduce the dimensions and still be able to make sense out of the data, we use Dimensionality
Reduction.
Reinforcement Learning(RL)
Reinforcement Learning(RL) is a type of machine learning technique that enables an agent to learn in an
interactive environment by trial and error using feedback from its own actions and experiences.
Evaluation
Once a model has been made and trained, it needs to go through proper testing so that one can calculate
the efficiency and performance of the model. Hence, the model is tested with the help of Testing Data
(which was separated out of the acquired dataset at Data Acquisition stage) and the efficiency of the
model is calculated on the basis of the parameters mentioned below:
Accuracy
Precision
Recall
F1 Score
Neural Networks
Neural networks are loosely modelled after how neurons in the human brain behave. The key
advantage of neural networks, are that they are able to extract data features automatically without
needing the input of the programmer. A neural network is essentially a system of organizing machine
learning algorithms to perform certain tasks. It is a fast and efficient way to solve problems for which
the dataset is very large, such as in images.
Page 10 of 11
This is a representation of how neural networks work. A Neural Network is divided into multiple
layers and each layer is further divided into several blocks called nodes. Each node has its own task
to accomplish which is then passed to the next layer. The first layer of a Neural Network is known as
the input layer. The job of an input layer is to acquire data and feed it to the Neural Network. No
processing occurs at the input layer. Next to it, are the hidden layers? Hidden layers are the layers in
which the whole processing occurs. Their name essentially means that these layers are hidden and
are not visible to the user.
Page 11 of 11