Kamis, 29 Oktober 2009

Rule – Based Expert System


An expert system is software that attempts to provide an answer to a problem, or clarify uncertainties where normally one or more human experts would need to be consulted. Expert systems are most common in a specific problem domain, and is a traditional application and/or subfield of artificial intelligence. A wide variety of methods can be used to simulate the performance of the expert however common to most or all are 1) the creation of a so-called "knowledgebase" which uses some knowledge representation formalism to capture the Subject Matter Expert's (SME) knowledge and 2) a process of gathering that knowledge from the SME and codifying it according to the formalism, which is called knowledge engineering. Expert systems may or may not have learning components but a third common element is that once the system is developed it is proven by being placed in the same real world problem solving situation as the human SME, typically as an aid to human workers or a supplement to some information system.
Expert systems were introduced by Edward Feigenbaum, the first truly successful form of AI software.[1] [2] [3] [4] [5] [6] The topic of expert systems has many points of contact with general systems theory, operations research, business process reengineering and various topics in applied mathematics and management science.

Expert systems topics

Chaining

Two methods of reasoning when using inference rules are backward chaining and forward chaining.
Forward chaining starts with the data available and uses the inference rules to conclude more data until a desired goal is reached. An inference engine using forward chaining searches the inference rules until it finds one in which the if clause is known to be true. It then concludes the then clause and adds this information to its data. It would continue to do this until a goal is reached. Because the data available determines which inference rules are used, this method is also called data driven.
Backward chaining starts with a list of goals and works backwards to see if there is data which will allow it to conclude any of these goals. An inference engine using backward chaining would search the inference rules until it finds one which has a then clause that matches a desired goal. If the if clause of that inference rule is not known to be true, then it is added to the list of goals. For example, suppose a rule base contains
  1. If Fritz is green then Fritz is a frog.
  2. If Fritz is a frog then Fritz hops.
Suppose a goal is to conclude that Fritz hops. The rule base would be searched and rule (2) would be selected because its conclusion (the then clause) matches the goal. It is not known that Fritz is a frog, so this "if" statement is added to the goal list. The rule base is again searched and this time rule (1) is selected because its then clause matches the new as certainty factors. A human, when reasoning, does not always conclude things with 100% confidence: he might venture, "If Fritz is green, then he is probably a frog" (after all, he might be a chameleon). This type of reasoning can be imitated by using numeric values called confidences. For example, if it is known that Fritz is green, it might be concluded with 0.85 confidence that he is a frog; or, if it is known that he is a frog, it might be concluded with 0.95 confidence that he hops. These numbers are probabilities in a Bayesian sense, in that they quantify uncertainty.

Expert system architecture

