Hari Artificial Intelligence Tutorial Pagenumber 2
Hari Artificial Intelligence Tutorial Pagenumber 2
Hari Artificial Intelligence Tutorial Pagenumber 2
A Seminar Report on
2023-24
Certificate
This is to certify that the Summer Seminar entitled “Artificial Intelligence (AI)” has been
College of Computer Application. As a partial fulfilment of the requirement for the degree of
Place: Surat
Date:
Table of Contents
About the Tutorial ......................................................................................................................................... i
Audience ....................................................................................................................................................... i
Prerequisites .................................................................................................................................................. i
Table of Contents.......................................................................................................................................... ii
1. OVERVIEW OF AI ...................................................................................................................... 1
Philosophy of AI ............................................................................................................................................ 1
Goals of AI .................................................................................................................................................... 1
Applications of AI.......................................................................................................................................... 3
History of AI .................................................................................................................................................. 4
Rationality .................................................................................................................................................. 15
8. EXPERT SYSTEMS.................................................................................................................... 40
Knowledge Base.......................................................................................................................................... 41
9. ROBOTICS .............................................................................................................................. 47
Since the invention of computers or machines, their capability to perform various tasks went
on growing exponentially. Humans have developed the power of computer systems in terms
of their diverse working domains, their increasing speed, and reducing size with respect to
time.
A branch of Computer Science named Artificial Intelligence pursues creating the computers or
machines as intelligent as human beings.
AI is accomplished by studying how human brain thinks, and how humans learn, decide, and
work while trying to solve a problem, and then using the outcomes of this study as a basis of
developing intelligent software and systems.
Philosophy of AI
While exploiting the power of the computer systems, the curiosity of human, lead him to
wonder, “Can a machine think and behave like humans do?”
Thus, the development of AI started with the intention of creating similar intelligence in
machines that we find and regard high in humans.
Goals of AI
• To Create Expert Systems: The systems which exhibit intelligent behavior, learn,
demonstrate, explain, and advice its users.
• To Implement Human Intelligence in Machines: Creating systems that
understand, think, learn, and behave like humans.
1
Artificial Intelligence (AI) Page 9
Out of the following areas, one or multiple areas can contribute to build an intelligent system.
2
Artificial Intelligence (AI) Page 10
What is AI Technique?
In the real world, the knowledge has some unwelcomed properties:
AI Technique is a manner to organize and use the knowledge efficiently in such a way that:
AI techniques elevate the speed of execution of the complex program it is equipped with.
Applications of AI
AI has been dominant in various fields such as:
• 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.
• Natural Language Processing
It is possible to interact with the computer that understands natural language spoken
by humans.
• 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.
• Vision Systems
These systems understand, interpret, and comprehend visual input on the computer.
For example,
o A spying aeroplane takes photographs which are used to figure out spatial
information or map of the areas.
o Doctors use clinical expert system to diagnose the patient.
o Police use computer software that can recognize the face of criminal with the
stored portrait made by forensic artist.
3
Artificial Intelligence (AI) Page 11
• Speech Recognition
Some intelligent systems are capable of hearing and comprehending the language in
terms of sentences and their meanings while a human talks to it. It can handle different
accents, slang words, noise in the background, change in human’s noise due to cold,
etc.
• Handwriting Recognition
The handwriting recognition software reads the text written on paper by a pen or on
screen by a stylus. It can recognize the shapes of the letters and convert it into editable
text.
• 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.
History of AI
Here is the history of AI during 20th century:
Karel Čapek’s play named “Rossum's Universal Robots” (RUR) opens in London,
1923
first use of the word "robot" in English.
1943 Foundations for neural networks laid.
1945 Isaac Asimov, a Columbia University alumni, coined the term Robotics.
Alan Turing introduced Turing Test for evaluation of intelligence and published
1950 Computing Machinery and Intelligence. Claude Shannon published Detailed
Analysis of Chess Playing as a search.
John McCarthy coined the term Artificial Intelligence. Demonstration of the first
1956
running AI program at Carnegie Mellon University.
4
Artificial Intelligence (AI) Page 12
The Assembly Robotics group at Edinburgh University built Freddy, the Famous
1973
Scottish Robot, capable of using vision to locate and assemble models.
1979 The first computer-controlled autonomous vehicle, Stanford Cart, was built.
1985
Harold Cohen created and demonstrated the drawing program, Aaron.
The Deep Blue Chess Program beats the then world chess champion, Garry
1997
Kasparov.
5
Page 13
While studying artificially intelligence, you need to know what intelligence is. This chapter
covers Idea of intelligence, types, and components of intelligence.
What is Intelligence?
The ability of a system to calculate, reason, perceive relationships and analogies, learn from
experience, store and retrieve information from memory, solve problems, comprehend
complex ideas, use natural language fluently, classify, generalize, and adapt new situations.
Types of Intelligence
As described by Howard Gardner, an American developmental psychologist, the Intelligence
comes in multifold:
6
Artificial Intelligence (AI) Page 14
Mass
Interpersonal The ability to recognize and make distinctions among
Communicators,
intelligence other people’s feelings, beliefs, and intentions.
Interviewers
You can say a machine or a system is artificially intelligent when it is equipped with at least
one and at most all intelligences in it.
1. Reasoning
2. Learning
3. Problem Solving
4. Perception
5. Linguistic Intelligence
1. Reasoning: It is the set of processes that enables us to provide basis for judgement,
making decisions, and prediction. There are broadly two types:
Even if all of the premises are true in a If something is true of a class of things in
statement, inductive reasoning allows for the general, it is also true for all members of that
conclusion to be false. class.
7
Artificial Intelligence (AI) Page 15
Example:
Example:
"All women of age above 60 years are
“Nita is a teacher.
grandmothers.
All teachers are studious.
Shalini is 65 years.
Therefore, Nita is studious.”
Therefore, Shalini is a grandmother."
o Perceptual Learning: It is learning to recognize stimuli that one has seen before.
For example, identifying and classifying objects and situations.
3. Problem solving: It is the process in which one perceives and tries to arrive at a
desired solution from a present situation by taking some path, which is blocked by
known or unknown hurdles.
Problem solving also includes decision making, which is the process of selecting the
best suitable alternative out of multiple alternatives to reach the desired goal are
available.
8
Artificial Intelligence (AI) Page 16
5. Linguistic Intelligence: It is one’s ability to use, comprehend, speak, and write the
verbal and written language. It is important in interpersonal communication.
• Humans can figure out the complete object even if some part of it is missing or
distorted; whereas the machines cannot correctly.
9
Page 17
The domain of artificial intelligence is huge in breadth and width. While proceeding, we
consider the broadly common and prospering research areas in the domain of AI:
It is used in hand-free computing, map or It analyzes person’s tone, voice pitch, and
menu navigation accent, etc., to identify a person.
Machine does not need training as it is not The recognition system needs training as it
speaker dependent. is person-oriented.
10
Artificial Intelligence (AI) Page 18
This source-language text becomes input to the Translation Engine, which converts it to the
target language text. They are supported with interactive GUI, large database of vocabulary
etc.
Neural Networks
11
Artificial Intelligence (AI) Page 19
Robotics
Fuzzy Logic
12
Artificial Intelligence (AI) Page 20
Humans learn mundane (ordinary) tasks since their birth. They learn by perception,
speaking, using language, and locomotives. They learn Formal Tasks and Expert Tasks later,
in that order.
For humans, the mundane tasks are easiest to learn. The same was considered true before
trying to implement mundane tasks in machines. Earlier, all work of AI was concentrated in
the mundane task domain.
Later, it turned out that the machine requires more knowledge, complex knowledge
representation, and complicated algorithms for handling mundane tasks. This is the reason
why AI work is more prospering in the Expert Task domain now, as the expert task
domain needs expert knowledge without common sense, which can be easier to represent and
handle.
13
Page 21
An AI system is composed of an agent and its environment. The agents act in their
environment. The environment may contain other agents.
• A human agent has sensory organs such as eyes, ears, nose, tongue and skin parallel
to the sensors, and other organs such as hands, legs, mouth, for effectors.
• A robotic agent replaces cameras and infrared range finders for the sensors, and
various motors and actuators for effectors.
• A software agent has encoded bit strings as its programs and actions.
Agents Terminology
• Performance Measure of Agent: It is the criteria, which determines how successful
an agent is.
• Behavior of Agent: It is the action that agent performs after any given sequence of
percepts.
• Percept: It is agent’s perceptual inputs at a given instance.
• Percept Sequence: It is the history of all that an agent has perceived till date.
14
Artificial Intelligence (AI) Page 22
Rationality
Rationality is nothing but status of being reasonable, sensible, and having good sense of
judgment.
Rationality is concerned with expected actions and results depending upon what the agent has
perceived. Performing actions with the aim of obtaining useful information is an important
part of rationality.
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. The problem the agent
solves is characterized by Performance Measure, Environment, Actuators, and Sensors
(PEAS).
15
Artificial Intelligence (AI) Page 23
16
Artificial Intelligence (AI) Page 24
Goal-Based Agents
They choose their actions in order to achieve goals. Goal-based approach is more flexible than
reflex agent since the knowledge supporting a decision is explicitly modeled, thereby allowing
for modifications.
Utility-Based Agents
They choose actions based on a preference (utility) for each state.
17
Artificial Intelligence (AI) Page 25
In contrast, some software agents (software robots or softbots) exist in rich, unlimited
softbots domains. The simulator has a very detailed, complex environment. The software
agent needs to choose from a long array of actions in real time. A softbot designed to scan
the online preferences of the customer and show interesting items to the customer works in
the real as well as an artificial environment.
The most famous artificial environment is the Turing Test environment, in which one
real and other artificial agents are tested on equal ground. This is a very challenging
environment as it is highly difficult for a software agent to 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.
18
Artificial Intelligence (AI) Page 26
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:
• 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).
• Static / Dynamic: If the environment does not change while an agent is acting, then
it is static; otherwise it is dynamic.
• Single agent / Multiple agents: The environment may contain other agents which
may be of the same or different kind as that of the agent.
• Accessible vs. 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.
19
Page 27
Searching is the universal technique of problem solving in AI. There are some single-player
games such as tile games, Sudoku, crossword, etc. The search algorithms help you to search
for a particular position in such games.
The other examples of single agent pathfinding problems are Travelling Salesman Problem,
Rubik’s Cube, and Theorem Proving.
Search Terminology
Problem Space: It is the environment in which the search takes place. (A set of states and
set of operators to change those states)
Problem Space Graph: It represents problem state. States are shown by nodes and
operators are shown by edges.
Depth of a problem: Length of a shortest path or shortest sequence of operators from Initial
State to goal state.
Space Complexity: The maximum number of nodes that are stored in memory.
Branching Factor: The average number of child nodes in the problem space graph.
Depth: Length of the shortest path from initial state to goal state.
Requirements –
• State description
20
Artificial Intelligence (AI) Page 28
Breadth-First Search
It starts from the root node, explores the neighboring nodes first and moves towards the next
level neighbors. It generates one tree at a time until the solution is found. It can be
implemented using FIFO queue data structure. This method provides shortest path to the
solution.
If branching factor (average number of child nodes for a given node) = b and depth = d,
then number of nodes at level d = bd.
Disadvantage: Since each level of nodes is saved for creating next one, it consumes a lot of
memory space. Space requirement to store nodes is exponential.
Its complexity depends on the number of nodes. It can check duplicate nodes.
Depth-First Search
It is implemented in recursion with LIFO stack data structure. It creates the same set of nodes
as Breadth-First method, only in the different order.
As the nodes on the single path are stored in each iteration from root to leaf node, the space
requirement to store nodes is linear. With branching factor b and depth as m, the storage
space is bm.
Disadvantage: This algorithm may not terminate and go on infinitely on one path. The
solution to this issue is to choose a cut-off depth. If the ideal cut-off is d, and if chosen cut-
off is lesser than d, then this algorithm may fail. If chosen cut-off is more than d, then
execution time increases.
Its complexity depends on the number of paths. It cannot check duplicate nodes.
21
Artificial Intelligence (AI) Page 29
Bidirectional Search
It searches forward from initial state and backward from goal state till both meet to identify
a common state.
The path from initial state is concatenated with the inverse path from the goal state. Each
search is done only up to half of the total path.
Disadvantage: There can be multiple long paths with the cost ≤ C*. Uniform Cost search
must explore them all.
It never creates a node until all lower nodes are generated. It only saves a stack of nodes.
The algorithm ends when it finds a solution at depth d. The number of nodes created at depth
d is bd and at depth d-1 is bd-1.
22
Artificial Intelligence (AI) Page 30
In each iteration, a node with a minimum heuristic value is expanded, all its child nodes are
created and placed in the closed list. Then, the heuristic function is applied to the child nodes
and they are placed in the open list according to their heuristic value. The shorter paths are
saved and the longer ones are disposed.
23
Artificial Intelligence (AI) Page 31
A* Search
It is best-known form of Best First search. It avoids expanding paths that are already
expensive, but expands most promising paths first.
• f(n) estimated total cost of path through n to goal. It is implemented using priority queue
by increasing f(n).
Local SearchAlgorithms
They start from a prospective solution and then move to a neighboring solution. They can
return a valid solution even if it is interrupted at any time before they end.
Hill-Climbing Search
It is an iterative algorithm that starts with an arbitrary solution to a problem and attempts to
find a better solution by changing a single element of the solution incrementally. If the change
produces a better solution, an incremental change is taken as a new solution. This process is
repeated until there are no further improvements.
neighbor, a node
current ←Make_Node(Initial-State[problem])
loop
return State[current]
current ← neighbor
end
24
Artificial Intelligence (AI) Page 32
Otherwise the (initial k states and k number of successors of the states = 2k) states are placed
in a pool. The pool is then sorted numerically. The highest k states are selected as new initial
states. This process continues until a maximum value is reached.
loop
end
Simulated Annealing
Annealing is the process of heating and cooling a metal to change its internal structure for
modifying its physical properties. When the metal cools, its new structure is seized, and the
metal retains its newly obtained properties. In simulated annealing process, the temperature
is kept variable.
We initially set the temperature high and then allow it to ‘cool' slowly as the algorithm
proceeds. When the temperature is high, the algorithm is allowed to accept worse solutions
with high frequency.
Start
End
Start
Find out all (n -1)! Possible solutions, where n is the total number of cities.
25
Artificial Intelligence (AI) Page 33
Determine the minimum cost by finding out the cost of each of these (n -1)!
solutions.
end
26
Page 34
Fuzzy Logic Systems (FLS) produce acceptable but definite output in response to incomplete,
ambiguous, distorted, or inaccurate (fuzzy) input.
The conventional logic block that a computer can understand takes precise input and produces
a definite output as TRUE or FALSE, which is equivalent to human’s YES or NO.
The inventor of fuzzy logic, Lotfi Zadeh, observed that unlike computers, the human decision
making includes a range of possibilities between YES and NO, such as:
CERTAINLY YES
POSSIBLY YES
CANNOT SAY
POSSIBLY NO
CERTAINLY NO
The fuzzy logic works on the levels of possibilities of input to achieve the definite output.
Implementation
• It can be implemented in systems with various sizes and capabilities ranging from small
micro-controllers to large, networked, workstation-based control systems.
• It can be implemented in hardware, software, or a combination of both.
27
Artificial Intelligence (AI) Page 35
1. Fuzzification Module: transforms the system inputs, which are crisp numbers, into
fuzzy sets.
LP x is Large Positive
MP x is Medium Positive
S x is Small
MN x is Medium Negative
LN x is Large Negative
2. Knowledge Base: It stores IF-THEN rules provided by experts.
3. Inference Engine: It simulates the human reasoning process by making fuzzy
inference on the inputs and IF-THEN rules.
4. Defuzzification Module: It transforms the fuzzy set obtained by the inference engine
into a crisp value.
Membership Functions
Membership functions allow you to quantify linguistic term and represent a fuzzy set
graphically. A membership function for a fuzzy set A on the universe of discourse X is
defined as µA:X → [0,1].
28
Artificial Intelligence (AI) Page 36
There can be multiple membership functions applicable to fuzzify a numerical value. Simple
membership functions are used as use of complex functions does not add more precision in
the output.
All membership functions for LP, MP, S, MN, and LN are shown as below:
The triangular membership function shapes are most common among various other
membership function shapes such as trapezoidal, singleton, and Gaussian.
Here, the input to 5-level fuzzifier varies from -10 volts to +10 volts. Hence the corresponding
output also changes.
29
Artificial Intelligence (AI) Page 37
Algorithm
1. Define linguistic Variables and terms (start)
2. Construct membership functions for them. (start)
3. Construct knowledge base of rules (start)
4. Convert crisp data into fuzzy data sets using membership functions (fuzzification)
5. Evaluate rules in the rule base (inference engine)
6. Combine results from each rule (inference engine)
7. Convert output data into non-fuzzy values. (defuzzification)
Development
Step 1: Define linguistic variables and terms
Linguistic variables are input and output variables in the form of simple words or sentences.
For room temperature, cold, warm, hot, etc., are linguistic terms.
Every member of this set is a linguistic term and it can cover some portion of overall
temperature values.
30
Artificial Intelligence (AI) Page 38
Create a matrix of room temperature values versus target temperature values that an air
conditioning system is expected to provide.
Build a set of rules into the knowledge base in the form of IF-THEN-ELSE structures.
Step5
31
Artificial Intelligence (AI) Page 39
Fuzzy set operations perform evaluation of rules. The operations used for OR and AND are
Max and Min respectively. All results of evaluation are combined to form a final result. This
result is a fuzzy value.
Step 6
Automotive Systems
• Automatic Gearboxes
• Four-Wheel Steering
• Vehicle environment control
Consumer Electronics
• Hi-Fi Systems
• Photocopiers
• Still and Video Cameras
• Television
Domestic Goods
• Microwave Ovens
• Refrigerators
• Toasters
• Vacuum Cleaners
32
Artificial Intelligence (AI) Page 40
• Washing Machines
Environment Control
• Air Conditioners/Dryers/Heaters
• Humidifiers
Advantages of FLSs
• Mathematical concepts within fuzzy reasoning are very simple.
• You can modify a FIS by just adding or deleting rules due to flexibility of fuzzy logic.
• Fuzzy logic Systems can take imprecise, distorted, noisy input information.
• FLSs are easy to construct and understand.
• Fuzzy logic is a solution to complex problems in all fields of life, including medicine, as
it resembles human reasoning and decision making.
Disadvantages of FLSs
• There is no systematic approach to fuzzy system designing.
• They are understandable only when simple.
• They are suitable for the problems which do not need high accuracy.
33
Page 41
Processing of Natural Language is required when you want an intelligent system like robot to
perform as per your instructions, when you want to hear decision from a dialogue based
clinical expert system, etc.
The field of NLP involves making computers to perform useful tasks with the natural languages
humans use. The input and output of an NLP system can be:
• Speech
• Written Text
Components of NLP
There are two components of NLP as given:
It involves:
• Text planning: It includes retrieving the relevant content from knowledge base.
• Sentence planning: It includes choosing required words, forming meaningful
phrases, setting tone of the sentence.
• Text Realization: It is mapping sentence plan into sentence structure.
Difficulties in NLU
• NL has an extremely rich form and structure.
• It is very ambiguous. There can be different levels of ambiguity:
o Lexical ambiguity: It is at very primitive level such as word-level.
34
Artificial Intelligence (AI) Page 42
NLP Terminology
• Phonology: It is study of organizing sound systematically.
• Morphology: It is a study of construction of words from primitive meaningful units.
• Morpheme: It is primitive unit of meaning in a language.
• Syntax: It refers to arranging words to make a sentence. It also involves determining
the structural role of words in the sentence and in phrases.
• Semantics: It is concerned with the meaning of words and how to combine words into
meaningful phrases and sentences.
• Pragmatics: It deals with using and understanding sentences in different situations
and how the interpretation of the sentence is affected.
• Discourse: It deals with how the immediately preceding sentence can affect the
interpretation of the next sentence.
• World Knowledge: It includes the general knowledge about the world.
Steps in NLP
There are general five steps:
1. Lexical Analysis
It involves identifying and analyzing the structure of words. Lexicon of a language
means the collection of words and phrases in a language. Lexical analysis is dividing
the whole chunk of txt into paragraphs, sentences, and words.
2. Syntactic Analysis (Parsing)
It involves analysis of words in the sentence for grammar and arranging words in a
manner that shows the relationship among the words. The sentence such as “The
school goes to boy” is rejected by English syntactic analyzer.
35
Artificial Intelligence (AI) Page 43
3. Semantic Analysis
It draws the exact meaning or the dictionary meaning from the text. The text is
checked for meaningfulness. It is done by mapping syntactic structures and objects in
the task domain. The semantic analyzer disregards sentence such as “hot ice-cream”.
4. Discourse Integration
The meaning of any sentence depends upon the meaning of the sentence just before
it. In addition, it also brings about the meaning of immediately succeeding sentence.
5. Pragmatic Analysis
During this, what was said is re-interpreted on what it actually meant. It involves
deriving those aspects of language which require real world knowledge.
ImplementationAspects of SyntacticAnalysis
There are a number of algorithms researchers have developed for syntactic analysis, but we
consider only the following simple methods:
• Context-Free Grammar
• Top-Down Parser
Context-Free Grammar
It is the grammar that consists rules with a single symbol on the left-hand side of the rewrite
rules. Let us create grammar to parse a sentence –
36
Artificial Intelligence (AI) Page 44
The parse tree breaks down the sentence into structured parts so that the computer can easily
understand and process it. In order for the parsing algorithm to construct this parse tree, a
set of rewrite rules, which describe what tree structures are legal, need to be constructed.
These rules say that a certain symbol may be expanded in the tree by a sequence of other
symbols. According to first order logic rule, ff there are two strings Noun Phrase (NP) and
Verb Phrase (VP), then the string combined by NP followed by VP is a sentence. The rewrite
rules for the sentence are as follows:
S -> NP VP
NP -> DET N | DET ADJ N
VP -> V NP
Lexocon:
DET -> a | the
ADJ -> beautiful | perching
N -> bird | birds | grain | grains
37
Artificial Intelligence (AI) Page 45
Now consider the above rewrite rules. Since V can be replaced by both, "peck" or "pecks",
sentences such as "The bird peck the grains" can be wrongly permitted. i. e. the subject-verb
agreement error is approved as correct.
Demerits:
• They are not highly precise. For example, “The grains peck the bird”, is a syntactically
correct according to parser, but even if it makes no sense, parser takes it as a correct
sentence.
• To bring out high precision, multiple sets of grammar need to be prepared. It may
require a completely different sets of rules for parsing singular and plural variations,
passive sentences, etc., which can lead to creation of huge set of rules that are
unmanageable.
Top-Down Parser
Here, the parser starts with the S symbol and attempts to rewrite it into a sequence
of terminal symbols that matches the classes of the words in the input sentence until it
consists entirely of terminal symbols.
These are then checked with the input sentence to see if it matched. If not, the process is
started over again with a different set of rules. This is repeated until a specific rule is found
which describes the structure of the sentence.
38
Artificial Intelligence (AI) Page 46
Demerits:
39
Page 47
Expert systems (ES) are one of the prominent research domains of AI. It is introduced by the
researchers at Stanford University, Computer Science Department.
• Advising
• Instructing and assisting human in decision making
• Demonstrating
• Deriving a solution
• Diagnosing
• Explaining
• Interpreting input
• Predicting results
• Justifying the conclusion
• Suggesting alternative options to a problem
They are incapable of:
• Substituting human decision makers
40
Artificial Intelligence (AI) Page 48
• Knowledge Base
• Inference Engine
• User Interface
Let us see them one by one briefly:
Knowledge Base
It contains domain-specific and high-quality knowledge.
Knowledge is required to exhibit intelligence. The success of any ES majorly depends upon
the collection of highly accurate and precise knowledge.
What is Knowledge?
The data is collection of facts. The information is organized as data and facts about the task
domain. Data, information, and past experience combined together are termed as
knowledge.
41
Artificial Intelligence (AI) Page 49
Knowledge representation
It is the method used to organize and formalize the knowledge in the knowledge base. It is in
the form of IF-THEN-ELSE rules.
Knowledge Acquisition
The success of any expert system majorly depends on the quality, completeness, and accuracy
of the information stored in the knowledge base.
The knowledge base is formed by readings from various experts, scholars, and the
Knowledge Engineers. The knowledge engineer is a person with the qualities of empathy,
quick learning, and case analyzing skills.
He acquires information from subject expert by recording, interviewing, and observing him at
work, etc. He then categorizes and organizes the information in a meaningful way, in the form
of IF-THEN-ELSE rules, to be used by interference machine. The knowledge engineer also
monitors the development of the ES.
Inference Engine
Use of efficient procedures and rules by the Inference Engine is essential in deducting a
correct, flawless solution.
In case of knowledge-based ES, the Inference Engine acquires and manipulates the knowledge
from the knowledge base to arrive at a particular solution.
• Applies rules repeatedly to the facts, which are obtained from earlier rule application.
• Adds new knowledge into the knowledge base if required.
• Resolves rules conflict when multiple rules are applicable to a particular case
To recommend a solution, the inference engine uses the following strategies:
• Forward Chaining
• Backward Chaining
Forward Chaining
It is a strategy of an expert system to answer the question, “What can happen next?”
42
Artificial Intelligence (AI) Page 50
Here, the inferance engine follows the chain of conditions and derivations and finally deduces
the outcome. It considers all the facts and rules, and sorts them before concluding to a
solution.
This strategy is followed for working on conclusion, result, or effect. For example, prediction
of share market status as an effect of changes in interest rates.
Backward Chaining
With this strategy, an expert system finds out the answer to the question, “Why this
happened?”
On the basis of what has already happened, the inference engine tries to find out which
conditions could have happened in the past for this result. This strategy is followed for finding
out cause or reason. For example, diagnosis of blood cancer in humans.
User Interface
User interface provides interaction between user of the ES and the ES itself. It is generally
Natural Language Processing so as to be used by the user who is well-versed in the task
domain. The user of the ES need not be necessarily an expert in Artificial Intelligence.
It explains how the ES has arrived at a particular recommendation. The explanation may in
the following forms:
43
Artificial Intelligence (AI) Page 51
The user interface makes it easy to trace the credibility of the deductions.
Application Description
Design Domain Camera lens design, automobile design.
44
Artificial Intelligence (AI) Page 52
2. Tools: They reduce the effort and cost involved in developing an expert system to
large extent.
1. Shells: A shell is nothing but an expert system without knowledge base. A shell
provides the developers with knowledge acquisition, inference engine, user interface,
and explanation facility. For example, few shells are given below:
o Java Expert System Shell (JESS) that provides fully developed Java API for
creating an expert system.
o Vidwan, a shell developed at the National Centre for Software Technology,
Mumbai in 1993. It enables knowledge encoding in the form of IF-THEN rules.
45
Artificial Intelligence (AI) Page 53
• The knowledge engineer uses sample cases to test the prototype for any deficiencies
in performance.
• Test and ensure the interaction of the ES with all elements of its environment, including end users,
databases, and other information systems.
46
Page 54
Robotics is a domain in artificial intelligence that deals with the study of creating intelligent
and efficient robots.
Objective
Robots are aimed at manipulating the objects by perceiving, picking, moving, modifying the
physical properties of object, destroying it, or to have an effect thereby freeing manpower
from doing repetitive functions without getting bored, distracted, or exhausted.
What is Robotics?
Robotics is a branch of AI, which is composed of Electrical Engineering, Mechanical
Engineering, and Computer Science for designing, construction, and application of robots.
Aspects of Robotics
• The robots have mechanical construction, form, or shape designed to accomplish a
particular task.
• They have electrical components which power and control the machinery.
• They contain some level of computer program that determines what, when and how
a robot does something.
AI Programs Robots
They usually operate in computer-stimulated
They operate in real physical world
worlds.
The input to an AI program is in symbols and Inputs to robots is analog signal in the form of
rules. speech waveform or images
They need general purpose computers to They need special hardware with sensors and
operate on. effectors.
47
Artificial Intelligence (AI) Page 55
Robot Locomotion
Locomotion is the mechanism that makes a robot capable of moving in its environment. There
are various types of locomotions:
• Legged
• Wheeled
• Combination of Legged and Wheeled Locomotion
• Tracked slip/skid
Legged Locomotion
• This type of locomotion consumes more power while demonstrating walk, jump, trot,
hop, climb up or down, etc.
• It requires more number of motors to accomplish a movement. It is suited for rough
as well as smooth terrain where irregular or too smooth surface makes it consume
more power for a wheeled locomotion. It is little difficult to implement because of
stability issues.
• It comes with the variety of one, two, four, and six legs. If a robot has multiple legs
then leg coordination is necessary for locomotion.
The total number of possible gaits (a periodic sequence of lift and release events for each of
the total legs) a robot can travel depends upon the number of its legs.
= (2*2-1)! = 3! = 6.
In case of k=6 legs, there are 39916800 possible events. Hence the complexity of robots is
directly proportional to the number of legs.
48
Artificial Intelligence (AI) Page 56
Wheeled Locomotion
It requires fewer number of motors to accomplish a movement. It is little easy to implement
as there are less stability issues in case of more number of wheels. It is power efficient as
compared to legged locomotion.
• Standard wheel: Rotates around the wheel axle and around the contact
• Castor wheel: Rotates around the wheel axle and the offset steering joint
• Swedish 45° and Swedish 90° wheels: Omni-wheel, rotates around the contact
point, around the wheel axle, and around the rollers.
• Ball or spherical wheel: Omnidirectional wheel, technically difficult to implement.
Slip/Skid Locomotion
In this type, the vehicles use tracks as in a tank. The robot is steered by moving the tracks
with different speeds in the same or opposite direction. It offers stability because of large
contact area of track and ground.
49
Artificial Intelligence (AI) Page 57
Components of a Robot
Robots are constructed with the following:
• Power Supply: The robots are powered by batteries, solar power, hydraulic, or
pneumatic power sources.
• Actuators: They convert energy into movement.
• Electric motors (AC/DC): They are required for rotational movement.
• Pneumatic Air Muscles: They contract almost 40% when air is sucked in them.
• Muscle Wires: They contract by 5% when electric current is passed through them.
• Piezo Motors and Ultrasonic Motors: Best for industrial robots.
• Sensors: They provide knowledge of real time information on the task environment.
Robots are equipped with vision sensors to be to compute the depth in the
environment. A tactile sensor imitates the mechanical properties of touch receptors of
human fingertips.
Computer Vision
This is a technology of AI with which the robots can see. The computer vision plays vital role
in the domains of safety, security, health, access, and entertainment.
Computer vision automatically extracts, analyzes, and comprehends useful information from
a single image or an array of images. This process involves development of algorithms to
accomplish automatic visual comprehension.
• Power supply
• Image acquisition device such as camera
• a processor
• a software
• A display device for monitoring the system
• Accessories such as camera stands, cables, and connectors
50
Artificial Intelligence (AI) Page 58
Face Detection: Many state-of-the-art cameras come with this feature, which enables to
read the face and take the picture of that perfect expression. It is used to let a user access
the software on correct match.
Object Recognition: They are installed in supermarkets, cameras, high-end cars such as
BMW, GM, and Volvo.
Applications of Robotics
The robotics has been instrumental in the various domains such as:
• Industries: Robots are used for handling material, cutting, welding, color coating,
drilling, polishing, etc.
• Military: Autonomous robots can reach inaccessible and hazardous zones during war.
A robot named Daksh, developed by Defense Research and Development Organization
(DRDO), is in function to destroy life-threatening objects safely.
• Medicine: The robots are capable of carrying out hundreds of clinical tests
simultaneously, rehabilitating permanently disabled people, and performing complex
surgeries such as brain tumors.
51
Artificial Intelligence (AI) Page 59
• Exploration: The robot rock climbers used for space exploration, underwater drones
used for ocean exploration are to name a few.
• Entertainment: Disney’s engineers have created hundreds of robots for movie
making.
52
Page 60
Yet another research area in AI, neural networks, is inspired from the natural neural network
of human nervous system.
The human brain is composed of 100 billion nerve cells called neurons. They are connected
to other thousand cells by Axons. Stimuli from external environment or inputs from sensory
organs are accepted by dendrites. These inputs create electric impulses, which quickly travel
through the neural network. A neuron can then send the message to other neuron to handle
the issue or does not send it forward.
ANNs are composed of multiple nodes, which imitate biological neurons of human brain. The
neurons are connected by links and they interact with each other. The nodes can take input
53
Artificial Intelligence (AI) Page 61
data and perform simple operations on the data. The result of these operations is passed to
other neurons. The output at each node is called its activation or node value.
Each link is associated with weight. ANNs are capable of learning, which takes place by
altering weight values. The following illustration shows a simple ANN:
FeedForward ANN
In this ANN, the information flow is unidirectional. A unit sends information to other unit from
which it does not receive any information. There are no feedback loops. They are used in
pattern generation/recognition/classification. They have fixed inputs and outputs.
Feedback ANN
Here, feedback loops are allowed. They are used in content addressable memories.
54
Artificial Intelligence (AI) Page 62
Working ofANNs
In the topology diagrams shown, each arrow represents a connection between two neurons
and indicates the pathway for the flow of information. Each connection has a weight, an integer
number that controls the signal between the two neurons.
If the network generates a “good or desired” output, there is no need to adjust the weights.
However, if the network generates a “poor or undesired” output or an error, then the system
alters the weights in order to improve subsequent results.
• Supervised Learning: It involves a teacher that is scholar than the ANN itself. For
example, the teacher feeds some example data about which the teacher already knows
the answers.
For example, pattern recognizing. The ANN comes up with guesses while recognizing.
Then the teacher provides the ANN with the answers. The network then compares it
guesses with the teacher’s “correct” answers and makes adjustments according to
errors.
• Unsupervised Learning: It is required when there is no example data set with known
answers. For example, searching for a hidden pattern. In this case, clustering i.e.
dividing a set of elements into groups according to some unknown pattern is carried
out based on the existing data sets present.
55
Artificial Intelligence (AI) Page 63
Back Propagation networks are ideal for simple Pattern Recognition and Mapping Tasks.
In these networks, each node represents a random variable with specific propositions. For
example, in a medical diagnosis domain, the node Cancer represents the proposition that a
patient has cancer.
The edges connecting the nodes represent probabilistic dependencies among those random
variables. If out of two nodes, one is affecting the other then they must be directly connected
in the directions of the effect. The strength of the relationship between variables is quantified
by the probability associated with each node.
There is an only constraint on the arcs in a BN that you cannot return to a node simply by
following directed arcs. Hence the BNs are called Directed Acyclic Graphs (DAGs).
BNs are capable of handling multivalued variables simultaneously. The BN variables are
composed of two dimensions:
1. Range of prepositions
2. Probability assigned to each of the prepositions.
Consider a finite set X = {X1, X2, …,Xn} of discrete random variables, where each variable Xi
may take values from a finite set, denoted by Val(Xi). If there is a directed link from
variable Xi to variable, Xj, then variable Xi will be a parent of variable Xj showing direct
dependencies between the variables.
The structure of BN is ideal for combining prior knowledge and observed data. BN can be used
to learn the causal relationships and understand various problem domains and to predict
future events, even in case of missing data.
56
Artificial Intelligence (AI) Page 64
Example problem: Lung cancer. A patient has been suffering from breathlessness. He visits
the doctor, suspecting he has lung cancer. The doctor knows that barring lung cancer, there
are various other possible diseases the patient might have such as tuberculosis and bronchitis.
• Is the patient a smoker? If yes, then high chances of cancer and bronchitis.
• Is the patient exposed to air pollution? If yes, what sort of air pollution?
• Take an X-Ray positive X-ray would indicate either TB or lung cancer.
For now let us consider nodes, with only discrete values. The variable must take on exactly
one of these values at a time.
• Boolean nodes: They represent propositions, taking binary values TRUE (T) and FALSE
(F).
• Ordered values: A node Pollution might represent and take values from {low, medium,
high} describing degree of a patient’s exposure to pollution.
• Integral values: A node called Age might represent patient’s age with possible values
from 1 to 120. Even at this early stage, modeling choices are being made.
For example, what causes a patient to have lung cancer? - Pollution and smoking. Then add
arcs from node Pollution and node Smoker to node Lung-Cancer.
Similarly if patient has lung cancer, then X-ray result will be positive. Then add arcs from
Lung-Cancer to X-Ray.
57
Artificial Intelligence (AI) Page 65
Specify Topology
Conventionally, BNs are laid out so that the arcs point from top to bottom. The set of parent
nodes of a node X is given by Parents(X).
The Lung-Cancer node has two parents (reasons or causes): Pollution and Smoker, while
node Smoker is an ancestor of node X-Ray. Similarly, X-Ray is a child (consequence or
effects) of node Lung-Cancer and successor of nodes Smoker and Pollution.
Conditional Probabilities
Now quantify the relationships between connected nodes: this is done by specifying a
conditional probability distribution for each node. As only discrete variables are considered
here, this takes the form of a Conditional Probability Table (CPT).
First, for each node we need to look at all the possible combinations of values of those parent
nodes. Each such combination is called an instantiation of the parent set. For each distinct
instantiation of parent node values, we need to specify the probability that the child will take.
For example, the Lung-Cancer node’s parents are Pollution and Smoking. They take the
possible values = { (H,T), ( H,F), (L,T), (L,F)}. The CPT specifies the probability of cancer for
each of these cases as <0.05, 0.02, 0.03, 0.001> respectively.
58
Artificial Intelligence (AI) Page 66
59
Artificial Intelligence (AI) Page 67
• Medical: Cancer cell analysis, EEG and ECG analysis, prosthetic design, transplant
time optimizer.
• Speech: Speech recognition, speech classification, text to speech conversion.
• Telecommunications: Image and data compression, automated information
services, real-time spoken language translation.
• Transportation: Truck brake diagnosis, vehicle scheduling, routing systems.
• Software: Pattern Recognition in facial recognition, optical character recognition, etc.
• Time Series Prediction: ANNs are used to make predictions on stocks and natural
calamities.
• Signal Processing: Neural networks can be trained to process an audio signal and
filter it appropriately in the hearing aids.
• Control: ANNs are often used to make steering decisions of physical vehicles.
• Anomaly Detection: As ANNs are expert at recognizing patterns, they can also be
trained to generate an output when something unusual occurs that misfits the pattern.
60
Page 68
Humans developed AI systems by introducing into them every possible intelligence they could,
for which the humans themselves now seem threatened.
Threat to Privacy
An AI program that recognizes speech and understands natural language is theoretically
capable of understanding each conversation on e-mails and telephones.
Threat to Safety
The self-improving AI systems can become so mighty than humans that could be very difficult
to stop from achieving their goals, which may lead to unintended consequences.
61
Page 69
Term Meaning
Agent Agents are systems or software programs capable of autonomous,
purposeful and reasoning directed towards one or more goals. They
are also called assistants, brokers, bots, droids, intelligent agents, and
software agents.
Autonomous Robot Robot free from external control or influence and able to control itself
independently.
Backward Chaining Strategy of working backward for Reason/Cause of a problem.
Blackboard It is the memory inside computer, which is used for communication
between the cooperating expert systems.
Environment It is the part of real or computational world inhabited by the agent.
Forward Chaining Strategy of working forward for conclusion/solution of a problem.
Heuristics It is the knowledge based on Trial-and-error, evaluations, and
experimentation.
Knowledge
Acquiring knowledge from human experts and other resources.
Engineering
Percepts It is the format in which the agent obtains information about the
environment.
Pruning Overriding unnecessary and irrelevant considerations in AI systems.
Rule It is a format of representing knowledge base in Expert System. It is in
the form of IF-THEN-ELSE.
Shell A shell is a software that helps in designing inference engine,
knowledge base, and user interface of an expert system.
Task It is the goal the agent is tries to accomplish.
Turing Test A test developed by Allan Turing to test the intelligence of a machine
as compared to human intelligence.
62