0% found this document useful (0 votes)
20 views

Expert Systems

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Expert Systems

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

Expert System

Module 5
Contents
Expert Systems:
What an expert system is;
How it works and how it is built,
Basic components of an expert system, Expert System
Architectures,
Examples of Expert Systems.
Rule-based Expert systems: Structure of rule based expert
system, Conflict resolution, Uncertainty Management,
Advantages & disadvantages of rule-based.
Introduction to Frame-based Expert systems.
Types of Expert Systems
• Types of Expert Systems

These include a rule-based expert system, frame-based expert


system, fuzzy expert system, neural expert system, and
neuro-fuzzy expert system.

• Focus is on rule-based expert system


What are Expert Systems?
• Expert systems (ES) are one of the prominent research domains of AI.
• The expert systems are the computer AI applications developed to
solve complex problems in a particular domain, at the level of
extra-ordinary human intelligence and expertise.
• It is introduced by the researchers at Stanford University, Computer
Science Department.
• Expert System is an interactive and reliable computer-based
decision-making system which uses both facts and heuristics to
solve complex decision-making problems.
Characteristic of Expert System
• Highest Level of Expertise: An expert system in artificial
intelligence provides the highest level of expertise along with efficiency
and accuracy.
• Reaction Time: An expert system in artificial intelligence has a very
low reaction time. It takes less time than a human expert to solve the
same complex problem.
• Good Reliability: The Expert system in AI needs to be reliable,
and it must not make any a mistake.
• Flexible: An expert system in artificial intelligence is flexible to tackle
different problems.
• Effective: An expert system in artificial intelligence has a robust
mechanism to resolve complex problems and later administer them.
• Capable: An expert system in artificial intelligence can handle
complex problems and deliver solutions on time.
Components /Architecture of Expert System
There are 5 Components of expert systems:
• Knowledge Base
• Inference Engine
• Knowledge acquisition and learning module
• User Interface
• Explanation module
Knowledge base: The knowledge base in an expert system represents facts
and rules. It contains knowledge in specific domains along with rules in
order to solve problems, procedures and intrinsic data relevant to the
domain.
Inference engine: The most basic function of the inference engine is to
acquire relevant data from the knowledge base, interpret it, and to find a
solution as per the user’s problem. Inference engines also have
explanationatory and debugging abilities.
Knowledge acquisition and learning module: This component functions
to allow the expert systems to acquire more data from various sources and
store it in the knowledge base.
User interface: This component is essential for a non-expert user to
interact with the expert system and find solutions.
Explanation module: As the name suggests, this module helps in
providing the user with an explanation of the achieved conclusion.
Strategies Used By The Inference Engine
The Inference Engine uses the following strategies to recommend
solutions:
• Forward Chaining
• Backward Chaining