The following general points about expert systems and their architecture have been illustrated.
1. The sequence of steps taken to reach a conclusion is dynamically synthesized with each new case. It is not explicitly programmed when the system is built.
2. Expert systems can process multiple values for any problem parameter. This permits more than one line of reasoning to be pursued and the results of incomplete (not fully determined) reasoning to be presented.
3. Problem solving is accomplished by applying specific knowledge rather than specific technique. This is a key idea in expert systems technology. It reflects the belief that human experts do not process their knowledge differently from others, but they do possess different knowledge. With this philosophy, when one finds that their expert system does not produce the desired results, work begins to expand the knowledge base, not to re-program the procedures.
There are various expert systems in which a rulebase and an inference engine cooperate to simulate the reasoning process that a human expert pursues in analyzing a problem and arriving at a conclusion. In these systems, in order to simulate the human reasoning process, a vast amount of knowledge needed to be stored in the knowledge base. Generally, the knowledge base of such an expert system consisted of a relatively large number of "if then" type of statements that were interrelated in a manner that, in theory at least, resembled the sequence of mental steps that were involved in the human reasoning process.
Because of the need for large storage capacities and related programs to store the rulebase, most expert systems have, in the past, been run only on large information handling systems. Recently, the storage capacity of personal computers has increased to a point where it is becoming possible to consider running some types of simple expert systems on personal computers.
In some applications of expert systems, the nature of the application and the amount of stored information necessary to simulate the human reasoning process for that application is just too vast to store in the active memory of a computer. In other applications of expert systems, the nature of the application is such that not all of the information is always needed in the reasoning process. An example of this latter type application would be the use of an expert system to diagnose a data processing system comprising many separate components, some of which are optional. When that type of expert system employs a single integrated rulebase to diagnose the minimum system configuration of the data processing system, much of the rulebase is not required since many of the components which are optional units of the system will not be present in the system. Nevertheless, earlier expert systems require the entire rulebase to be stored since all the rules were, in effect, chained or linked together by the structure of the rulebase.
When the rulebase is segmented, preferably into contextual segments or units, it is then possible to eliminate portions of the Rulebase containing data or knowledge that is not needed in a particular application. The segmenting of the rulebase also allows the expert system to be run with systems or on systems having much smaller memory capacities than was possible with earlier arrangements since each segment of the rulebase can be paged into and out of the system as needed. The segmenting of the rulebase into contextual segments requires that the expert system manage various intersegment relationships as segments are paged into and out of memory during execution of the program. Since the system permits a rulebase segment to be called and executed at any time during the processing of the first rulebase, provision must be made to store the data that has been accumulated up to that point so that at some time later in the process, when the system returns to the first segment, it can proceed from the last point or rule node that was processed. Also, provision must be made so that data that has been collected by the system up to that point can be passed to the second segment of the rulebase after it has been paged into the system and data collected during the processing of the second segment can be passed to the first segment when the system returns to complete processing that segment.
The user interface and the procedure interface are two important functions in the information collection process.

End user

The end-user usually sees an expert system through an interactive dialog, an example of which follows:
Q. Do you know which restaurant you want to go to?
A. No
Q. Is there any kind of food you would particularly like?
A. No
Q. Do you like spicy food?
A. No
Q. Do you usually drink wine with meals?
A. Yes
Q. When you drink wine, is it French wine?
A. Yes
As can be seen from this dialog, the system is leading the user through a set of questions, the purpose of which is to determine a suitable set of restaurants to recommend. This dialog begins with the system asking if the user already knows the restaurant choice (a common feature of expert systems) and immediately illustrates a characteristic of expert systems; users may choose not to respond to any question. In expert systems, dialogs are not pre-planned. There is no fixed control structure. Dialogs are synthesized from the current information and the contents of the knowledge base. Because of this, not being able to supply the answer to a particular question does not stop the consultation.

Explanation system

Another major distinction between expert systems and traditional systems is illustrated by the following answer given by the system when the user answers a question with another question, "Why", as occurred in the above example. The answer is:
A. I am trying to determine the type of restaurant to suggest. So far Chinese is not a likely choice. It is possible that French is a likely choice. I know that if the diner is a wine drinker, and the preferred wine is French, then there is strong evidence that the restaurant choice should include French.
It is very difficult to implement a general explanation system (answering questions like "Why" and "How") in a traditional computer program. An expert system can generate an explanation by retracing the steps of its reasoning. The response of the expert system to the question WHY is an exposure of the underlying knowledge structure. It is a rule; a set of antecedent conditions which, if true, allow the assertion of a consequent. The rule references values, and tests them against various constraints or asserts constraints onto them. This, in fact, is a significant part of the knowledge structure. There are values, which may be associated with some organizing entity. For example, the individual diner is an entity with various attributes (values) including whether they drink wine and the kind of wine. There are also rules, which associate the currently known values of some attributes with assertions that can be made about other attributes. It is the orderly processing of these rules that dictates the dialog itself.

Expert systems versus problem-solving systems

