Aiunit 5
Aiunit 5
After successful completion of this course, the student will be able to:
2
• Introduction
• Phases in building Expert Systems
• Expert Systems vs Traditional Systems
• Rule-based Expert Systems
• Blackboard Systems
• Truth Maintenance Systems
• Applications of Expert Systems
Introduction
• One of the goals of AI is to understand the concept of intelligence and develop
intelligent computer programs. An example of a computer program that exhibits
intelligent behavior is an Expert System
• Expert Systems are meant to solve real-world problems which require specialized
human expertise and provide expert quality advice, diagnoses, and recommendations
• An ES is a software program or system that tries to perform tasks similar to human
experts in a specific domain of the problem
• Expert systems are also called Knowledge-based expert systems
Introduction
• The term expert systems is often reserved for programs whose knowledge base contains
the knowledge provided by human experts in contrast to knowledge gathered from
textbooks or non-experts.
• For eg: MYCIN was developed using the expertise of best diagnosticians of bacterial
infections
• In a chemical refinery, a knowledge engineer was assigned to produce an ES to
reproduce the expertise of an experienced retired employee to save the company from
incurring loss
• The power of an ES lies in its store of knowledge regarding the problem domain; the
more knowledge a system is provided, the more competent it becomes.
Phases in Building Expert Systems
• Identification Phase: In this phase, the knowledge engineer determines important
features of the problem with the help of the human domain expert. The parameters
that are determined in this phase are the type and scope of the problem, the kind of
resources required, and the goal and objective of the ES
• Conceptualization Phase: In this phase, the knowledge engineer and domain expert
decide the concepts, relations, and control mechanism needed to describe the
problem-solving method. Issue of granularity is also addressed
Phases in Building Expert Systems
• Formalization Phase: This phase involves expressing the key concepts and relations in
some framework supported by ES building tools. Formalized knowledge consists of
data structures, inference rules, control strategies and languages required for
implementation
• Implementation Phase: During this phase, formalized knowledge is converted to a
working computer program, initially called prototype of the whole system
• Testing Phase: This phase involves evaluating the performance and utility of prototype
system and revising the system, if required. The domain expert evaluates the prototype
system and provides feedback, which helps the knowledge engineer to revise it
Knowledge Engineering
• The whole process of building an ES is called Knowledge Engineering
• It involves interaction between ES builder, or the knowledge engineer, one or more domain
experts, and potential users
• The tasks and responsibilities of knowledge engineer are:
Ensuring that the computer has all the knowledge needed to solve a problem
Choosing one or more forms to represent the required knowledge
Ensuring that the computer can use the knowledge efficiently by selecting some of the
reasoning methods
Knowledge Engineering
If the knowledge changes, the program has to be A different problem, within the domain of the knowledge
rebuilt base, can be solved using the same program without having
to reprogram the system
They don‟t use confidence factor or certainty They allow the use of confidence or certainty factors. They
factors. imitate the confidence humans use in reasoning.
For eg. “If weather is humid, then it might probably rain.”
There is a lot of uncertainty in the statement.
Programs are designed always to produce correct They are designed to behave like human experts and may
results. some times produce incorrect results.
Characteristics of Expert Systems
• Expertise: An ES should exhibit expert performance, have high level of skill, and possess adequate
robustness
• Symbolic reasoning: Knowledge in an ES is represented symbolically which can be easily
reformulated and reasoned
• Self knowledge: A system should be able to explain and examine its own reasoning
• Learning capability: A system should learn from its mistakes and mature as it grows
• Ability to provide training: Every ES should be capable of providing training by explaining the
reasoning process behind solving a particular problem using relevant knowledge
• Predictive modelling power: The system can act as an information processing model of problem
solving. It can explain how new situation led to the change, which helps users to evaluate the effect
of new facts and understand their relationship to the solution
Evaluation of Expert Systems
• For declaring infix operators, possible values of specification Type are xfx, xfy, yfx, and yfy where f
represents operator and x and y represents arguments
:- op(500,yfx, +). ---indicates left associative • The character x means the operator in the
argument must have strictly lower
:- op(500,yfx, -). precedence value than the operator f and y
means the argument can contain operator
:- op(300,xfx, mod).
with the same or lower precedence value
:- op(700,xfx, >) ---- indicates no associativity. than the operator f
• yfx is left associative and xfy is right
associative
Expert System Shell in Prolog
• The Type fx indicates non-associative(prefix) operators, fy denotes right-associative(prefix) operators,
xf implies non-associative(postfix) operators, and yf is used for left-associative(postfix) operators. For
example, logical negation(~) is defined as:
:- op(900,fy, ~)
• Similarly, op allows us to define operators if and then as non-associative prefix operator and right-
associative infix operator, respectively
• We can handle expressions of the form: if[symptom(S1), symptom(S2) ] then disease (D).
Expert System Shell in Prolog
Expert System Shell in Prolog
Expert System Shell in Prolog
Expert System Shell in Prolog
Problem-independent Forward Chaining
Forward inference mechanism is a reasoning process that begins with known facts and proceeds
forward to find a successful goal. Although Prolog uses backward chaining as a control strategy, it is
possible to write a program in Prolog which uses forward chaining concept.
• MYCIN is one of the oldest expert systems. The design of most of the commercial expert systems and
shells has been influenced by that of MYCIN. It was developed as an ES that could diagnose and
recommend treatment for certain blood infections. MYCIN was developed for exploring the ways in
which human experts make guesses on the basis of partial information.
• In MYCIN, the knowledge is represented as a set of if-then rules with certainty factors.
• The MYCIN rule may be written in English for the sake of clarity in the following manner:
• IF the infection is primary-bacteremia AND the site of the culture is one of the sterile sites AND
the suspected portal of entry is the gastrointestinal tract. THEN there is suggestive evidence(0.7)
that infection is bacteroid
• Interpretation of the rule described above is that the conclusion bacteroid will be true with a certainty
factor 0.7 given all the evidences are present
MYCIN Expert System and Various Shells
A user conversation with MYCIN had three stages:
1. In the first stage, initial data regarding the case was gathered to enable the system to come up with a very
broad diagnosis
2. In the second stage, the questions that were asked to test specific hypotheses were more direct in nature
3. In the final stage, a diagnosis was proposed
More questions were asked to determine an appropriate treatment and given the diagnosis and facts about the
patient, a treatment was recommended. At any stage, the user could put up queries regarding why a particular
question was asked or how a conclusion was reached
The basic problem-solving strategy involved going down the disease tree, from general classes of diseases to
very specific ones, gathering information to differentiate between two disease subclasses. For example, if
disease1 has subclasses disease2 and disease3, and the system has established that a patient has disease1, and
subclasses disease2 and disease3 are differentiated by only a few symptoms, then MYCIN would ask about
differentiating symptoms to confirm
Blackboard Systems
• In blackboard systems, indirect and anonymous communication approach among modules with the help
of an intermediary, such as a blackboard data repository, proves to be extremely useful. In this
approach, all processing paths are possible, and a separate moderator mechanism dynamically selects a
path among the possible paths. The information placed on the blackboard is public and is made
available to all modules
• Blackboard systems were developed to solve complex, difficult, and ill-structured problems in a wide
range of application areas. Blackboard architecture is a way of representing and controlling the
knowledge bases; using independent group of rules called Knowledge Sources(KSs) that communicate
through data control database called a blackboard
Blackboard Systems
Blackboard System
Blackboard Systems
i. Knowledge sources
Blackboard systems use a functional modularization of expertise knowledge in the form of Knowledge
Sources(KSs). These are independent computational modules that contain the expert knowledge needed to solve
a given problem. A KS is regarded to a specialist at solving certain aspects of the overall application and is
separate and independent of all other KSs in the blackboard system. It is possible to add additional KSs to the
blackboard system and upgrade or even remove existing KSs. Each KS is aware of the conditions under which it
can contribute toward solving a particular problem. This knowledge in problem-solving process is known as
triggering condition
Blackboard Systems
ii. Blackboard
Blackboard represents a global data repository and shared data structure available to all KSs. It contains
raw input data, partial solutions, alternatives and final solutions, control information, communication medium
and buffer, and a KS trigger mechanism used in various phases in problem-solving. A blackboard is subdivide
into regions, with each region corresponding to a particular kind of information.
Sometimes a control shell directs the problem-solving process by allowing KSs to respond
opportunistically to changes made to the blackboard. A blackboard system uses the process of incremental
reasoning, i.e. the solution is built one step at a time.
Justification Functions
Functionality of a Non-monotonic TMS
Justification Tree
Contradiction Handling
• The TMS interface function enables contradictory information to be given to the TMS.
• Most TMSs possess a technique of informing the user that a given premise set is inconsistent with the internal
constraints
• This can be done by adding a special proposition symbol called Contradiction
• If the TMS is able to determine that a given premise set Σ contradicts the internal constraints then the function
follows_from(contradiction, Σ) returns yes. In this case, justifying_literals(contradiction, Σ) and justifying
_constraints(contradiction, Σ) return a set of literals and a set of constraints respectively, that underlie the
contradiction
Non-monotonic TMS
Justification of facts
Applications of TMS to search
• TMS is also useful in controlling searches, specifically those searches needed in Constraint Satisfaction problems
• TMS organizes data within a data abstraction called a context, which corresponds to a single problem state and
contains currently believed data
• TMS provides believed data retrieval, belief revision, contradiction handling, and non-monotonicity handling, these
features help a problem solver to examine state spaces
Application of Expert Systems
The major purpose of building an ES for an organization is to preserve the know-how, experience, and
expertise of the experts, which is a valuable asset to the organization. The purpose of ES is to provide this
knowledge to other members of the organization for problem-solving purposes. Expert Systems have been
widely developed and used to solve problems in different types of domains. Few of them are:
Diagnosis
The ES belonging to this class perform the task of inferring malfunctioning of system from observations.
Such expert systems use situation descriptions, behavior characteristics, or knowledge about component
design to determine the probable cause of system malfunction. Diagnosis can refer to inferring a possible
disease from a given set of symptoms in the field of medicine.
Planning and Scheduling
The expert systems of this class help in designing actions and plans before actually solving a given
problem. They analyze a set of one or more potentially complex and interacting goals in order to
determine a set of actions that are needed to achieve these goals. Examples of this class are
• Airline scheduling of flights
• Manufacturing job-shop scheduling
• Creating plan for applying series of chemical reactions
• Manufacturing process planning
• Creating air-strike plan projected over several days, etc.
Design and manufacturing
This is one of the most important areas of ES applications. Here, a solution to a problem is configured by a
given set of objects under a set of constraints. Configuration applications were initiated by computer
companies to facilitate the manufacturing of semi-custom minicomputers. Examples of this are:
• Gene cloning
• Integrated circuits layouts designing
• Creation of complex organic molecules
• Modular home building
• Manufacturing, etc.
Prediction
The ES of this class perform the task of inferring the likely consequences of a given situation. For
example:
• Weather prediction for rains, storms and tornado
• Prediction of crops
• Share market, etc.
Interpretation
The expert systems of this class perform the task of interpreting and inferring situation description data of any
domain such as geological data, census data, medical data , etc. For example
• Interpreting data from ICU test equipment for further investigation or monitoring
• Interpreting intelligent sensors reports to perform situation assessment
• Interpreting radar images to classify ships, etc.
Instruction
An ES can offer tutorials and instructions to students by incorporating a student‟s behavior and learning capability
models and can also evaluate student‟s acquired skills
Debugging
The systems of this class prescribe remedies for malfunctioning devices. They are
• Suggest the type of maintenance needed to correct faulty equipment.
• Help in debugging large computer programs to improve the performance, etc.
Knowledge publishing
This is relatively new but a potentially important area now-a-days. The primary function of ES in this field
is to deliver knowledge to user that is in context of the user‟s problem. For example:
• Advisors, which counsel a user on appropriate grammatical usage in a text
• A tax advisor that accompanies a tax preparation program, which advises the user regarding tax
strategy, tactics, and individual tax policy
Reference Books:
1. Artificial Intelligence, Elaine Rich, Kevin Knight, Shivashankar B Nair, 3rd Edition, Tata McGraw
Hill Education Private Limited., 2009
2. Artificial Intelligence- A modern Approach, 3rd Edition, Stuart Russel, Peter Norvig, Pearson
Education
60