1. Forward chaining – Answers the question, “What can happen in the future?”
2. Backward chaining – Answers the question, “Why did this happen?”
Forward Chaining
• Forward chaining is a form of reasoning which start with atomic sentences in the knowledge
base and applies inference rules (Modus Ponens) in the forward direction to extract more
data until a goal is reached.
• The Forward-chaining algorithm starts from known facts, triggers all rules whose premises
are satisfied, and add their conclusion to the known facts. This process repeats until the
problem is solved.
Forward Chaining in Propositional Logic
• In propositional logic, forward chaining starts its journey from the given knowledge base. If
all the premises of the implication are known, then its conclusion will be added to the set of
known facts.
• Let’s see an example:
1. If D barks and D eats bone, then D is a dog.
2. If V is cold and V is sweet, then V is ice-cream.
3. If D is a dog, then D is black.
4. If V is ice-cream, then it is Vanilla.
• Derive forward chaining using the given known facts to prove Tomy is black.
• Let’s see an example:
1. If D barks and D eats bone, then D is a dog.
2. If V is cold and V is sweet, then V is ice-cream.
3. If D is a dog, then D is black.
4. If V is ice-cream, then it is Vanilla.
• Derive forward chaining using the given known facts to prove Tomy
is black.
Tomy barks.
Tomy eats bone.
Solution: Given Tomy barks.
• From (1), it is clear:
• If Tomy barks and Tomy eats bone, then Tomy is a dog.
• From (3), it is clear:
• If Tomy is a dog, then Tomy is black.
• Hence, it is proved that Tomy is black.
Example 1
Example 2
Backward chaining
• A backward chaining algorithm is a form of reasoning, which starts with
the goal and works backward, chaining through rules to find known facts
that support the goal.
Properties of backward chaining:
• It is known as a top-down approach.
• Backward-chaining is based on modus ponens inference rule.
• In backward chaining, the goal is broken into sub-goal or sub-goals to
prove the facts true.
• It is called a goal-driven approach, as a list of goals decides which rules are
selected and used.
• Backward -chaining algorithm is used in game theory, automated theorem
proving tools, inference engines, proof assistants, and various AI
applications.
• The backward-chaining method mostly used a depth-first search strategy
for proof.
Backward Chaining in Propositional Logic
• In propositional logic, backward chaining begins from the
goal and using the given propositions, it proves the asked
goal. There is a backward chaining algorithm which is
used to perform backward chaining for the given axioms.
Given that:
1. If D barks and D eats bone, then D is a dog.
2. If V is cold and V is sweet, then V is ice-cream.
3. If D is a dog, then D is black.
4. If V is ice-cream, then it is Vanilla.
Derive backward chaining using the given known facts to prove Tomy is black.
• Tomy barks.
• Tomy eats bone.
Solution:
1. On replacing D with Tomy in (3), it becomes:
• If Tomy is a dog, then Tomy is black.
• Thus, the goal is matched with the above axiom.
• Now, we have to prove Tomy is a dog. …(new goal)
• Replace D with Tomy in (1), it will become:
• If Tomy barks and Tomy eats bone, then Tomy is a dog. …(new goal)
• Again, the goal is achieved.
• Now, we have to prove that Tomy barks and Tomy eats bone. …(new goal)
• As we can see, the goal is a combination of two sentences which can be further divided as:
• Tomy barks.
• Tomy eats bone.
• From (1), it is clear that Tomy is a dog.
• Hence, Tomy is black.
Example 1
Building an Expert System in Artificial
Intelligence
1. Determine the characteristics of the problem.
2. Knowledge engineers and domain experts collaborate to define the issue.
• Domain expert – A person or group of people whose skills and
knowledge are acquired to develop the knowledge base.
• Knowledge engineer – A technical person who uses the acquired
knowledge and integrates it with expert computer systems.
3. The knowledge engineer, after defining the problem, translates it into
understandable computer language knowledge. The knowledge engineer
designs the inference engine that uses the knowledge when called to assist.
4. The knowledge expert also integrates the use of unknown knowledge in
the reasoning process with an explanation.
Examples of expert systems
Expert systems that are in use include the following examples:
• CaDet (Cancer Decision Support Tool) is used to identify cancer in its
earliest stages.
• DENDRAL helps chemists identify unknown organic molecules.
• DXplain is a clinical support system that diagnoses various diseases.
• MYCIN identifies bacteria such as bacteremia and meningitis, and
recommends antibiotics and dosages.
• PXDES determines the type and severity of lung cancer a person has.
• R1/XCON is an early manufacturing expert system that automatically
selects and orders computer components based on customer
specifications.
Rule-based Expert systems
What is knowledge?

• is a theoretical or practical understanding of a subject or a domain.


• Anyone can be considered as domain expert if he or she has deep
knowledge and strong practical experience in a particular domain.
• The human mental process is internal, and it is too complex to be
represented as an algorithm
• However, most experts are capable of expressing their knowledge in
the form of rules for problem solving.

IF the ‘traffic light’ is ‘green’


THEN the action is go

IF the ‘traffic light’ is ‘red’