The principal distinction between expert systems and traditional problem solving programs is the way in which the problem related expertise is coded. In traditional applications, problem expertise is encoded in both program and data structures. In the expert system approach all of the problem related expertise is encoded in data structures only; no problem-specific information is encoded in the program structure. This organization has several benefits.
An example may help contrast the traditional problem solving program with the expert system approach. The example is the problem of tax advice. In the traditional approach data structures describe the taxpayer and tax tables, and a program in which there are statements representing an expert tax consultant's knowledge, such as statements which relate information about the taxpayer to tax table choices. It is this representation of the tax expert's knowledge that is difficult for the tax expert to understand or modify.
In the expert system approach, the information about taxpayers and tax computations is again found in data structures, but now the knowledge describing the relationships between them is encoded in data structures as well. The programs of an expert system are independent of the problem domain (taxes) and serve to process the data structures without regard to the nature of the problem area they describe. For example, there are programs to acquire the described data values through user interaction, programs to represent and process special organizations of description, and programs to process the declarations that represent semantic relationships within the problem domain and an algorithm to control the processing sequence and focus.
The general architecture of an expert system involves two principal components: a problem dependent set of data declarations called the knowledge base or rule base, and a problem independent (although highly data structure dependent) program which is called the inference engine.

Individuals involved with expert systems

There are generally three individuals having an interaction with expert systems. Primary among these is the end-user; the individual who uses the system for its problem solving assistance. In the building and maintenance of the system there are two other roles: the problem domain expert who builds and supplies the knowledge base providing the domain expertise, and a knowledge engineer who assists the experts in determining the representation of their knowledge, enters this knowledge into an explanation module and who defines the inference technique required to obtain useful problem solving activity. Usually, the knowledge engineer will represent the problem solving activity in the form of rules which is referred to as a rule-based expert system. When these rules are created from the domain expertise, the knowledge base stores the rules of the expert system.

Inference rule

An understanding of the "inference rule" concept is important to understand expert systems. An inference rule is a statement that has two parts, an if clause and a then clause. This rule is what gives expert systems the ability to find solutions to diagnostic and prescriptive problems. An example of an inference rule is:
If the restaurant choice includes French, and the occasion is romantic,
Then the restaurant choice is definitely Paul Bocuse.
An expert system's rulebase is made up of many such inference rules. They are entered as separate rules and it is the inference engine that uses them together to draw conclusions. Because each rule is a unit, rules may be deleted or added without affecting other rules (though it should affect which conclusions are reached). One advantage of inference rules over traditional programming is that inference rules use reasoning which more closely resemble human reasoning.
Thus, when a conclusion is drawn, it is possible to understand how this conclusion was reached. Furthermore, because the expert system uses knowledge in a form similar to the expert, it may be easier to retrieve this information from the expert.

Procedure node interface

The function of the procedure node interface is to receive information from the procedures coordinator and create the appropriate procedure call. The ability to call a procedure and receive information from that procedure can be viewed as simply a generalization of input from the external world. While in some earlier expert systems external information has been obtained, that information was obtained only in a predetermined manner so only certain information could actually be acquired. This expert system, disclosed in the cross-referenced application, through the knowledge base, is permitted to invoke any procedure allowed on its host system. This makes the expert system useful in a much wider class of knowledge domains than if it had no external access or only limited external access.
In the area of machine diagnostics using expert systems, particularly self-diagnostic applications, it is not possible to conclude the current state of "health" of a machine without some information. The best source of information is the machine itself, for it contains much detailed information that could not reasonably be provided by the operator.
The knowledge that is represented in the system appears in the rulebase. In the rulebase described in the cross-referenced applications, there are basically four different types of objects, with associated information present.
  1. Classes—these are questions asked to the user.
  2. Parameters—a parameter is a place holder for a character string which may be a variable that can be inserted into a class question at the point in the question where the parameter is positioned.
  3. Procedures—these are definitions of calls to external procedures.
  4. Rule Nodes—The inferencing in the system is done by a tree structure which indicates the rules or logic which mimics human reasoning. The nodes of these trees are called rule nodes. There are several different types of rule nodes.
