Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 85

Artificial Intelligence

• What is Artificial Intelligence (AI)?


• In today's world, technology is growing very fast, and we are getting in
touch with different new technologies day by day.
• Here, one of the booming technologies of computer science is Artificial
Intelligence which is ready to create a new revolution in the world by
making intelligent machines. The Artificial Intelligence is now all
around us. It is currently working with a variety of subfields, ranging
from general to specific, such as self-driving cars, playing chess,
proving theorems, playing music, Painting, etc.
• AI is one of the fascinating and universal fields of Computer science
which has a great scope in future. AI holds a tendency to cause a
machine to work as a human.
• Artificial Intelligence is composed of two words Artificial and Intelligence,
where Artificial defines "man-made," and intelligence defines "thinking power",
hence AI means "a man-made thinking power."
• So, we can define AI as:
• It is a branch of computer science by which we can create intelligent
machines which can behave like a human, think like humans, and able to
make decisions.“
• Artificial Intelligence exists when a machine can have human based skills such as
learning, reasoning, and solving problems
• With Artificial Intelligence you do not need to preprogram a machine to do some
work, despite that you can create a machine with programmed algorithms which
can work with own intelligence, and that is the awesomeness of AI.
• It is believed that AI is not a new technology, and some people says that as per
Greek myth, there were Mechanical men in early days which can work and
behave like humans.
• Why Artificial Intelligence?
• Before Learning about Artificial Intelligence, we should know that what
is the importance of AI and why should we learn it. Following are some
main reasons to learn about AI:
• With the help of AI, you can create such software or devices which can
solve real-world problems very easily and with accuracy such as health
issues, marketing, traffic issues, etc.
• With the help of AI, you can create your personal virtual Assistant, such
as Cortana, Google Assistant, Siri, etc.
• With the help of AI, you can build such Robots which can work in an
environment where survival of humans can be at risk.
• AI opens a path for other new technologies, new devices, and new
Opportunities
• Goals of Artificial Intelligence
• Following are the main goals of Artificial Intelligence:
1.Replicate human intelligence
2.Solve Knowledge-intensive tasks
3.An intelligent connection of perception and action
4.Building a machine which can perform tasks that requires human
intelligence such as:
1. Proving a theorem
2. Playing chess
3. Plan some surgical operation
4. Driving a car in traffic
5.Creating some system which can exhibit intelligent behavior, learn new
things by itself, demonstrate, explain, and can advise to its user.
AI Problems
It commonly use the term “state”.
The process of deriving a new state from the current state by
applying the operator and it is continued till the desired state is reached.
This form of Problem solving is termed as “State Space” approach.
What are AI Problems, How are AI Problems differ from others
1.If a solution to the problem needs symbolic representation in computer,
then it is considered as AI problem.
Eg: Understanding of Symbolic Form by computer
2.If there is a combinatorial explosion in outputting the result of a
traditional problem.(no of possible solution to a problem grow
exponentially as the problem size increases)
Eg: Finding Keys
TSP