THEN the action is stop
Rules as a Knowledge Representation
Technique
• The term rule in AI, can be defined as an IF-THEN structure that relates
given information or facts in the IF part to some action in the THEN part.
• A rule provides some description of how to solve a problem.
• Rule are relatively easy to create and understand
• Any rules consists of two parts: the IF part, called the antecedent
(premise or condition) and the THEN part called the consequent
(conclusion or action)
IF <antecedent> THEN <consequent>
• A rule can have multiple antecedents joined by the keywords AND
(conjunction), OR (disjunction) or a combination of both.
IF <antecedent 1> IF <antecedent 1>
AND <antecedent 2> OR <antecedent 2>
⁝ ⁝
AND <antecedent n> OR <antecedent n>

THEN <consequent> THEN <consequent>


• The antecedent of a rule incorporates two parts: an object (linguistic
object) and its value. The object and its value are linked by an
operator.
• The operator identifies the object and assigns the value. Operators
such as is, are, is not, are not are used to assign a symbolic value to
a linguistic object.
• Expert systems can also used mathematical operators to define an
object as numerical and assign it to the numerical value.

IF ‘age of the customer’ < 18 AND ‘cash withdrawal’ > 1000


THEN ‘signature of the parent’ is required
Rules can represent
Relation: IF the ‘fuel tank’ is empty THEN the car is dead.
Recommendation: IF the season is autumn AND the sky is cloudy AND the
forecast is drizzle THEN the advice is ‘take an umbrella’
Directive: IF the car is dead AND the ‘fuel tank’ is empty THEN the action is
‘refuel the car’
Strategy: IF the car is dead THEN the action is ‘check the fuel tank’; step1
complete
IF step1 is complete AND the ‘fuel tank’ is full THEN the action is ‘check the
battery’; step2 is complete
Heuristic: IF the spill is liquid AND the ‘spill pH’ < 6 AND the ‘spill smell’ is
vinegar THEN the ‘spill material’ is ‘acetic acid’
Components of Rule-based expert
system
There are five components
1. Domain expert
2. Knowledge engineer
3. Programmer
4. Project manager
5. End-user
Domain Expert:
• is a knowledgeable and skilled person capable of solving problems in a specific area
or domain.
• the person’s expertise is to be captured in the expert system.
• could be more than one expert that contribute to an expert system.
• the expert must be able to communicate his or her knowledge, be willing to
participate in the expert system development and commit a substantial amount of
time to the project.
• is the most important person in the expert system development team.

Knowledge Engineer:
• is someone who is capable of designing, building and testing an expert system.
• interviews the domain expert to find out how a particular problem is solved.
• establishes what reasoning methods the expert uses to handle facts and rules and
decides how to represent them in the expert system.
• choose some development software or an expert systems shell, or look at
programming languages for encoding the knowledge.
• responsible for testing, revising and integrating the expert system into the workplace.
Programmer:
• is the person responsible for the actual programming, describing the domain
knowledge in terms that a computer can understand.
• needs to have the skills in symbolic programming in such AI language such as
Prolog.
• should also know conventional programming language like C, Pascal, FORTRAN
and Basic

Project Manager:
• is the leader of the expert system development team, responsible for keeping the
project on track
• makes sure that all deliverables and milestones are met, interacts with the
expert, knowledge engineer, programmer and end-user

End-user:
• often called the user
• is a person who uses the expert system when it is developed
• must not only be confident in the expert system performance but also feel
comfortable using it
Basic Structure of a rule-based
expert system
Knowledge base contains the domain knowledge useful for problem
solving
• In rule-based expert system, the knowledge is represented as a set of
rules. Each rule specifies a relation, recommendation, directive,
strategy or heuristic and has the IF (condition) THEN (action)
structure.
• When the condition part of a rule is satisfied, the rule is said to fire
and the action part is executed
• The database includes a set of facts used to match against the IF
(condition) parts of rules stored in the knowledge base.
• The inference engineer carries out the reasoning whereby the
expert system reaches a solution. It links the rules given in the
knowledge base with the facts provided in the database.
• The explanation facilities enable the user to ask the expert system
how a particular conclusion is reached and why a specific fact is
needed
• The user interface is the means of communication between a user
seeking a solution to the problem and an expert system
Conflict Resolution
Let us consider two simple rules for crossing a road. And let us now add the third rule:
Rule 1:
IF the ‘traffic light’ is green THEN the action is go