The rulebase comprises a forest of many trees. The top node of the tree is called the goal node, in that it contains the conclusion. Each tree in the forest has a different goal node. The leaves of the tree are also referred to as rule nodes, or one of the types of rule nodes. A leaf may be an evidence node, an external node, or a reference node.
An evidence node functions to obtain information from the operator by asking a specific question. In responding to a question presented by an evidence node, the operator is generally instructed to answer "yes" or "no" represented by numeric values 1 and 0 or provide a value of between 0 and 1, represented by a "maybe."
Questions which require a response from the operator other than yes or no or a value between 0 and 1 are handled in a different manner.
A leaf that is an external node indicates that data will be used which was obtained from a procedure call.
A reference node functions to refer to another tree or subtree.
A tree may also contain intermediate or minor nodes between the goal node and the leaf node. An intermediate node can represent logical operations like And or Or.
The inference logic has two functions. It selects a tree to trace and then it traces that tree. Once a tree has been selected, that tree is traced, depth-first, left to right.
The word "tracing" refers to the action the system takes as it traverses the tree, asking classes (questions), calling procedures, and calculating confidences as it proceeds.
As explained in the cross-referenced applications, the selection of a tree depends on the ordering of the trees. The original ordering of the trees is the order in which they appear in the rulebase. This order can be changed, however, by assigning an evidence node an attribute "initial" which is described in detail in these applications. The first action taken is to obtain values for all evidence nodes which have been assigned an "initial" attribute. Using only the answers to these initial evidences, the rules are ordered so that the most likely to succeed is evaluated first. The trees can be further re-ordered since they are constantly being updated as a selected tree is being traced.
It has been found that the type of information that is solicited by the system from the user by means of questions or classes should be tailored to the level of knowledge of the user. In many applications, the group of prospective uses is nicely defined and the knowledge level can be estimated so that the questions can be presented at a level which corresponds generally to the average user. However, in other applications, knowledge of the specific domain of the expert system might vary considerably among the group of prospective users.
One application where this is particularly true involves the use of an expert system, operating in a self-diagnostic mode on a personal computer to assist the operator of the personal computer to diagnose the cause of a fault or error in either the hardware or software. In general, asking the operator for information is the most straightforward way for the expert system to gather information assuming, of course, that the information is or should be within the operator's understanding. For example, in diagnosing a personal computer, the expert system must know the major functional components of the system. It could ask the operator, for instance, if the display is a monochrome or color display. The operator should, in all probability, be able to provide the correct answer 100% of the time. The expert system could, on the other hand, cause a test unit to be run to determine the type of display. The accuracy of the data collected by either approach in this instance probably would not be that different so the knowledge engineer could employ either approach without affecting the accuracy of the diagnosis. However, in many instances, because of the nature of the information being solicited, it is better to obtain the information from the system rather than asking the operator, because the accuracy of the data supplied by the operator is so low that the system could not effectively process it to a meaningful conclusion.
In many situations the information is already in the system, in a form of which permits the correct answer to a question to be obtained through a process of inductive or deductive reasoning. The data previously collected by the system could be answers provided by the user to less complex questions that were asked for a different reason or results returned from test units that were previously run.

User interface

The function of the user interface is to present questions and information to the user and supply the user's responses to the inference engine.
Any values entered by the user must be received and interpreted by the user interface. Some responses are restricted to a set of possible legal answers, others are not. The user interface checks all responses to insure that they are of the correct data type. Any responses that are restricted to a legal set of answers are compared against these legal answers. Whenever the user enters an illegal answer, the user interface informs the user that his answer was invalid and prompts him to correct it.

Application of expert systems

