Rule-Based/Expert Systems - Computer Science & Engineering

Download Report

Transcript Rule-Based/Expert Systems - Computer Science & Engineering

Rule-Based/Expert Systems
Catie Welsh
CSE 435 – IDSS
October 13, 2006
Outline




Defining Expert Systems
Describing uses and components of Expert
Systems
Showing an example of an Expert System
Describing the underlying programming used
to build an expert system.
Definition

Expert systems are:
–
–
–
–
–
Knowledge based systems
Part of the Artificial Intelligence field
Computer programs that contain some subject-specific
knowledge of one or more human experts
Made up of a set of rules that analyze user supplied
information about a specific class of problems.
Systems that utilize reasoning capabilities and draw
conclusions.
Terms Associated with Expert Systems





Knowledge Engineering – building an expert system
Knowledge Engineers – the people who build the
system
Knowledge Representation – the symbols used to
represent the knowledge
Factual Knowledge – knowledge of a particular task
domain that is widely shared
Heuristic Knowledge – more judgmental knowledge
of performance in a task domain.
Uses of Expert Systems



Very useful to companies with a high-level of
experience and expertise that cannot easily
be transferred to other members.
Solves problems that would normally be
tackled by a medical or other professional.
Currently used in fields such as accounting,
medicine, process control, financial service,
production, and human resources
Prominent Expert Systems




MYCIN – used to diagnose infectious blood diseases
and recommend antibiotics.
DENDRAL – embedded a chemist’s knowledge of
mass spectrometry rules to use in analysis.
CADUCEUS – used to analyze blood-borne
infectious bacteria
CLIPS and Prolog programming languages are both
used in expert systems
–
The Age of Empire game uses CLIPS to control its AI
Building an Expert System


Can be built from scratch – using lots of if-then-else statements.
There are many products being sold to make programming
these systems easier.
–
A few that I’m aware of:




Exsys – www.exsys.com – provides an easy to use user interface to
develop traditional applications or web-based solutions.
Barisoft – www.barisoft.com – developed by a PSU professor and
finely tuned by his students
CLIPS - provides a complete environment for the construction of rules
and/or object based expert systems
Jess – the Rule Engine, built on top of CLIPS, for the Java Platform
Components of an Expert System



Set of Rules – derived from the knowledge base and
used by the interpreter to evaluate the inputted data
Knowledge Engineer – decides how to represent the
experts knowledge and how to build the inference
engine appropriately for the domain
Interpreter – interprets the inputted data and draws a
conclusion based on the users responses.
Problem-solving Models



Forward-chaining – starts from a set of
conditions and moves towards some
conclusion
Backward-chaining – starts with a list of
goals and the works backwards to see if
there is any data that will allow it to conclude
any of these goals.
Both problem-solving methods are built into
inference engines or inference procedures
Knowledge Objects




Classes – questions the user is asked
Parameters – place holder for a character string
which can be variable and used to decide if/when a
question is asked
Procedures – definitions of calls to external
procedures
Rule Nodes – inferencing is done by a tree structure
(decision trees!) and the nodes are called rule
nodes.
Rule Base as a forest of trees


Top node is called the goal node.
Leaves are rule nodes – several types of rule
nodes
–
–
–
Evidence node – functions to obtain information
from the operator by asking specific questions
External node – indicates that data will be used
which was obtained from a procedure call
Reference node – refers to another tree or
subtree
Advantages of Expert Systems





Provide consistent answers for repetitive
decisions, processes and tasks.
Hold and maintain significant levels of
information.
Reduce employee training costs
Centralize the decision making process.
Create efficiencies and reduce the time
needed to solve problems.
Advantages (cont’d)




Combine multiple human expert intelligences
Reduce the amount of human errors.
Give strategic and comparative advantages
creating entry barriers to competitors
Review transactions that human experts may
overlook.
Disadvantages of Expert Systems






Lack human common sense needed in some
decision making.
Will not be able to give the creative responses that
human experts can give in unusual circumstances.
Domain experts cannot always clearly explain their
logic and reasoning.
Challenges of automating complex processes.
Lack of flexibility and ability to adapt to changing
environments.
Not being able to recognize when no answer is
available.
Example Expert System


This is an example expert system built to
help show a user their potential risk of
contracting colon cancer based on their
lifestyle and family history.
http://www.barisoft.com/mycancercheck/
Example System




























OBJECT NUMBER 21
Name: [Age_Related]
Prompt: How OLD were you when you were FIRST diagnosed with any of the other related cancer?
Max. selections: 100
Legal Values:
-0
----------------OBJECT NUMBER 22
Name: {orc_age_rpt}
Prompt: Please enter a value for the ORC_AGE_RPT.
Max. selections: open
Legal Values:
-OPEN STRING
----------------OBJECT NUMBER 23
Name: Two_Related_Cancers
Prompt: Have you ever been diagnosed with any TWO or more of the following cancers? Colon, Gastric, Small Bowel, Hepatobiliary, Pancreatic, Endometrial,
Ovarian, Renal pelvis, or Ureter.
Max. selections: 1
Legal Values:
-Yes
-No
----------------OBJECT NUMBER 24
Name: {Non_Related_Cancers}
Prompt: Please enter any additional CANCERS for which YOU have been diagnosed. Example: Breast, Lymphoma. If no other cancers, then type None.
Max. selections: open
Legal Values:
-OPEN STRING
Example System (cont’d)

* * * * RULES SUMMARY * * * *

No. of rules defined: 129

RULE NUMBER 1:disclaimer-no
IF
Disclaimer=No - I do not agree to the terms and conditions in the disclaimer
THEN
{status}=stop program
!Action=!LOOP




















RULE NUMBER 2:disclaimer-yes
IF
Disclaimer=Yes - I have read the disclaimer and agree to all of its terms and conditions
THEN
{status}=continue with program
RULE NUMBER 3:Object Initialization
IF
THEN
[LS_Score]=0
RULE NUMBER 4:BMI Calculation
IF
[height]==!NOTBLANK
[weight]==!NOTBLANK
THEN
[bmi]=([weight]*703)/([height]*[height])
More Rules for the Example System























RULE NUMBER 123:Calc Greater Next or Suggested
IF
[age]==!NOTBLANK
[Suggested_Screen_Age]==!NOTBLANK
[Next_Scrn_Age]==!NOTBLANK
THEN
[Dif_Next]=[Next_Scrn_Age]-[Suggested_Screen_Age]
RULE NUMBER 124:If Next later than Suggested
IF
[Dif_Next]=>0
THEN
[Age_Difference]=[age]-[Next_Scrn_Age]
RULE NUMBER 125:If Next less or equal Suggested
IF
[Dif_Next]=<1
THEN
[Age_Difference]=[age]-[Suggested_Screen_Age]
RULE NUMBER 126:Get1stScrn Now
IF
[Age_Difference]==0
THEN
{screening_rec_age_rpt}=Schedule Screening Now at Age ([age]).
[Get_Screened_Age]=[age]
Conclusions




Very interesting field of AI.
Expert Systems are extremely useful in the
right domain.
They are inflexible and require a lot of
collaboration between a knowledge engineer
and a domain expert.
When implemented correctly, expert systems
remove human error from the equation.
References



“Expert Systems and Artificial Intelligence”.
Engelmore, R., Feigenbaum, E., Chapter 1.
http://www.wtec.org/loyola/kb/c1_s1.htm
“The Origin of Rule-Based Systems in AI”,
Davis, R., King, J.
“Expert System – Wikipedia”,
http://en.wikipedia.org/wiki/Expert_system