Com 423 Expert System and Machine Learning
Com 423 Expert System and Machine Learning
Com 423 Expert System and Machine Learning
Expert System
The Expert System in AI (Artificial Intelligence) can resolve many issues which generally
would require a human expert. It is based on knowledge acquired from an expert. Artificial
Intelligence and Expert Systems are capable of expressing and reasoning about some domain
of knowledge. Expert systems were the predecessor of the current day artificial intelligence,
deep learning and machine learning systems.
i. MYCIN: It was based on backward chaining and could identify various bacteria that
could cause acute infections. It could also recommend drugs based on the patient's
weight. It is one of the best Expert System Example.
ii. DENDRAL: Expert system used for chemical analysis to predict molecular structure.
iii. PXDES: An Example of Expert System used to predict the degree and type of lung
cancer
iv. CaDet: One of the best Expert System Example that can identify cancer at early
stages
The Highest Level of Expertise: The Expert system in AI offers the highest level of
expertise. It provides efficiency, accuracy and imaginative problem-solving.
Good Reliability: The Expert system in AI needs to be reliable, and it must not make
any a mistake.
User Interface
The user interface is the most crucial part of the Expert System Software. This component
takes the user's query in a readable form and passes it to the inference engine. After that, it
displays the results to the user. In other words, it's an interface that helps the user
communicate with the expert system.
Inference Engine
The inference engine is the brain of the expert system. Inference engine contains rules to
solve a specific problem. It refers the knowledge from the Knowledge Base. It selects facts
and rules to apply when trying to answer the user's query. It provides reasoning about the
information in the knowledge base. It also helps in deducting the problem to find the solution.
This component is also helpful for formulating conclusions.
Knowledge Base
The knowledge base is a repository of facts. It stores all the knowledge about the problem
domain. It is like a large container of knowledge which is obtained from different experts of a
specific field.
Thus, we can say that the success of the Expert System Software mainly depends on the
highly accurate and precise knowledge.
The knowledge base provides specific facts and rules about the subject, and the inference
engine provides the reasoning ability that enables the expert system to form conclusions.
Expert systems also provide additional tools in the form of user interfaces and explanation
facilities. User interfaces, as with any application, enable people to form queries, provide
information, and otherwise interact with the system. Explanation facilities, an intriguing part
of expert systems, enable the systems to explain or justify their conclusions, and they also
enable developers to check on the operation of the systems themselves.
A fact is a small portion of important information. Facts on their own are of very limited use.
The rules are essential to select and apply facts to a user problem.
Knowledge Acquisition
The term knowledge acquisition means how to get required domain knowledge by the expert
system. The entire process starts by extracting knowledge from a human expert, converting
the acquired knowledge into rules and injecting the developed rules into the knowledge base.
Information management
Hospitals and medical facilities
Help desks management
Employee performance evaluation
Loan analysis
Virus detection
Useful for repair and maintenance projects
Warehouse optimization
Planning and scheduling
The configuration of manufactured objects
Financial decision-making Knowledge publishing
Process monitoring and control
Supervise the operation of the plant and controller
Stock market trading
Airline scheduling & cargo schedule
As the name suggests, rule based expert system consists of set of rules. Rule is an expressive,
straight forward and flexible way of expressing knowledge. In a rule based expert system,
knowledge is represented as a set of rules. Knowledge is a theoretical or practical
understanding of a subject or a domain. Expert has an ability to code the knowledge in form
of rules. Any rule consists of two parts: The IF part, called and antecedent (premise or
condition) and THEN part, called the consequent (conclusion or action). The basic syntax or
rule base is:
IF {antecedent}
THEN {Consequent}
A rule can have multiple antecedents joined by the keywords AND, OR, or combination of
both. The antecedent of a rule consists of two parts. They are object and its value. Object
and value are linked by an operator. The operator can be mathematical or may be logical.
Structure of rule based expert system
A rule based expert system has five components: The knowledge base, the database, the
inference engine, the explanation facility and the user interface. The knowledge base
contains the knowledge about the domain. The database has set of facts, which is used to
match the against the IF- THEN rules. The inference engine provides reasoning, so that
expert system can reach a solution. The explanation facility provides the answer to user
about why the particular solution is reached. The user interface enables user to interact with
the other components of the expert systems.
The other additional components include the external interface, the developer interface, text
editor, book keeping facilities, debugging aids, and run time knowledge acquisition. The
external interface allows an expert system to interact with other database and programs. The
developer interface allows developer to edit with knowledge base, rules and facts. Text
editor provides notepad kind facility to enter inputs. Book keeping facility is provided to
monitor the changes made by the knowledge engineer in knowledge base or inference engine.
Debugging aids provides tracing of all rules fired during the program execution. Run time
knowledge acquisition facility enables to add knowledge or facts, which are not available in
knowledge base or database.
External
database External Program
Expert system
Knowledge base Database
Inference Engine
Explanation Facilities
Expert
Rule based expert system has set of IF-THEN rules to represent the domain
knowledge and set of facts which will represent current situation. Inference engine compares
each rule stored in knowledge base with the facts in the database. When the IF rule is match
with a fact, the rule is fired and its action part stated in THEN is executed. The fired rule
may change the set of facts by adding new facts in database. The entire above process
produces inference chains. The process is shown in the figure 2.(Negnevitsky, 2008)
Database
Fact: A
Fact: B
Match Fire
Knowledge base
Rule: if A THEN B
Knowledge Base
There are two types of inference techniques. Forward chaining and backward chaining.
Forward Chaining:
Forward chaining is the data driven reasoning. The reasoning starts from the known data and
proceeds. It will look for the rules which will move the current state of problem solution
closer to final solution. When rule is fired, the new facts are added to the database.
Solution: Here we will start with rule 1 and proceed towards the next rule. First rule 3 will
be fired and then rule 2 will be fired and then at the end rule 4 will be fired. Hence, we can
reach to the desired goal to prove that if A and B then D is true. This is how inference engine
will process inference chain in forward manner.
The only problem with the forward chaining is that if the rule base has thousands rule, then
many a times, unnecessary rules are also fired, which will increase execution time and we
will generate many facts which are unrelated to goal. To overcome this problem, backward
chaining is used.
Backward Chaining:
Backward chaining is the goal driven reasoning. In backward chaining, an expert system has
the goal and the inference engine attempts to find the evidence to prove it. First, inference
engine will search knowledge base to find rules that has required solution and such rule will
have goal in their action (THEN) parts. If such a rule is found and if its condition (IF) part
matches the data in the database, then the rule is fired and then goal is proven.
Let us see how backward chaining works from the above example.
A rule base consisting of the following rule set.
Rule 1: If A and C then F
Rule 2: If A and E then G
Rule 3: If B then E
Rule 4: If G then D.
Problem: Prove that If A and B is true, then D is true.
Solution: Here we will start with the goal D is true and move backwards till a rule is fired.
So rule 4 will be fired and we have new goal to prove that G is true. When G is true, it means
both A and E is true as per rule 2. While we are given the fact that A is true, hence we have
got new goal which states that E is true. If E is true, moving backwards, we ascertain that B
is true using rule 3. Hence now we ascertain both A and B is true. Hence the goal is proved.
Table 1: Difference between forward chaining and backward chaining:
In conclusion, we can say that a user can use a combination of forward and backward
chaining both depends on the type of domain, its requirement and the shell used for
development of an expert system.
2.3 Advantages of rule based expert systems
• It provides representation of knowledge in natural way of if- then rules.
• It has uniform structure of rule base. Each rule is an independent piece of knowledge.
• It separates the knowledge base from inference engine, i.e., knowledge base can be
updates without intervening of processing.
• The rule base expert system can perform even with incomplete and uncertain
knowledge by associating certainty factors with it.
• It is easy to understand and rules can be self-documented without the help of explicit
translation.
• The rule base system can be developed in phase by manner. A quick prototype can be
developed with few rules and if it achieves desired result then new rules can be added
to improve the performance and efficiency.
2.5 Domain areas where rule based expert system are useful
• When knowledge is diffuse, i.e. there are large numbers of facts, which are more or
less independent of each other. For example, we cannot use rule base in mathematics
domain where there are set of inter related principles. But rule base can be applied to
clinical trial domain, where comparatively there is large number of interdependencies
among rules.
• Where knowledge can be easily separated from its use, i.e. when there is no
dependency on how to use knowledge. For example, we can use rule base expert
system where we need to decide the ingredients of an item, but we cannot use rule
base expert system where we also need to decide how much of each ingredient we
need to mix up for a tasteful recipe.
Fuzzy logic is also known as multi valued logic. The classical logic operates on two
truth values. They are True (1) and False (0). In fuzzy logic, all the truth values are
expressed in real numbers from the interval between 0 to 1. A number in the interval is used
to represent the possibility that a given statement is true or false. The logic is explained in
figure 3.
fA(x):X--> 0,1,
Where
1, if x ɛ A
fA(x) =
0, if x ɛ A
The set map inverse X is asset of two elements. For any element x of universe of X,
characteristic function fA(x) is equal to 1, if x is an element of set A and is equal to 0 if x is
not an element of A.
In fuzzy set A of universe X is defined by function µA(x) called the membership function of
set a.
µA(x) : X [0,1],
Where µA(x) = 1 if x is
totally in A; µA(x)
= 0 if x is not in A;
0 < µA(x) < 1 if x
is partly in A.
This allows a continuum of possible choices. For any element x of universe X, membership
function µA(x) equals to the degree to which x is an element of set A. This degree, a value
between 0 and 1 represents the degree of membership, also called membership value, of
element x in set A. (Negnevitsky, 2008) For example, the fuzzy set young can be represented
in the following figure 4.
Figure 4: Probability distribution of fuzzy set young
IF speed is fast
THEN time to travel is less.
The range of possible values of a linguistic variable represents the universe of discourse of
that variable. For variable speed, the values can be very slow, slow, medium, fast and very
fast. A linguistic variable carries with it the concept of fuzzy set qualifiers, called hedges.
Hedges are terms that modify the shape of fuzzy sets. They include adverbs like very,
somewhat, quiet, more or less and slightly.
The most important advantage with fuzzy expert system is that it merges the rules and
consequently cut the
number of rules significantly.
Fuzzy set includes two distinct parts: evaluating the rule antecedent (the IF part of the rule)
and implication or
applying the result to the consequent (Then part of the rule). In fuzzy systems, where the
antecedent is a fuzzy statement, all rules fire to some extent, or in other words they fire
partially. If the antecedent is true to some degree of membership, then the consequent is also
true to that same degree.
3.4 Fuzzy inference
Step 1: Fuzzification
In this step, we take the crisp inputs, x1 and y1 and determine the degree to which these
inputs belong to each f the appropriate fuzzy sets.
Step 2: Rule evaluation
In this step, we take fuzzified inputs and apply them to the antecedents.
Step 3: Aggregation of the rule outputs
In this step, we take the membership functions of all rule consequents previously clipped or
scaled and combine them into a single fuzzy set. Aggregation is the process of unification of
the outputs of all rules . Thus the input of the aggregation process is the list of clipped or
scaled consequent membership functions, and the output is one fuzzy set for each output
variable. Step 4: Defuzzification
Fuzziness helps us to evaluate the rules, but the final output of a fuzzy system has to be a
crisp number. The above process of converting output to crisp number is called
defuzzification. The input for the defuzzification process Is the aggregate output fuzzy set
and it is a single number.
In rule base expert system and fuzzy expert system, IF- THEN rules are used to represent
knowledge. In frame based expert system, frames are used to represent knowledge. Now we
will try to explore the concept of frames.
4.1 Frame
A frame is a data structure with typical knowledge about a particular object or concept.
Frames are used to capture and represent knowledge in a frame based expert system.
(Minsky, 1975) Each frame has its own name and set of attributes or slots associated with it.
The frame provides a natural way for the structured and concise representation of knowledge.
We can combine all necessary knowledge about a particular object or concept in a single
entity. In general frames are an application of object-oriented programming for expert
systems. The advantage what frames offer over the rule base is that we just need to search
through frames only to execute rules unlike of rule base expert system, where it goes through
systematic search through all rules for execution.
The concept of a frame is defined by a collection of slots. Each slot describes a particular
attribute or operation of the frame. Slots are used to store values. A slot may contain a default
value or a pointer to another frame, a set of rules or procedure by which the slot value is
obtained. In general, slot may include the following information:
1) Frame name
2) Relationship of the frame to the other frames.
3) Slot value
4) Default slot value
5) Range of slot value
6) Procedural information: A procedure is executed if the slot value is changed or
needed. There are two types of procedures attached to slots.
a. When changed procedure is executed when new information is placed in the
slot.
b. When needed procedure is executed when information is needed for the
problem solving but the slot value is unspecified. Such procedural
attachments are called demons.
Frame based expert systems also provide an extension to the slot value structure through the
application of facets.
4.3 Facet
A facet is a means of providing extended knowledge about an attribute of a frame. Facets are
used to establish the attribute value, end-user queries, and tell the inference engine how to
process the attribute.
There are three kinds of facets which can be attached with frame based expert system. They
are value facets, prompt facets and inference facets. Value facet specifies default and initial
values of an attribute. Prompt facets enable the enduser to enter the attribute value on-line
during a session with the expert system. And finally inference facet allows us to stop the
inference process when the values of a specified attribute changes.
4.4 Methods and demons
Frames provide us structured way of representing knowledge. But what should we do when
we want to validate and manipulate the knowledge. The answer to that lies in methods and
demons.
Method is a procedure associated with a frame attribute that is executed whenever requested.
(Durkin, 1994) Method is represented by a series of commands similar to a macro in
Microsoft excel.