8 Queen
3. If it is hard to characterize the data.(Understanding the properties and
patterns within the data)
Eg Traditional problem – In DB, Finding the customer information.
In AI – It deals with data different from the usual stuff - identify the
object color
4. If the knowledge base of the problem voluminous.(If mountain of data is
available the AI can use its special skill to find hidden data which are
invisible to traditional methods.
Eg Emoji Detection.
5. The data or knowledge base is changing fast. The size of the knowledge
base increases day by day.
• Example:Training a language model to write poems.
6. In doing dirty jobs, humans get fatigue whereas computers can perform
such jobs without any tiredness.
• Example: labeling thousands of images with the correct category (e.g.,
cat, dog, car), ATM it performs clerk cum cashier for entire day.
What are the characteristics of AI?? (how will you analyse a problem)
1. Is the problem decomposable or not?
• Example: 8-queens problem is a classic AI problem that is decomposable.
2. Can the solution steps be ignored?
• Example: In theorem proving steps are considered.
• In playing chess, steps are not considered.
3. Is the universe predictable?
• Example: weather prediction, the universe is not predictable.
• In 8 Puzzle, the universe is predictable.
4. Is the solution to the goal absolute or relative?
• Example: In the 8-queens problem, the solution to the goal is absolute.
• Traveling salesman problem, the solution to the goal is relative.
5. Is the knowledge base consistent or not?
• Example: A knowledge base is consistent if it does not contain any
contradictions. For example, a knowledge base that says "A is B" and "B
is not A" is inconsistent. Inconsistent knowledge bases, lead to problems
for AI systems.
6. The role of knowledge.
• Example: In 8-puzzle, chess, etc., we get a solution with the help of a
knowledge base.
• Political Information – Knowledge base is not used.
7. Is the interaction with the computer necessary?
• Example: In some AI problems, such as playing chess against a computer,
interaction with the computer is necessary.
• For weather prediction, interaction with the computer is not necessary.
Subsystem of AI

Learning Systems

• Learning is any process by which a system improves performance from experience,


Inductive learning and Adaptive Learning, comes under Learning system

• Inductive learning – It allows system to learn from unlabelled data and generalize
their knowledge to unseen examples.

• Example: Natural language processing: Text analysis tools use inductive learning to
identify topics, relationships between words, and even generate new text that
mimics the style of the data it was trained on.
Adaptive learning

• Adaptive learning is a powerful technique in AI and education that allows


systems to adjust their approach to learning based on the individual needs
of the learner.

• Educational software: Some educational software programs are designed


to adapt to the individual needs of each child, offering different levels of
challenge and activities based on their progress.
Knowledge representation and reasoning (KRR)

• Knowledge representation and reasoning (KRR) are two fundamental


concepts in Artificial Intelligence (AI) that work together to enable
intelligent behavior.

• The goal of knowledge representation is to create a structured and accessible


model of the world that the AI can use for reasoning and decision-making.

• Reasoning is the process of drawing conclusions and making decisions


based on the knowledge stored in the system.
Planning

• This is the significant area in AI

• Planning focussed in the area of decomposition of an original problem into appropriate


subunits and uses interaction on these subunits during problem solving process.

The major components of a planning system includes

• Heuristic function

• Set of rules in the problem state and

• Deduction Process – Games like chess use deduction to predict their opponent’s
moves and makes optimal decision based on the current game state
Knowledge Acquisition

• It includes the making of new pieces of knowledge from a given knowledge


network, setting active structures for existing knowledge, learning knowledge
from the environment and fine tuning of knowledge.

Intelligent Search

• The search problem encountered in computer science are of deterministic nature.

• The order of visiting search space is known.

• The search problem in AI are non-deterministic and the order of visiting the
elements in the search space is completely dependent on the given data set.
Logic Programming

It is one of the prime areas of research in AI that covers knowledge representation structures.

The aim of this research is to expand the PROLOG compiler to handle spatial temporal models and
maintain a parallel programming environment.

LISP(LISt Processor) is the programming language that handle strings

Soft Computing

It is the collection of computing techniques and tools.

It is the popular problem solving technique.

Statistical learning, Fuzzy logic, genetic algorithm, these are the most important constitutes of soft
computing.

Example human brain – similarly the system should work


Management of Imprecision and uncertainty

The main problem in AI is data and knowledge bases, and also reasoning and planning
are often contaminated with various form if incompleteness.

The incompleteness in data and knowledge bases is always a problem for reasoning
and planning in AI problems.

The incompleteness of data – imprecision – It occurs in DB due to lack of appropriate


data

Due to lack of certainty in the pieces of knowledge base

Techniques evolved to overcome the problems are

fuzzy plays a useful way


Production System

• It is a model of computation that has been shown to be effective for


implementing search algorithm and for modelling human problem solving.

• A Production system consists of 3 main components

• A global DB - It stores the current state of the problem that PS trying to solve

• A Set of Rules – It is the collection of it-then statement that specify how the
PS can change the state of the problem

• A goal – It is the desired state of the problem that the PS trying to solve.
Types of Production System

Monotonic Production System – Always moves in one direction

• It is a program in which the application of a rule never prevents the later


application of the another rule that could also have been applied at the time the
first rule was selected.

• Follows a set of rules or instructions in a consistent and unidirectional manner.

1.Consistency: The system always applies rules in the same order and doesn't
change its approach.
• Unidirectionality: Once a decision or action is made, it is not reversed.
The system doesn't go back and undo previous steps.

• For example, consider a medical diagnosis system. In a monotonic


production system, if the system determines that a patient has a particular
symptom and applies a rule based on that symptom, it will not later "un-
diagnose" or change its mind about that symptom based on new
information.
Non – Monotonic Production System

• It is the program in which the application of the rule prevents the later application of the another
rule which may not have been applied at the time the first rule was selected

• It allows for the revision or modification of previous conclusions based on new information or
changes in the system's knowledge.

Partially commutative production system

• It is a program with the property that the application of those rules that are allowable transforms
from state x to state y.

• Where certain operations or rules can be executed in a different order without affecting the final
outcome.

• Example: Assembling the product


Commutative Production System

High adaptability; decisions can be reordered without impacting the outcome

Advantages

• It is modular: The rules are independent of each other, so it is easy to add or remove rules without affecting the rest of the

system.

• It is declarative: The rules specify what the system should do, not how it should do it. This makes the system easier to

understand and maintain.

• It is flexible: The system can be used to solve a wide variety of problems, from simple puzzles to complex planning tasks.

Disadvantages

• It can be inefficient: The system can sometimes explore many unnecessary states before finding a solution.

• It can be difficult to debug: It can be difficult to determine why the system is not working as expected.
Working memory: This is the part of the system
that stores the current state of the problem being
solved.
Production rules: These are the rules that the
system uses to change the state of the problem. In
the figure, they are represented by the arrows
labeled "C1->A1," "C2->A2," and "C3->A3." Each
arrow represents a rule that has two parts: a
condition (C) and an action (A).
Non-Monotonic Production Partially Commutative Commutative Production
Characteristic Monotonic Production System System Production System System

Limited adaptation to new High adaptability to new Moderate adaptability; can High adaptability; decisions
Adaptability to New
information; decisions are information; decisions can be adjust decisions partially can be reordered without
Information
final. revised. based on new information. impacting the outcome.

Decisions can be revised based Decisions can be partially Decisions can be rearranged
No revision of decisions;
Revision of Previous Decisions on new data or changes in revised or adjusted as new without altering the final
decisions are not reversed.
context. information emerges. result.

May change conclusions based Consistent decisions


Always follows the same path, Consistent decisions with
Consistency on new information; dynamic irrespective of the order of
decisions are consistent. some order flexibility.
reasoning. operations.

Decisions can be reversed or Decisions can be partially Operations can be reordered


Decisions are not reversible;
Reversibility adjusted based on new reversed or reordered as without affecting the
once made, they are final.
insights. needed. outcome.

Medical diagnosis system that Manufacturing workflow with Mathematical addition where
Simple rule-based system
Example adjusts diagnoses based on some flexibility in the order of the order of numbers does not
where each step is final.
new tests. certain tasks. impact the sum.
Water Jug Problem

The global database and the set of rules for water jug problem.

There are two jugs of 4L and 3L capacities. There is a pump issued to fill the jugs with water. How can
we obtain exactly 2L of water in 4L jug.

Solution:

The rules of the problems are as follows:

1. We can empty the jug fully on to the ground or from one jug to the other.

2. We should not fill up a jug or empty a jug way or fractionally from the pump or the ground.

The global DB can be represented by a ordered part of numbers(x,y) for x=0,1,2,3,4 and y=0,1,2,3
which represent the amount of water in 4L jug and 3L jug respectively.
Branches of AI

• Logical AI: Focuses on reasoning and problem-solving using logical rules


and formal languages. It uses the knowledge of the world and infer what
action has to be taken. Example: Expert systems diagnose diseases based
on symptoms and medical knowledge encoded with logic rules.

• Search: Explores various possible solutions to find the optimal


one. Example: Pathfinding algorithms in games like chess or robots
navigating a maze.
• Pattern Recognition: Identifies patterns and regularities in
data. Example: Image recognition software identifies faces in photos, spam
filters detect unwanted emails.

• Knowledge Representation: Captures and structures information in a way


computers can understand. Example: Semantic networks represent
relationships between concepts like "cat" and "mammal".

• Inference: Draws conclusions based on available information and


knowledge. Example: Bayesian networks predict disease probabilities based
on symptoms and medical data.
• Common Sense Knowledge and Reasoning: Enables understanding and
reasoning about everyday situations. Example: Social robots interpret
human emotions and respond appropriately.

• Learning from Experience: Improves performance through observation and


interaction with the environment. Example: Machine learning algorithms
learn to classify emails as spam or not based on past data.

• Planning: Develops a sequence of actions to achieve a goal. Example: AI


planners generate robot actions to navigate from point A to B in an
environment.
• Epistemology: Studies the nature and limits of
knowledge. Example: Explainable AI systems aim to make AI decisions
transparent and understandable.

• Ontology: Defines the concepts, relationships, and properties within a


domain. Example: Biomedical ontologies categorize diseases and their
relationships.

• Heuristic Search: Uses "rules of thumb" to guide the search for optimal
solutions, often faster than exhaustive search. Example: A* algorithm finds
the shortest path in a maze by prioritizing promising directions.
• Genetic Programming: Evolves programs or algorithms through natural
selection principles. Example: Designing airplane wings: Genetic
algorithms can test millions of wing shapes to find the one that lifts the
most with the least fuel.
Intelligent Agents in Artificial Intelligence

Agents and Environments

What is an Agent?

• An agent can be anything that perceive its environment through sensors and
act upon that environment through actuators. An Agent runs in the cycle
of perceiving, thinking, and acting. An agent can be:

• Human-Agent: A human agent has eyes, ears, and other organs which work
for sensors and hand, legs, vocal tract work for actuators.

• Robotic Agent: A robotic agent can have cameras, infrared range finder, NLP
for sensors and various motors for actuators.
• Software Agent: Software agent can have keystrokes, file contents as
sensory input and act on those inputs and display output on the screen.

• Hence the world around us is full of agents such as thermostat, cellphone,


camera, and even we are also agents.

• Sensor: Sensor is a device which detects the change in the environment


and sends the information to other electronic devices. An agent observes its
environment through sensors.

• Actuators: Actuators are the component of machines that converts energy


into motion. The actuators are only responsible for moving and controlling
a system. An actuator can be an electric motor, gears, rails, etc.
• Effectors: Effectors are the devices which affect the environment.
Effectors can be legs, wheels, arms, fingers, wings, fins, and display
screen.
• Percept: It refers to the agents perceptual inputs at any given instant

• Percept Sequence: It is the complete history of everything the agent has


ever perceived.

• Agent Function: It maps any given percept sequence to an action.

• Agent Program: The agent function for an artificial agent will be


implemented by an agent program.
• Rational Agent:

• A rational agent is said to perform the right things. AI is about creating


rational agents to use for game theory and decision theory for 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 agent gets a negative
reward.

• Note: Rational agents in AI are very similar to intelligent agents.


• Rationality:

• The rationality of an agent is measured by its performance measure.


Rationality can be judged on the basis of following points:

• Performance measure which defines the success criterion.

• Agent prior knowledge of its environment.

• Best possible actions that an agent can perform.

• The sequence of percepts.


Environments

Specifying the Task Environment

Task environments are essentially the “problems” to which rational agents are the
“solutions”.

Task environment are specified as a PAGE (or) PEAS description, both means the same.

PAGE

• P – Percept

• A – Action

• G – Goal

• E – Environment
PEAS Representation

• PEAS is a type of model on which an AI agent works upon. When we define an AI

agent or rational agent, then we can group its properties under PEAS representation

model. It is made up of four words:

• P: Performance measure

• E: Environment

• A: Actuators

• S: Sensors

Here performance measure is the objective for the success of an agent's behavior.
PEAS for self-driving cars:
Let's suppose a self-driving car then
PEAS representation will be:
Performance: Safety, time, legal drive,
comfort
Environment: Roads, other vehicles,
road signs, pedestrian
Actuators: Steering, accelerator, brake,
signal, horn
Sensors: Camera, GPS, speedometer,
odometer, accelerometer, sonar.
Example of Agents with their PEAS representation

Agent Performance measure Environment Actuators Sensors

1. Medical Diagnose •Healthy patient •Patient •Tests Keyboard


•Minimized cost •Hospital •Treatments (Entry of symptoms)
•Staff
2. Vacuum Cleaner •Cleanness •Room •Wheels •Camera
•Efficiency •Table •Brushes •Dirt detection sensor
•Battery life •Wood floor •Vacuum Extractor •Cliff sensor
•Security •Carpet •Bump Sensor
•Various obstacles •Infrared Wall Sensor

3. Part -picking •Percentage of parts •Conveyor belt with •Jointed Arms •Camera
Robot in correct bins. parts, •Hand •Joint angle sensors.
•Bins
Properties of task environment

1.Fully observable vs Partially Observable

2.Static vs Dynamic

3.Discrete vs Continuous

4.Deterministic vs Stochastic

5.Single-agent vs Multi-agent

6.Episodic vs sequential

7.Known vs Unknown

8.Accessible vs Inaccessible
Fully observable vs Partially Observable:
• If an agent sensor can sense or access the complete state of an
environment at each point of time then it is a fully
observable environment, else it is partially observable.

• A fully observable environment is easy as there is no need to maintain the


internal state to keep track history of the world.

• If the sensors are not active or the environment changes every second
then the environment is partially observable or inaccessible.
Deterministic vs Stochastic:
• If an agent's current state and selected action can completely determine
the next state of the environment, then such environment is called a
deterministic environment.

• A stochastic environment is random in nature and cannot be determined


completely by an agent.

• Accessible -> Deterministic

• Inaccessible -> Non-Deterministic


Episodic vs Sequential:
• In an episodic environment, there is a series of one-shot actions, and
only the current percept is required for the action.

• However, in Sequential environment, an agent requires memory of past


actions to determine the next best actions.
Single-agent vs Multi-agent
• If only one agent is involved in an environment, and operating by itself then
such an environment is called single agent environment.

• A single-agent system, in this case, is represented by an autonomous vacuum


cleaner.

• However, if multiple agents are operating in an environment, then such an


environment is called a multi-agent environment.

• Traffic Management System:traffic lights, vehicles, and pedestrians are


agents
Static vs Dynamic:
• If the environment is changing for agent’s action then the environment is
dynamic for that agent otherwise it is static.

• Example: Automated Vending Machine, Taxi Driving – Dynamic

• Static environments are easy to deal because an agent does not need to
continue looking at the world while deciding for an action.

• Example: Cross word puzzle.


Discrete vs Continuous:
• If in an environment there are a finite number of percepts and actions that
can be performed within it, then such an environment is called a discrete
environment else it is called continuous environment.

• A chess game comes under discrete environment as there is a finite number


of moves that can be performed.

• A self-driving car is an example of a continuous environment.


Known vs Unknown
• In a known environment, the results for all actions are known to the agent. While in unknown
environment, agent needs to learn how it works in order to perform an action.

• Self-driving Car:

• Known : The car has detailed maps and can identify familiar landmarks, traffic rules, and road
signs. It can navigate known routes safely and make predictable decisions based on these
elements.

• Unknown : The car faces an unusual event like a car accident blocking its path. Its algorithms
trained on regular driving situations might not be equipped to handle this unforeseen
situation, requiring human intervention or adaptive learning capabilities.
Accessible vs Inaccessible
• If an agent can obtain complete and accurate information about the state's
environment, then such an environment is called an Accessible
environment else it is called inaccessible.

• An empty room whose state can be defined by its temperature is an


example of an accessible environment.

• Information about an event on earth is an example of Inaccessible


environment.
Structure of Intelligent Agents

An Intelligent agent is a combination of Agent Program and Architecture

Intelligent Agent=Agent Program + Architecture

Agent Program is a function that implements the agent mapping from percept's to
a actions.

Architecture is a computing device used to run the agent program.

How to use architecture

The architecture might be a computer or special hardware(Processing camera


images and filtering audio inputs)
• It also has a software that works as a interface between computer and
agent program.
• In general the percepts are recognized through sensors, runs the
program and the actions are applied through effectors.
• How to design an agent program
• Idea of possible percepts and actions-understanding how an agent perceives its
environment and how it chooses actions to achieve its goals based on that perception
• What goal or performance measure that agent is supposed to achieve?
• What sort of environment it will operate the program?(real or artificial)
All the three tasks should exists in an agent program.
• The agent program will use some internal data structures that will be
updated as new percepts arrive.
• The DS are operated by the agents decision making procedures to
generated action choice, which is then passed to the architecture to be
• Types of AI Agents

• In order to build a real program to implement mapping from percepts to


action there are four types of agent programs, they are

• Simple Reflex Agent

• Model-based reflex agent

• Goal-based agents

• Utility-based agent

• Learning agent
• Simple Reflex agent:
• 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.
• The Simple reflex agent does not consider any part of percepts history
during their decision and action process.
• The Simple reflex agent works on Condition-action rule, which means
it maps the current state to action.
• Example: Automated hand sanitizer dispensers that release sanitizer
when they detect someone placing their hands beneath them, without
considering past interactions.
• Room Cleaner agent, it works only if there is dirt in the room.
•Problems for the simple reflex agent design
approach:
• They have very limited intelligence
• They do not have knowledge of non-
perceptual parts of the current state
• Mostly too big to generate and to store.
• Not adaptive to changes in the
environment.
• Model-based reflex agent
• A model-based agent has two important factors:
• Model: It is knowledge about "how things happen in the world," so it is called a
Model-based agent.
• Internal State: It is a representation of the current state based on percept history.
• Updating the agent state requires information about:
• How the world evolves
• How the agent's action affects the world.
Example
• Chess-playing programs that consider the current state of the board and
the history of moves to determine the best next move.
• Goal-based agents
• Goal-based agents expand the capabilities of the model-based agent by
having the "goal" information.
• They choose an action, so that they can achieve the goal.
• An agent knows the description of current state as well as goal state.
The action matches with the current state is selected depends on the
goal state.
• The goal is based agent is more flexible for more than one destination
also
• After identifying one destination, the new destination is specified, goal
based agent is activated to come up with a new behavior.
• Search and planning techniques required to achieve goal.
• Utility-based agents

• An agent which generates a goal state with high-quality behavior(utility)

• If more than one sequence exists to reach the goal state then the sequence with more reliable , safer,

quicker and cheaper than others to be selected.

• The utility function can be used for two different cases:

• (i) when there are conflicting goals, the utility function specifies the appropriate trade-off.

• (ii) when the agent aims for several goals, none of which can be achieved with certainty then the success

can be weighed up against the importance of the goals.

Example

• Ride-sharing apps that optimize routes based on factors like distance, time, and user preferences to
• Learning Agents
• A learning agent in AI is the type of agent which can learn from its past
experiences, or it has learning capabilities.
• It starts to act with basic knowledge and then able to act and adapt automatically
through learning.
• A learning agent has mainly four conceptual components, which are:
• Learning element: It is responsible for making improvements by learning from
environment
• Critic: Learning element takes feedback from critic which describes that how well the
agent is doing with respect to a fixed performance standard.
• Performance element: It is responsible for selecting external action
• Problem generator: This component is responsible for suggesting actions that will lead to
new and informative experiences.
• Hence, learning agents are able to learn, analyze performance, and look for new
ways to improve the performance.
Example: Recommendation systems on streaming platforms that learn user preferences and suggest
movies or music based on viewing and listening history.

You might also like