Expert systems are designed and created to facilitate tasks in the fields of accounting, medicine, process control, financial service, production, human resources etc. Indeed, the foundation of a successful expert system depends on a series of technical procedures and development that may be designed by certain technicians and related experts.
A good example of application of expert systems in banking area is expert systems for mortgages. Loan departments are interested in expert systems for mortgages because of the growing cost of labour which makes the handling and acceptance of relatively small loans less profitable. They also see in the application of expert systems a possibility for standardised, efficient handling of mortgage loan, and appreciate that for the acceptance of mortgages there are hard and fast rules which do not always exist with other types of loans.
While expert systems have distinguished themselves in AI research in finding practical application, their application has been limited. Expert systems are notoriously narrow in their domain of knowledge—as an amusing example, a researcher used the "skin disease" expert system to diagnose his rustbucket car as likely to have developed measles—and the systems were thus prone to making errors that humans would easily spot. Additionally, once some of the mystique had worn off, most programmers realized that simple expert systems were essentially just slightly more elaborate versions of the decision logic they had already been using. Therefore, some of the techniques of expert systems can now be found in most complex programs without any fuss about them.
An example, and a good demonstration of the limitations of, an expert system used by many people is the Microsoft Windows operating system troubleshooting software located in the "help" section in the taskbar menu. Obtaining expert/technical operating system support is often difficult for individuals not closely involved with the development of the operating system. Microsoft has designed their expert system to provide solutions, advice, and suggestions to common errors encountered throughout using the operating systems.
Another 1970s and 1980s application of expert systems — which we today would simply call AI — was in computer games. For example, the computer baseball games Earl Weaver Baseball and Tony La Russa Baseball each had highly detailed simulations of the game strategies of those two baseball managers. When a human played the game against the computer, the computer queried the Earl Weaver or Tony La Russa Expert System for a decision on what strategy to follow. Even those choices where some randomness was part of the natural system (such as when to throw a surprise pitch-out to try to trick a runner trying to steal a base) were decided based on probabilities supplied by Weaver or La Russa. Today we would simply say that "the game's AI provided the opposing manager's strategy."

Advantages and disadvantages

Advantages:
  • Provides consistent answers for repetitive decisions, processes and tasks
  • Holds and maintains significant levels of information
  • Encourages organizations to clarify the logic of their decision-making
  • Never "forgets" to ask a question, as a human might
  • Can work round the clock
  • Can be used by the user more frequently
  • A multi-user expert system can serve more users at a time
Disadvantages:
  • Lacks common sense needed in some decision making
  • Cannot make creative responses as human expert would in unusual circumstances
  • Domain experts not always able to explain their logic and reasoning
  • Errors may occur in the knowledge base, and lead to wrong decisions
  • Cannot adapt to changing environments, unless knowledge base is changed

Types of problems solved by expert systems

Expert systems are most valuable to organizations that have a high-level of know-how experience and expertise that cannot be easily transferred to other members. They are designed to carry the intelligence and information found in the intellect of experts and provide this knowledge to other members of the organization for problem-solving purposes.
Typically, the problems to be solved are of the sort that would normally be tackled by a medical or other professional. Real experts in the problem domain (which will typically be very narrow, for instance "diagnosing skin conditions in human teenagers") are asked to provide "rules of thumb" on how they evaluate the problems, either explicitly with the aid of experienced systems developers, or sometimes implicitly, by getting such experts to evaluate test cases and using computer programs to examine the test data and (in a strictly limited manner) derive rules from that. Generally, expert systems are used for problems for which there is no single "correct" solution which can be encoded in a conventional algorithm — one would not write an expert system to find shortest paths through graphs, or sort data, as there are simply easier ways to do these tasks.
Simple systems use simple true/false logic to evaluate data. More sophisticated systems are capable of performing at least some evaluation, taking into account real-world uncertainties, using such methods as fuzzy logic. Such sophistication is difficult to develop and still highly imperfect.

Expert Systems Shells or Inference Engine

A shell is a complete development environment for building and maintaining knowledge-based applications. It provides a step-by-step methodology, and ideally a user-friendly interface such as a graphical interface, for a knowledge engineer that allows the domain experts themselves to be directly involved in structuring and encoding the knowledge. Many commercial shells are available, one example being eGanges which aims to remove the need for a knowledge enginee




Rule-based Expert Systems


A rule-based expert system is an expert system (see intro) which works as a production system in which rules encode expert knowledge.
Most expert systems are rule-based. Alternatives are
frame-based - knowledge is associated with the objects of interest and reasoning consists of confirming expectations for slot values. Such systems often include rules too.
model-based, where the entire system models the real world, and this deep knowledge is used to e.g. diagnose equipment malfunctions, by comparing model predicted outcomes with actual observed outcomes
case-based - previous examples (cases) of the task and its solution are stored. To solve a new problem the closest matching case is retrieved, and its solution or an adaptation of it is proposed as the solution to the new problem.

 Typical Expert System Architecture

