"Expert" Knowledge Module
"Expert" Knowledge Module
User
Knowledge Interface
Base
Inference
Engine
Explanation
Facility
Blackboard
Language/Shell
Environment
One Definition of Expert System
• A computing system capable of representing and
reasoning about some knowledge rich domain,
which usually requires a human expert, with a
view toward solving problems and/or giving
advice.
– the level of performance makes it “expert”
– Some also require it to be capable of explaining its
reasoning.
– Does not have a psychological model of how the
expert thinks, but a model of the expert’s model of
the domain.
Categories of Expert Systems
Category Problem Addressed
Prediction Inferring likely consequences of given situations
Diagnosis Inferring system malfunctions from
observations, a type of interpretation
Design Configuring objects under constraints, such as
med orders
Planning Developing plans to achieve goals (care plans)
Monitoring Comparing observations to plans, flagging
exceptions
Debugging Prescribing remedies for malfunctions
(treatment)
Repair Administer a prescribed remedy
Instruction Diagnosing, debugging, and correcting student
performance
Control Interpreting, predicting, repairing, and
monitoring system behavior
Knowledge in a Knowledge Base
• Knowledge specific to the domain + facts specific to the problem
being solved
• A medical KB is defined in HANDBOOK of MEDICAL INFORMATICS as:
– “a systematically organized collection of medical knowledge that is accessible
electronically and interpretable by the computer.”
• They note “a medical KB usually:
– includes a lexicon (vocabulary of allowed terms) and
– specifies relationships between terms in the lexicon. “
• For example, in a diagnostic KB, terms might include:
– patient findings (e.g., fever or pleural friction rub),
– disease names (e.g., nephrolithiasis or lupus cerebritis) and
– diagnostic procedure names (e.g., abdominal auscultation or chest computed
tomography).
• Knowledge Representation is the key issue
– Aim is usually to present the knowledge in as "declarative" a fashion as possible
Traditional Feature Comparisons:
E/KBS versus ANN
E/KBS Neural Networks
• Symbolic • Numeric
• Logical • Associative
• Mechanical • Biological
• Serial • Parallel
• Rule Based • Example Based
• Needs “Rules” • Finds “Rules”
• Much Programming • Little Programming
• Requires Reprogramming • Adaptive System
• Needs an Expert • Needs a Database
But much of this too simple, KBS are not really “logical” and can use examples etc.
Processing Comparisons
INPUT(Type)
OUTPUT
(Procedural) Conventional Processing
Data Input
Procedures applied to data Data
1, 2, 3, etc. Output
Facts Objects
Knowledge-
base
Processes Attributes
Events
Relationships
Definitions
KBS architecture and components
User Interface
may employ:
KBS Editor
question &
General
answer Knowledge-Base
user
menu-driven Inference Engine
Case Specific
Knowledge-Base
natural
language, or
Explanation System
GUI styles
Knowledge Acquisition
Module
Knowledge representation formalisms
& Inference
KR Inference
* Logic Resolution principle
* Production rules backward (top-down, goal directed)
forward (bottom-up, data-driven)
* Semantic nets &
Frames Inheritance & advanced reasoning
A Representation: First-Order Logic
• Constants: Mr_Smith, Dr._Jones, anemia
• Variables: X, Y
• Functions: Address(X), Age(Y)
• Predicates: Diagnosis(X, anemia); Male(Y); Patient(Z)
• Negation: ¬Male(X); ¬Name(X, Smith)
• Connectors:
– Conjunction (AND): Patient(X) ∧ Male(X)
– Disjunction (OR): Doctor(X) ∨ Nurse(X)
– Logical implication: Female(X) ⇒ ¬Male(X)
• Quantifiers:
– Universal quantifier: ∀X (Patient(X) ∨ Doctor(X))
– Existential quantifier: ∃Y (Patient(Y) ∧ Name(Y, Jones))
2K 3K 4K >=6K <5K
21
Examples of Rule Based Expert Systems
MYCIN - begun in 1972
• Consultation system assist internists in diagnosis and treatment of
infectious diseases: meningitis & bacterial septicemia
• When patient shows signs of infectious disease, culture of blood and
urine set to lab (>24hrs) to determine bacterial species
• Classified as a "production- rule" system, depth-first, backward
chaining.
• Given patient data (incomplete & inaccurate) MYCIN gives interim
indication of organisms that are most likely cause of infection &
drugs to control disease
– Uses certainty factors to handle incomplete and uncertain information, included
the "how" and "why" capabilities that are now considered essential, defining
characteristics of Expert Systems.
• Drug interactions & already prescribed drugs taken into account
• Able to provide explanation of diagnosis (limited)
– Thoroughly documented in Buchanan and Shortliffe Rule Based Expert
Systems, Addison- Wesley, Reading, Mass., 1984.
Top-level goal rule
IF there is an organism which
requires therapy, and
consideration has been given
to the possibility of additional
organisms requiring therapy
• Problem Definition
• Knowledge Acquisition
• Knowledge Representation
• Prototype system
• Operational system
• Knowledge base maintenance
Problem Definition
• The essential problem is selecting an appropriate
domain:
– the problem must require some type of specialized
knowledge, if there are human "experts" this criteria
is probably satisfied
– must not be overly large: define the problem fairly
narrowly.
– in business organizations, it should a problem that is
handled often enough that an investment is expected
to have some payoff: the once every 5 years sort of
problem going to payoff.
Knowledge Acquisition
Person
27 years IS-A 5 Days
Duration
Age
Jim Has
Disease
Patient
Diagnosis Mumps
Semantic Networks:
Arity of Relations
• Unary relations
– Person(Jim): IS-A link
• Binary relations
– Age(Jim, 27 years): Age link
• N-ary relations
– Disease(Jim, Mumps, 5 days): By creating a reified
disease-relation object with several cases (patient,
diagnosis, duration)
Frames
(Minksy, 1975)
• A type of Semantic network
– Both can be used to represent logic systems
– Used to graphically represent taxonomies of
objects and their properties
• Concepts have roles, or properties, (also
known in OOLs as slots), such as age
• Frames encapsulate more meaningful
chunks of knowledge (e.g., birthday party)
Representing Knowledge in Frames
1. Frame Architecture
- A record-like data structure for representing stereotypical
knowledge about some concept or object (or a class of objects)
- A frame name represents a stereotypical situation/object/process
- Attributes or properties of the object also called slot
- Values for attributes called fillers, facets provide additional
control over fillers.
… ...
Types of Frames
(1) Class Frame
- Represents general characteristics of common objects
- Define properties that are common to all objects within class
- Static & dynamic property
Static: describes an object feature whose value does not change
Dynamic: feature whose value is likely to change during operation
Class Bird
Instance
A Quick Ontological View
Anything
AbstractObjects Events
Representational
Sets Numbers
Objects
Places Processes
Physical
Intervals
Objects
Sentences Measurements
Animals Agents
Times Weights
Humans
Medical Entities Dictionary (MED) Structure
Multiple hierarchy
Synonyms
Translations
Medical Semantic links
Entity
Attributes
60,000 concepts
Substance Laboratory
Specimen Event
Ha
s ta d
Plasma Subample Laboratory Laboratory
sS
S Test Procedure
pe
Carbo- Bioactive
cim
hydrate Substance
en
Plasma CHEM-7
Glucose Part of
Glucose Measured
Substance
1. Generalizations ---- “Kind of” relationship
Bird
Nest Food
(3) Instance Frame
- Represents specific instance of a class frame
- Inherits properties & values from the class
- Able to change values of properties & add new
properties
Frame Name: Tweety
Class: Bird
Mammals
Legs: 4
Men Employee
Age Unknown Phone Unknown
Weight Unknown Salary Unknown
Jack
Age 30
Weight 78kg
Phone 123456
Salary 12345
4. Facets
- Provide additional control over property values & operation of
the system
- Constraint on property values
limit a numeric property value to a range
restrict data type to Boolean, string or numeric
- Instruction to a property how to obtain value or make reaction to
changed value
- Types of facets
- Type: defines the type of value that can be associated with the property
- Default: defines a default value
- Documentation: provides a documentation of the property
- Constraint: defines the allowable values
- Minimum cardinality: establishes the minimum number of values a
property can have
- Maximum cardinality:
- If-needed: specifies action to be taken if the property’s value is needed
- If-changed: ……... changed
6. Rule interaction
- Hybrid system: combine frames and rules for KR
- Pattern matching, variables are used for locating matching
conditions among all frames, ?X, ?Age
Humans
• Frame: patient
– Attribute1: Patient Name.
– Associated action: if the name is unknown
then create a new folder if not, take the
already existing folder.
– Attribute2: current date.
– Associated action: if the patient is known
then calculate the time interval from the last
visit.
• Etc.
Advantages of Frames
• Classes and instances organize a flat
knowledge base (unlike FOL) by introducing
structure on an epistemological level
– E.g., specialization of subclasses through
restriction of a range of values for a property
• Simple; easy to understand
• Inheritance is captured in a natural, modular
fashion
• Efficient inference (e.g., for validation) by
following links, compared to standard logics
Problems with Frames
• Negation cannot be represented
– Jim does not have pneumonia
• Disjunction cannot be represented naturally
– Jim has Mumps or Rubella
• Qualification is not a part of the language
– All of Jim’s diseases are infectious
=> Thus, procedural attachments are often added
• The semantics of the links are often not well
defined [“What’s in a Link,” Woods, 1975]
Rule-based Frame-based
Rule 1 Frame - Boiler
IF Boiler pressure < 50 Temperature
AND Boiler water level < 3 Water level
THEN Add water to boiler Condition
Rule 2 IF Boiler:Temperature>300
IF Boiler temperature > 300 AND Boiler:Water_level >5
AND Boiler water level > 5 THEN Boiler:Condition = normal
THEN Boiler condition normal
- Disadvantages:
Departures from prototypes
Accommodation of new situations
Detailing heuristic knowledge
7. Summarizing Advantages & Disadvantages
(Frames vs. Rules)
Inference process general rules & PM general rules & pattern matching
can be slow PM fast