Rule 2:
IF the ‘traffic light’ is red THEN the action is stop

Rule 3:
IF the ‘traffic light’ is red THEN the action is go

We have two rules, Rule 2 and Rule 3, with the same IF part. Thus both of them
can be set to fire when the condition part is satisfied.
These rules represent a conflict set
The inference engine must determine which rule to fire from such a set
A method for choosing a rule to fire when more than one rule can be fired in a given
cycle is called conflict resolution
Uncertainty Management in Rule-based Expert
Systems
Information can be incomplete, inconsistent, uncertain, or all three.
Uncertainty is defined as the lack of the exact knowledge that would enable us to
reach a perfectly reliable conclusion.
Classical logic permits only exact reasoning. Classical logic permits only exact
reasoning. It assumes that perfect knowledge always exists and the law of the
excluded middle can always be applied:

IF A is true IF A is false THEN A is not false THEN A is not


true

Facts and inferences dealt with so far have been categorical - either true or false; real
life facts and rules are often less than certain
Uncertainty can be expressed numerically as certainty/confidence factor (cf) or
measure of belief (mb)
cf usually is a real number in a particular range, eg, 0 to 1 or -1 to 1
Various schemes have been proposed to deal with uncertainty
Advantages of rule-based expert systems
Separation of knowledge from its processing
• The structure of a rule-based expert system provides an effective
separation of the knowledge base from the inference engine.
• This makes it possible to develop different applications using the
same expert system shell.

Dealing with incomplete and uncertain knowledge


• Most rule-based expert systems are capable of representing and
reasoning with incomplete and uncertain knowledge.
Disadvantages of rule-based expert
systems
Opaque relations between rules
• Although the individual production rules are relatively simple
and self-documented, their logical interactions within the large set
of rules may be opaque.
• Rule-based systems make it difficult to observe how individual
rules serve the overall strategy.

Ineffective search strategy


• The inference engine applies an exhaustive search through all
the production rules during each cycle.
• Expert systems with a large set of rules (over 100 rules) can be
slow, and thus large rule-based systems can be unsuitable for
real-time applications
Disadvantages of rule-based expert
systems
Inability to learn
• In general, rule-based expert systems do not have an
ability to learn from the experience.
• Unlike human expert, who knows when to “break the
rules”, an expert system cannot automatically modify its
knowledge base, or adjust existing rules or add new ones.
• The knowledge engineer is still responsible for revising
and maintaining the system
Frame-based Expert systems
Frame-based expert systems are widely used as the knowledge
representation for expert systems with large knowledge base.
Many systems have the ability to connect to external databases.
Facts stored in databases can be loaded into expert system's
knowledge base and inference is performed by the inference engine
of the expert system.
What is Frame
• A frame is a record like structure which consists of a collection of
attributes and its values to describe an entity in the world.
• It consists of a collection of slots and slot values. These slots may
be of any type and sizes. Slots have names and values which are
called facets.
• A frame may consist of any number of slots, and a slot may include
any number of facets and facets may have any number of values. A
frame is also known as slot-filter knowledge representation in
artificial intelligence.
Each frame has its own name and a set of attributes associated with
it.
Name, weight, height and age are slots in the frame Person.
Model, processor, memory and price are slots in the frame
Computer.
Each attribute or slot has a value attached to it.

Frames provide a natural way for the structured and concise


representation of knowledge.
Example
Advantages of frame based expert
systems
• It is very easy to add slots for new attribute and relations.
• It is easy to include default data and to search for missing values.
• Frame representation is easy to understand and visualize.
Question bank
1. What is expert systems? Explain the characteristics of the expert
systems.
2. Explain the components or architecture of the expert systems.
3. Explain the two strategies used by the inference engine in expert
systems.
4. Explain the process of building an expert system in AI
5. Explain the components of rule-based expert system
6. Explain the structure of a rule-based expert system.
7. Explain the conflict resolution and uncertainty management in
rule-based expert system
8. Explain frame in frame based expert system.
Thank you

You might also like