(from Luger and Stubblefield)

Data-driven Rule-based Expert Systems

Use Forward Chaining:
Given a certain set of facts in WM, use the rules to generate new facts until the desired goal is reached.
To forward chain the inference engine must:
1.  Match the condition patterns of rules against facts in working memory.
2.  If there is more than one rule that could be used (that could "fire"), select  which one to apply (this is called conflict resolution)
3.  Apply the rule, maybe causing new facts to be added to working memory
4.  Halt when some useful (or goal) conclusion is added to WM (or until all possible conclusions have been drawn.)

Goal-driven Rule-based Expert Systems

Use Backward Chaining:
Work backwards from a  hypothesised goal, attempting to prove it by linking the goal to the initial facts.
To backward chain from a goal in WM the inference engine must:
1.  Select rules with conclusions matching the goal.
2.  Replace the goal by the rule's premises. These become sub-goals.
3.  Work backwards till all sub-goals are known to be true -
             either they are facts (in WM)
     or    the user provides the information.

Example
A production system IDENTIFIER, which identifies animals.
R1       IF             the animal has hair
            THEN      it is a mammal
R2       IF             the animal gives milk
            THEN      it is a mammal
R3       IF             the animal has feathers
            THEN      it is a bird
R4       IF             the animal flies
                             the animal lays eggs
            THEN      it is a bird
R5       IF             the animal is a mammal
                             the animal eats meat
            THEN      it is a carnivore
R6       IF             the animal is a mammal
                             the animal has pointed teeth
                             the animal has claws
                             the animal's eyes point forward
            THEN      it is a carnivore
R7       IF             the animal is a mammal
                             the animal has hooves
            THEN      it is an ungulate
R8       IF             the animal is a mammal
                             the animal chews cud
            THEN      it is an ungulate  AND
                             it is even-toed
R9       IF             the animal is a carnivore
                             the animal has a tawny colour
                             the animal has dark spots
            THEN      it is a cheetah

R10     IF             the animal is a carnivore
                             the animal has a tawny colour
                             the animal has black stripes
            THEN      it is a tiger
R11     IF             the animal is an ungulate
                             the animal has long legs
                             the animal has a long neck
            THEN      it is a giraffe
R12     IF             the animal is an ungulate
                             the animal has a white colour
                             the animal has black stripes
            THEN      it is a zebra
R13     IF             the animal is a bird
                             the animal does not fly
                             the animal has long legs
                             the animal has a long neck
                             the animal is black and white
            THEN      it is an ostrich
R14     IF             the animal is a bird
                             the animal does not fly
                             the animal swims
                             the animal is black and white
            THEN      it is a penguin
R15     IF             the animal is a bird
                             the animal is a good flier
            THEN      it is an albatross

PROBLEM:
Given these facts in working memory initially:
     the animal gives milk
the animal chews its cud
the animal has long legs
the animal has a long neck
Establish by forward chaining that the animal is a giraffe.
Given the facts that:
     the animal has hair
the animal has claws
the animal has pointed teeth
the animal's eyes point forward
the animal has a tawny colour
the animal has dark spots
Establish by backward chaining that the animal is a cheetah.
[HINT: start with R9, first subgoal : the animal is a carnivore etc.]

Goal-driven search is suggested if:
·       A goal or hypothesis is given in the problem statement or can be easily formulated
(theorem-proving, diagnosis hypothesis testing).
·       There are a large number of rules that match the facts, producing a large number of conclusions - choosing a goal prunes the search space.
·       Problem data are not given (or easily available) but must be acquired as necessary (e.g. medical tests).

Data-driven search is suggested if:
·       All or most of the data is given in the problem statement (interpretation problems)
·       Large number of potential goals but few achievable in a particular problem instance.
·       It is difficult to formulate a goal or hypothesis.

Data-driven search can appear aimless but produces all solutions to a problem (if desired)
Mixed reasoning is also possible - facts get added to the WM and sub-goals get created until all the sub-goals are present as facts.

Explanation Facility in Expert Systems


