Expert systems Artificial Intelligence

ittirehan 15,226 views 28 slides Aug 07, 2018
Slide 1
Slide 1 of 28
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28

About This Presentation



Slide Content

EXPERT SYSTEM
How computers gain expertise?

What is an EXPERT SYSTEM?
●An expert system is a computer expert that emulates the decision making
ability of a human expert.
●Expert system, a computer program that uses artificial intelligence methods
to solve complex problems within a specialized domain that ordinarily
requires human expertise.

Example: Making of a medical diagnosis expert
system
●A medical diagnosis expert system lets the user diagnose his disease without
going to a real doctor (but of course, user has to go to a real doctor for
treatment)

How does the EXPERT SYSTEM gain
EXPERTISE?

How does medical diagnosis expert system gain
expertise?

Components of an Expert System
1.Knowledge Base
2.Inference Engine
3.User Interface

1.Knowledge Base
●A knowledge base is an organized collection of facts about the system’s
domain.
●Facts for a knowledge base must be acquired from human experts through
interviews and observations.
●This knowledge is then usually represented in the form of “if-then” rules
(production rules): “If some condition is true, then the following inference can
be made (or some action taken).”
●A probability factor is often attached to the conclusion of each production
rule and to the ultimate recommendation, because the conclusion is not a
certainty.

Components of Knowledge Base
●Factual Knowledge − It is the information widely accepted by the Knowledge
Engineers and scholars in the task domain.
●Heuristic Knowledge − It is about practice, accurate judgement, one’s ability
of evaluation, and guessing.

Knowledge Acquisition
●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.

Knowledge Base for Medical Diagnosis Expert
system
Symptoms Disease
Fever, cough, conjunctivitis, running nose, rashes Measles
Fever,headache, ache, conjunctivitis, chills,sore
throat,cough,running nose
Flu
Headache, sneezing, sore throat, running nose,
chills
Cold
Fever, chills,ache,rashes Chickenpox

2. The Inference Engine
●An inference engine interprets and evaluates the facts in the knowledge
base in order to provide an answer or to reach a goal state
●For example, if the KB contains the production rules “if x, then y” and “if y, then
z,” the inference engine is able to deduce “if x, then z.”
●In medical diagnosis ES, if a user has Fever, chills,ache,rashes, then user
is suffering from chickenpox
●Strategies used by the inference engine
○Forward chaining
○Backward chaining

Forward Chaining
●“What can happen next?”
●It is a data-driven strategy.
●The inferencing process moves from the facts of the case to a goal
(conclusion).
●The inference engine attempts to match the condition (IF) part of each rule in
the knowledge base with the facts currently available in the working memory.
●If several rules match, a conflict resolution procedure is invoked;

Forward chaining diagram

Forward Chaining in Medical Diagnosis ES
●A user has fever, headache, ache, conjunctivitis, chills,sore
throat,cough,running nose.
●In forward chaining, the inference engine will use the symptoms specified to
conclude to the disease the user is suffering from.
●After going through the above symptoms, the inference engine concludes that
the user is suffering from flu by checking the knowledge base.

Backward Chaining
●“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.
●The inference engine attempts to match the assumed (hypothesized)
conclusion - the goal or subgoal state - with the conclusion (THEN) part of the
rule.
● If such a rule is found, its premise becomes the new subgoal.
●In an ES with few possible goal states, this is a good strategy to pursue.

Backward Chaining Diagram

Backward Chaining in Medical Diagnosis ES
●Suppose a user has measles.
●Now, the inference engine will look up in the knowledge base to derive the
symptoms that could have resulted in measles.
●It inferred that the symptoms were fever, cough, conjunctivitis, running nose,
rashes.
●This worked as only few states were present.

3. User Interface
●User interface provides interaction between user of the ES and the ES itself.
●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 appear in the following forms −
○Natural language displayed on screen.
○Verbal narrations in natural language.
○Listing of rule numbers displayed on the screen.

Code for medical diagnosis ES: 1
#include <iostream>
using namespace std;
void measels(char,char,char,char,char);
void flu(char,char,char,char,char,char,char,char);
void cold(char,char,char,char,char);
void chickenpox(char,char,char,char);

Code for medical diagnosis ES: 2
int main()
{
char name[50];
char a,b,c,d,e,f,g,h,i,j,k;
cout << "Please enter your name.. " << endl;
cin>> name;
cout << "Do you have fever? (y/n)"<< endl;
cin>>a;
cout << "Do you have rashes? (y/n)"<< endl;

Code for medical diagnosis ES: 3
cin>>b;
cout << "Do you have headache? (y/n)"<< endl;
cin>>c;
cout << "Do you have running nose? (y/n)"<< endl;
cin>>d;
cout << "Do you have conjunctivitis? (y/n)"<< endl;
cin>>e;
cout << "Do you have cough? (y/n)"<< endl;
cin>>f;
cout << "Do you have ache? (y/n)"<< endl;

Code for medical diagnosis ES: 4
cin>>g;
cout << "Do you have chills? (y/n)"<< endl;
cin>>h;
cout << "Do you have swollen glands? (y/n)"<< endl;
cin>>i;
cout << "Do you have sneezing? (y/n)"<< endl;
cin>>j;
cout << "Do you have sore throat? (y/n)"<< endl;
cin>>k;

Code for medical diagnosis ES: 5
measles(a,f,e,d,b);
flu(a,c,g,e,h,k,f,d);
cold(c,j,k,d,h);
chickenpox(a,h,g,b);
return 0;
}

Code for medical diagnosis ES: 6
void measles(char q,char w,char r,char t,char y)
{
if(q=='y'&&w=='y'&& r=='y' && t=='y' && y== 'y')
cout<< "You may have measles"<< endl;
else
cout<< "";
}

Code for medical diagnosis ES: 7
void flu(char q,char w,char r,char t,char y,char p,char l,char x)
{
if(q=='y'&&w=='y'&& r=='y' && t=='y' && y== 'y'&& p=='y' && l=='y' && x=='y')
cout<< "You may have flu."<< endl;
else
cout<< "";
}

Output to the User Interface

Applications of Expert System

Limitations of Expert System
No technology offers an easy and total solution. Large systems are costly and
require significant development time and computer resources. ESs also have their
limitations which include:
●Limitations of the technology
●Problems with knowledge acquisition
●Maintaining human expertise in organizations