AI Module 1
AI Module 1
➢ According to the father of Artificial Intelligence, John McCarthy, it is “The science and
engineering of making intelligent machines, especially intelligent computer programs”.
➢ The term "artificial intelligence" is used to describe machines that mimic "cognitive”
functions that humans associate with other human minds, such as "learning" and "problem
solving”.
➢ AI is the branch of computer science that is concerned with the automation of intelligent
behavior
➢ AI is the part of computer science concerned with designing intelligent computer systems,
that is, computer systems that exhibit the characteristics we associate with intelligence in
human behavior such as understanding language, learning, reasoning and solving problems.
➢ AI is the exciting new effort to make computers think machines with minds, in the full and
literal sense
➢ AI is the study of the computations that make it possible to perceive, reason, and act.
AI has three different levels:
➢ Narrow AI: Artificial intelligence is said to be narrow when the machine can perform a
specific task better than a human. The current research of AI is here now.
➢ General AI: Artificial intelligence reaches the general state when it can perform any
intellectual task with the same accuracy level as a human would.
➢ Strong AI: Artificial intelligence is strong when it can beat humans in many tasks.
1
Goals of AI
• To Create Expert Systems − The systems which exhibit intelligent behavior, learn,
demonstrate, explain, and advice its users.
• General-purpose AI like the robots of science fiction is incredibly hard Human brain appears
to have lots of special and general functions, integrated in some amazing way that we really
do not understand at all (yet).
HISTORY OF AI
Artificial Intelligence is not a new word and not a new technology for researchers. This
technology is much older than you would imagine. Even there are the myths of Mechanical
men in Ancient Greek and Egyptian Myths. Following are some milestones in the history of
AI which defines the journey from the AI generation to till date development.
• 1943: early beginnings McCulloch & Pitts: Boolean circuit model of brain
• 1950: Turing Turing's "Computing Machinery and Intelligence“
• 1950s: initial promise Early AI programs, including
o Samuel's checkers program
o Newell & Simon's Logic Theorist
• 1956: birth of AI Dartmouth meeting: "Artificial Intelligence“ name adopted
• 1955-65: “great enthusiasm”
o Newell and Simon: GPS, general problem solver
o Gelertner: Geometry Theorem Prover
o McCarthy: invention of LISP - History of AI
• 1966—73: Reality dawns
o Realization that many AI problems are intractable.
o Limitations of existing neural network methods identified
• 1969—85: Adding domain knowledge
2
o Development of knowledge-based systems
o Success of rule-based expert systems, E.g., DENDRAL,
MYCIN
• But were brittle and did not scale well in practice
• 1986 - Rise of machine learning
o Neural networks return to popularity
o Major advances in machine learning algorithms and applications
• 1990 - Role of uncertainty
o Bayesian networks as a knowledge representation
framework.
• 1995 - AI as Science
o Integration of learning, reasoning, knowledge
representation
• 1995 –2011 Intelligent agents
• 2011–present: Deep learning, big data and artificial general intelligence
• Latest Achievements in AI (2018)
• Alibaba language processing AI outscores top humans at a Stanford University reading
and comprehension test, scoring 82.44 against 82.304 on a set of 100,000 questions.
• Announcement of Google Duplex, a service to allow an AI assistant to book appointments
over the phone.
• The LA Times judges the AI's voice to be a "nearly flawless"imitation of human-sounding
speech.
3
APPROACHES TO AI
• AI is: “The automation of activities that we associate with human thinking, activities such as
decision-making, problem solving, learning." (Bellman, 1978)
• Goal is to build systems that function internally in some way similarto human mind.
Cognitive Intelligence: Workings of the human mind
• Traditional computer game players typically work much differentlythan human players
4
❖ Approach 2: Acting Humanly
• "The art of creating machines that perform functions that require intelligence when
performed by people." (Kurzweil,1990)
• "The study of how to make computers do things at which, at the moment, people are
better." (Rich and Knight, 1991)
• Automated reasoning: to use the stored information to answer questions and to draw new
conclusions.
• Intelligence takes many forms, which are not necessarily best tested this way.
• AI is: "The study of mental faculties through the use of computational models.“ (Chamiak
and McDermott, 1985).
• "The study of the computations that make it possible to perceive,reason, and act.”
(Winston, 1992).
5
• Rational agent is one that acts so as to achieve the best outcome or,when there is
uncertainty, the best expected outcome.
• More general: rather than imitating humans trying to solve hardproblems, just try to solve
hard problems.
Advantages of Artificial Intelligence
• High Accuracy with less errors
• High-Speed
• High reliability
• Useful for risky areas
• Digital Assistant
• Useful as a public utility
Disadvantages of Artificial Intelligence
• High Cost
• Can't think out of the box
• No feelings and emotions
• Increase dependency on machines
• No Original Creativity
APPLICATIONS OF AI
6
delivering logical responses towards human speech or query.
• The natural language processing focus on both the verbal and written section of human
languages means both active and passive modes of using algorithms.
• The Natural Language Generation (NLG) will process and decode the sentences and
words that humans used to speak (verbal communication) while the Natural Language
Understanding (NLU) will emphasize the written vocabulary to translate the language
in the text or pixels which can be understood by machines.
• The Graphical User Interfaces (GUI) based applications of the machines are the best
exampleof natural language processing
2. Machine Learning
• Machine learning is a feature of artificial intelligence that provides the computer with
the capability to automatically gather data and learn from the experience of the
problems or casesthey have encountered rather than specially programmed to perform
the given task or work.
• The machine learning emphasizes the growth of the algorithms which can scrutinize
the data and make predictions of it. The main use of this is in the healthcare industry
where it is used for diagnosis of the disease, medical scan interpretation, etc.
3. Pattern recognition
4. Deep learning
• It is the process of learning by processing and analyzing the input data by several
methods untilthe machine discovers the single desirable output.
• It is also known as the self-learning of the machines.
• The machine runs various random programs and algorithms to map the input raw
sequence ofinput data to output.
5. Neural Networks
• The neural networks are the brain of artificial intelligence.
• They are the computer systems which are the replica of the neural connections in the
7
human brain.
• The artificial corresponding neurons of the brain are known as the perceptron.
• The stack of various perceptron joining together makes the artificial neural networks
in the machines. Before giving a desirable output, the neural networks gain knowledge
by processingvarious training examples.
• With the use of different learning models, this process of analyzing data will also
give asolution for many associated queries that were unanswered previously.
• Deep learning in association with the neural networks can unfold the multiple layers of
hidden data including the output layer of complex problems and is an aide for the
subfields like speech recognition, natural language processing, and computer vision,
etc.
6. Expert Systems
There are some applications which integrate machine, software, and special information to
impart reasoning and advising. They provide explanation and advice to the users.
7. Vision System
• The computer vision is a very vital part of artificial intelligence as it facilitates the
computer toautomatically recognize, analyze, and interpret the visual data from the
real world images andvisuals by capturing and intercepting them.
• It incorporates the skills of deep learning and pattern recognition to extract the
content of images from any data given, including images or video files within PDF
document, Word document, PPT document, XL file, graphs, and pictures, etc.
• Suppose we have a complex image of a bundle of things then only seeing the
image and memorizing it is not easily possible for everyone. The computer vision
can incorporate a seriesof transformations to the image to extract the bit and byte
detail about it like the sharp edges of the objects, unusual design or color used, etc.
• The application of this component is very vastly used in the healthcare industry to
8
analyze the health condition of the patient by using an MRI scan, X-ray, etc. Also
used in the automobile industry to deal with computer-controlled vehicles and
drones.
10. Intelligent Robots − Robots are able to perform the tasks given by a human. They have
sensors to detect physical data from the real world such as light, heat, temperature,
movement, sound, bump, and pressure. They have efficient processors, multiple sensors
and huge memory, to exhibit intelligence. In addition, they are capable of learning from
their mistakes and they can adapt to the new environment.
11. Gaming − AI plays crucial role in strategic games such as chess, poker, tic-tac-toe, etc.,
where machine can think of large number of possible positions based on heuristic
knowledge.
INTELLIGENT AGENTS
❖ INTELLIGENCE
Ability of a system to:
• calculate
• reason
• perceive relationships and analogies
• learn from experience
• solve problems, comprehend complex ideas
9
• classify, generalize
• adapt new situations
❖ AGENTS
• An agent is anything that can be viewed as perceiving its environment through sensors and
acting upon that environment through actuators
Operates in an environment
Perceive its environment through sensors
Acts upon its environment through actuators/ effectors
Has Goals
INTELLIGENT AGENTS
• An intelligent agent may learn from the environment to achieve their goals.
10
• Rule 4: The action taken by an AI agent must be a rational action.
➢ A thermostat is an example of an intelligent agent.
➢ Sensor and actuators
• An agent perceives its environment through sensors
• The complete set of inputs at a given time is called a percept
• The current percept or Sequence of percepts can influence theaction of an agent
This particular world has just two locations: squares A and B. The vacuum agent perceives
which square it is in and whether there is dirt in the square. It can choose to move left, move
right, suck up the dirt, or do nothing. One very simple agent function is the following: if the
current square is dirty, then suck; otherwise, move to the other square.
11
The Nature of Environments
12
perform as well as a human.
Turing Test
The success of an intelligent behavior of a system can be measured with Turing Test. Two
persons and a machine to be evaluated participate in the test. Out of the two persons, one
plays the role of the tester. Each of them sits in different rooms. The tester is unaware of
who is machine and who is a human. He interrogates the questions by typing and sending
them to both intelligences, to which he receives typed responses. This test aims at fooling
the tester. If the tester fails to determine machine's response from the human response,
then the machine is said to be intelligent.
Properties of Environment
The environment has multifold properties
a Discrete / Continuous - If there are a limited number of distinct, clearly defined, states of the
environment, the environment is discrete (For example, chess); otherwise it is continuous (For
example, driving).
a Observable / Partially Observable - If it is possible to determine the complete state of the
environment at each time point from the percepts it is observable; otherwise it is only partially
observable.
a Static I Dynamic - If the environment does not change while an agent is acting, then it is
static; otherwise it is dynamic.
a Single agent/ Multiple agents - The environment may contain other agents which may be of
the same or different kind as that of the agent.
a Accessible / Inaccessible - If the agent's sensory apparatus can have access to the complete
state of the environment, then the environment is accessible to that agent.
a Deterministic / Non-deterministic - If the next state of the environment is completely
determined by the current state and the actions of the agent, then the environment is
deterministic; otherwise it is non-deterministic.
a Episodic / Non-episodic - In an episodic environment, each episode consists of the agent
perceiving and then acting. The quality of its action depends just on the episode itself.
Subsequent episodes do not depend on the actions in the previous episodes. Episodic
environments are much simpler because the agent does not need to think ahead.
13
GOOD BEHAVIOUR:CONCEPT OF RATIONALITY
RATIONAL AGENT
• A rational agent is an agent which has clear preference, models uncertainty, and acts in a way
to maximize its performance measure with all possible actions.
• A rational agent is said to perform the right things. AI is about creating rational agents to use
for game theory and decision theoryfor various real-world scenarios.
• For an AI agent, the rational action is most important because in AI reinforcement learning
algorithm, for each best possible action, agent gets the positive reward and for each wrong
action, an agentgets a negative reward.
• A rational agent is an agent which has clear preferences and models uncertainty via expected
values.
• A rational agent can be anything that makes decisions, typically a person, firm, machine, or
software.
• A rational agent always performs right action, where the right action means the action that
causes the agent to be most successful in the given percept sequence.
• Rationality differs from Omniscience because an Omniscient agent knows the actual
14
outcome of its action and act accordingly, which is not possible in reality.
STRUCTURE OF AI AGENT
• An agent program which implements the agent function. The structure of an intelligent agent
is a combination of architecture and agent program. It can be viewed as:
Agent = Architecture + Agent program
• Following are the main three terms involved in the structure of an AIagent:
• Architecture: Architecture is machinery that an AI agent executes on.
• Agent Function: Agent function is used to map a percept to an action.
f: P* → A
PEAS Representation
PEAS
PEAS stands for performance measure, environment, actuators, and sensors. PEAS defines AI
models and helps determine the task environment for an intelligent agent.
Performance measure: It defines the success of an agent. It evaluates the criteria that determines
whether the system performs well.
Environment: It refers to the external context in which an AI system operates. It encapsulates the
physical and virtual surroundings, including other agents, objects, and conditions.
Actuators: They are responsible for executing actions based on the decisions made. They interact
with the environment to bring about desired changes.
Sensors: An agent observes and perceives its environment through sensors. Sensors provide input
data to the system, enabling it to make informed decisions.
Examples
15
Types of AI Agents
o The Simple reflex agents are the simplest agents. These agents take decisions on the basis
of the current percepts and ignore the rest of the percept history.
o These agents only succeed in the fully observable environment.
o The Simple reflex agent does not consider any part of percepts history during their decision
and action process.
o The Simple reflex agent works on Condition-action rule, which means it maps the current
state to action. Such as a Room Cleaner agent, it works only if there is dirt in the room.
o Problems for the simple reflex agent design approach:
16
o They have very limited intelligence
o They do not have knowledge of non-perceptual parts of the current state
o Mostly too big to generate and to store.
o Not adaptive to changes in the environment.
o The Model-based agent can work in a partially observable environment, and track the
situation.
o A model-based agent has two important factors:
o Model: It is knowledge about "how things happen in the world," so it is called a
Model-based agent.
o Internal State: It is a representation of the current state based on percept history.
o These agents have the model, "which is knowledge of the world" and based on the model
they perform actions.
o Updating the agent state requires information about:
o How the world evolves
o How the agent's action affects the world.
17
3. Goal-based agents
o The knowledge of the current state environment is not always sufficient to decide for an
agent to what to do.
o The agent needs to know its goal which describes desirable situations.
o Goal-based agents expand the capabilities of the model-based agent by having the "goal"
information.
o They choose an action, so that they can achieve the goal.
o These agents may have to consider a long sequence of possible actions before deciding
whether the goal is achieved or not. uch considerations of different scenario are called
searching and planning, which makes an agent proactive.
18
4. Utility-based agents
o These agents are similar to the goal-based agent but provide an extra component of utility
measurement which makes them different by providing a measure of success at a given
state.
o Utility-based agent act based not only goals but also the best way to achieve the goal.
o The Utility-based agent is useful when there are multiple possible alternatives, and an agent
has to choose in order to perform the best action.
19
5. Learning Agents
o A learning agent in AI is the type of agent which can learn from its past experiences, or it
has learning capabilities.
o It starts to act with basic knowledge and then able to act and adapt automatically through
learning.
o A learning agent has mainly four conceptual components, which are:
1. Learning element: It is responsible for making improvements by learning from
environment
2. Critic: Learning element takes feedback from critic which describes that how well
the agent is doing with respect to a fixed performance standard.
3. Performance element: It is responsible for selecting external action
4. Problem generator: This component is responsible for suggesting actions that will
lead to new and informative experiences.
o Hence, learning agents are able to learn, analyze performance, and look for new ways to
improve the performance.
20
21
22