Rule-based systems can be designed to answer questions like
WHY do you want to know this fact ?  (i.e. where is the reasoning going?)
HOW did you deduce this fact ? (i.e. how did we get here?)
Explanation facilities are useful for debugging a rulebase but also for instilling confidence in users of the ES.
A tracer module records the rules that have been used. To answer HOW questions these rules are searched for one where the fact in question is a consequent (action/then part).
(see MYCIN case study)
The production system architecture provides the essential basis for explanation facility, and the facility contributes to the success and popularity of rule-based ES.

Handling Uncertainty in Expert Systems


Uncertainty arises from abductive rules, heuristic rules or missing or unreliable data.
ABDUCTION: ES rules are frequently not sound logically, but are abductive.  The abductive rule
            if              the engine does not turn over and
                             the lights do not come on
            then         the problem is battery or cables.
is not always right, but would be typical of a car diagnosis system. Its converse, while not so useful is logically sound :
            if              the problem is battery or cables
            then         the engine does not turn over and
                             the lights do not come on

Abductive reasoning is very important in diagnosis - diseases cause symptoms, but we have sympoms and want to work back to the cause.
To reason with uncertainty, we attach confidence measures to facts and to rules. We need mechanisms to combine these measures.

Handling uncertainty in rule-based expert systems

Three situations need to be handled.

(1) If A and B and C then …
If my confidence in A is x and in B is y and in C is z how confident am I about their conjunction (A and B and C)?
(2) If D then E
If my confidence in D is x how confident can I be in E?
(3) If the same fact F is deduced from (two) separate rules with confidences x and y, how confident am I in F? 

A. Simple (Conservative) Rules

(1)  Confidence in the conjunction is
min (x, y z)            a chain is as strong as its weakest link
(2)  Confidence in rule conclusion is
x . a                         a  is the rule's attenuation factor
(3)  Confidence in the multiply derived fact is
 max (x, y)              a conclusion is no more certain than the strongest supporting argument.

B. Bayesian Probability Theory Based

Confidence measures are probabilities.
(1) Confidence in conjunction is  = x . y . z
(2) Confidence in a rule is based on Bayes theorem

(there should be a summation symbol on the bottom line)
which relates
P(Di|S)  the probability of having disease i if you have the symptom S,
to measures of
P(Di)       the probability of having disease i in general,
P(S|Di) the probability of having the symptom S if you have disease i, and
P(S|Dk) for all possible diseases Dk, the probability of having symptom S if you have diseases Dk.

(Diseases are hypotheses; symptoms are evidence.)

Difficulties with Bayes' Theorem:


Bayes theorem assumes that relationships between evidence and hypotheses are independent of one another. (e.g. the probability of someone who has flu having a sore throat and the probability of someone who has flu having a temperature, should be independent. But are they ?)

Probabilities should be collected statistically, and kept up to date with all new discoveries about diseases and their symptoms. This is impractical.

Bayes-based probability is not a good way to model uncertainty in medical diagnosis systems.
Nonetheless, doctors feel that they can make informed assessment of their confidence in their heuristic rules.

C. Stanford Certainty Factor Algebra

(See also MYCIN notes.)
CF (H|E) is the certainty factor of hypothesis H given evidence E.
-1     <     CF (H|E)     <     1
strong evidence                       strong evidence
against the hypothesis               for the hypothesis

(1) Confidence in the conjunction is
     min (x, y, z)
(2) Confidence in rule conclusion is
     x . CF (R)                                CF (R) is certainty        factor associated with                     this conclusion of the rule.
(3) Confidence in the multiply derived fact is
      x + y - (x * y)                         if both are positive
 x + y + (x * y)                        if both are negative
?     =          x + y               .    otherwise
               1 - min (|x|, |y|)
Note: These formulae leave   -1 < CF < 1
        Combining contradictory rules cancels out the CF
        CFs increase montonically as we add evidence

Other theories for handling uncertainty

Zadeh's Fuzzy Sets - a theory of possibility that tries to measure the vagueness of English statements (e.g. "Ann is tall")
Dempster-Schafer Belief Functions  
All these theories are numeric which does not seem to be the way humans reason with uncertainty.
Non-monotonic reasoning is a completely different approach which allows you to proceed with the most reasonable assumption based on uncertain information and to change the assumption (and conclusions that have arisen from it) if the assumption becomes unreasonable. (Truth maintenance systems.)
(Monotonic reasoning systems only allow knowledge/info to be added, whereas humans delete information that is found tobe untrue.)

Expert System Shells

An expert system shell is an expert system with an empty knowledge base, i.e.
An inference engine
User interface module
Tracer/explanation module
Knowledge base (rule) editor
Etc.

EXSYS is a shell, KEE, OPS5, KAS, …
EMYCIN is the shell of MYCIN

It is important to start with a shell with a suitable control strategy.
Recent trends are towards shells that include multiple engines, making them more flexible.

Case Study : MYCIN

An example Goal-driven Medical Diagnostic Expert System

(taken from Luger and Stubblefield section 8.4)

Purpose:

·       Diagnose and recommend treatment for meningitis and bacteremia (more quickly than definitive lab tests).
·       Explore how human experts reason with missing and incomplete information.

History

mid-late '70s
50 person years
Stanford medical school
Comprehensively evaluated
Never used clinically
Widely documented ("Rule-based expert systems" Buchanan and Shortliffe, Stanford 1984, a collection of publications on MYCIN).

Representation

Facts:     
(ident organism-1 klebsiella .25)
            there is evidence (.25) that the identity of organism-1 is klebsiella
(sensitive organism-1 penicillin -1.0)
            it is known that org-1 is NOT sensitive to penicillin.
Rules:     condition-action pairs
                Condition is a conjunction (AND) of facts
IF: (AND (same-context infection
                          primary-bacteremia)
       (membf-context site sterilesite)
       (same-context portal GI))

THEN: (conclude context-ident bacteroid
                                    tally .7)

            If the infection is primary bacteremia and the site of the culture is a sterile one and the suspected portal of entry is GI tract then there is suggestive evidence (.7) that infection is bacteroid.
Consequent (then-part) can
§       Add facts to database
§       Write to terminal
§       Change a value in a fact, or its certainty
§       Lookup a table
§       Execute a LISP procedure

Operation:

Routine questions

Specific questions about symptoms

Depth-first goal driven consideration
of each "known" organism


 

Terminates "depth-search" when certainty measures get too low.
Selection criterion is to maximise certainty - if a rule can prove a goal with certainty 1 then no more rules need be considered.
Goal-driven so that questions appear to be directed - less frustrating, more confidence building for the user.
English-like interaction (see handout).
Answers WHY by printing the rule under consideration.
Exhaustive consideration of possible infections - patient may have more than one.

Uncertainty in MYCIN


If    A: stain is gram positive
and B: morphology is coccus
and C: growth conformation is chains
then there is suggestive evidence (0.7) that
H: organism is streptococcus

0.7 is the measure of increase of belief (MB) of H given evidence A and B and C.
MB ranges 0 to 1.
Assigned by subjective judgement usually.
As a guide:
                            1                                                 if P(H)=1
    MB(H|E) =   max[P(H|E),P(H)] - P(H)     otherwise
                                   max[1,0] - P(H)
Measures of disbelief also allowed. These also range 0 to 1.
                            1                                                 if P(H)=1
    MD(H|E) =   min[P(H|E),P(H)] - P(H)      otherwise
                                     min[1,0] - P(H)

Note if E and H are independent, E does not change the belief in H:
P(H|E) = P(H), so MB = MD = 0.
MB(H|E) should only be 1 if E logically implies H.
Initially each hypothesis has MB=MD=0.
As evidence is accumulated these are updated.
At the end a certainty factor CF = MB-MD is computed for each hypothesis.
The largest absolute CF values used to determine appropriate therapy. Weakly supported hypotheses |CF| < 2 are ignored.

MYCIN's handling of uncertainty is an ad-hoc method (based on probability). But it seems to work as well as more formal approaches.


 


Tidak ada komentar:

Posting Komentar