Com 423 Expert System and Machine Learning

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 19

COM 423 EXPERT SYSTEM AND MACHINE LEARNING

Expert System

Expert System is an interactive and reliable computer-based decision-making system which


uses both facts and heuristics to solve complex decision-making problems. It is considered at
the highest level of human intelligence and expertise. The purpose of an expert system is to
solve the most complex issues in a specific domain.

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.

Examples of Expert System

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

Characteristics of Expert System

Following are the important Characteristics of Expert System in AI:

 The Highest Level of Expertise: The Expert system in AI offers the highest level of
expertise. It provides efficiency, accuracy and imaginative problem-solving.

 Right on Time Reaction: An Expert System in Artificial Intelligence interacts in a


very reasonable period of time with the user. The total time must be less than the time
taken by an expert to get the most accurate solution for the same problem.

 Good Reliability: The Expert system in AI needs to be reliable, and it must not make
any a mistake.

 Flexible: It is vital that it remains flexible as it is possessed by an Expert system.

 Effective Mechanism: Expert System in Artificial Intelligence must have an efficient


mechanism to administer the compilation of the existing knowledge in it.

 Capable of handling challenging decision & problems: An expert system is


capable of handling challenging decision problems and delivering solutions.

Component of Expert System

The Expert System in AI consists of the following given components

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.

Other Key Terms Use in Expert System

Facts and Rules

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.

Benefits of Expert Systems

1. It improves the decision quality


2. Cuts the expense of consulting experts for problem-solving
3. It provides fast and efficient solutions to problems in a narrow area of specialization.
4. It can gather scarce expertise and used it efficiently.
5. Offers consistent answer for the repetitive problem
6. Helps you to get fast and accurate answers
7. Ability to solve complex and challenging issues
8. Artificial Intelligence Expert Systems can steadily work without getting emotional,
tensed or fatigued.

Limitation of Expert System

a. Unable to make a creative response in an extraordinary situation


b. Errors in the knowledge base can lead to wrong decision
c. The maintenance cost of an expert system is too expensive
d. Each problem is different therefore the solution from a human expert can also be
different and more creative

Application of Expert System

 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

Types of Expert System

There are different types of expert systems:

 rule based expert system


 fuzzy expert system
 frame based expert system and
 hybrid expert systems.

RULE BASED EXPERT SYSTEM

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

Rule: IF-THEN Fact

Inference Engine

Explanation Facilities

User- Inference Developer-Inference

User Knowledge engineer

Expert

Figure 1: Structure of rule based expert system


2.2 Inference Techniques

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

Figure 2: Inference process for rule based expert system

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.

Let us consider the following 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 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:

Forward chaining Backward chaining


The data is known at the beginning of the The goal is set up and the only needed data
inference process, and the user is not required from the database is used for reasoning. User
to input additional facts. is only required to input facts which is not in
the database.
Developers should choose the forward Developers should choose backward chaining
chaining when they need to gather some when they begin with hypothetical solution
information first and then want to infer and then search for facts to prove it.
something from that.
Dendral, an expert system for determining MYCIN, an expert system for diagnosis
molecular structure of unknown soil uses infectious blood disease uses backward
forward chaining. 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.4 Disadvantages of rule base expert systems


• It lacks hierarchical structure of knowledge representation; hence we cannot
understand the logical interdependence of rules.
• It goes through exhaustive search; hence it makes system very slow and cannot be
used for real time applications.
• It cannot learn from past experience and cannot break the rules in case if exception
occurs.
• It is built on experts past experience, guts and intuitions and trial and error approach.

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.

3. FUZZY EXPERT SYSTEM


When we want to express expert knowledge that uses vague and unclear words like
‘slightly overburden’, ‘heavily reduced’, ‘moderately difficult’, ‘not so old’, ‘very tall’, we
can use fuzzy set theory. Fuzzy logic is not logic that is fuzzy, but logic that is used to
describe fuzziness. But then problem comes, how will you differentiate between a member of
a class from non-members. Fuzzy logic is based on the idea that all things are described on a
sliding scale, which helps us to differentiate between members of the class from non-
members.

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.

Figure 3: Fuzzy logic

Fuzzy logic is determined for knowledge representation based on degree of membership


rather than on crisp membership of classical binary logic. (Zadeh, 1965)

3.1 Fuzzy sets


Fuzzy sets can be simply defined as a set with fuzzy boundaries. A fuzzy set is capable of
providing a graceful transition across a boundary.
Let x can be universe of discourse and its elements be denoted as x. in classical set theory,
crisp set A of X defined as function fA(x)called the characteristic function of A.

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

3.2 Linguistic variables and hedges

A linguistic variable is a fuzzy variable. When we say, X is tall, so here X


takes linguistic value tall. For example,
IF house is old
THEN resale value is low.

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.

Hedge can modify verbs, adjective, adverbs or even whole


sentences. They are used as  All-purpose modifiers, such
as very, quite or extremely.
• Truth-values, such as quite true or mostly false.  Probabilities, such as likely or not
very likely.
• Quantifiers, such as most, several or few.
• Possibilities such as almost impossible or quite possible.

3.3 Fuzzy rules


A fuzzy rule can be defined as a conditional
statement in the form: IF x is A
THEN I is B
Where x and y are linguistic variable and A and b are Linguistic Values determined by fuzzy
sets on the universe of discourse X and Y, respectively.

Difference between classical and fuzzy rules

A classical IF_THEN rule uses binary logic,


for example, Rule:1
IF speed is >100
THEN stopping distance is long
Rule:2
IF speed is < 40
THEN stopping distance is short

A IF-THEN rule using fuzzy logic,


Rule1:
IF speed is fast
THEN stopping distance is long
Rule 2:
IF speed is slow
THEN stopping _distance is short

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

Fuzzy inference can be defined as a process of mapping from a given input to an


output, using the theory of fuzzy sets. The fuzzy inference process is performed in four steps.
They are fuzzification of the input variable, rule evaluation, aggregation of the rule output
and finally defuzzification.

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.

3.5 Fuzzy expert system


development process The process has
following steps.
1) Specify the problem and define linguistic variables.
2) Determine fuzzy sets.
3) Elicit and construct fuzzy rules.
4) Encode the fuzzy sets, fuzzy rules and procedures to perform fuzzy inference into the
expert system. 5) Evaluate and tune the system.

4. FRAME BASED EXPERT SYSTEMS:

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.

4.2 Frame as a knowledge representation technique

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.

In general, demons have an IF-THEN structure. It is executed whenever an attribute in the


demon’s IF statement changes its value.

4.5 Inference engine


In a frame based expert system, the inference engine searches for the goal or a specific
attribute. In a frame based expert system, rule plays a secondary role. Knowledge is stored
in frames and both methods and demons are used to add action to the frames. The inference
engine find those rules whose consequents contain the goal of interest and examine them one
by one in order of rule base. If all the rules are valid, then inference engine will conclude that
goal is reached else if any of the antecedents are invalid, then it is concluded that goal is not
reached.

4.6 Frame based expert system development process


The steps in the frame based expert system development process are as
follows: Specify the problem and define the scope of the system.
2) Determine the classes and
their attributes. 3) Define
instances.
4) Design displays
5) Define when changed and when needed methods, and demons.
6) Define rules.
7) Evaluate and expand the system.

5. HYBRID EXPERT SYSTEM


The above discuss technologies, i.e. rule based expert system, fuzzy expert system, and frame
based expert system have positive and negative points. Let say, in rule based expert system,
the time to search and execute rule is longer, while Fuzzy logic allows you deal with
imprecise knowledge. Frame based expert system allows us to represent knowledge in
hierarchical way, while in rule based expert system is most easy to construct because of it
simple structure. When we want to combine he advantages of two components, we can
create hybrid technology. But the hybrid technology can be good or bad depending on which
two technologies are combined. Here we are exploring two hybrid expert systems. i. Neural
expert systems ii. Neuro-fuzzzy systems
It is important to note that, in both of hybrid system; neural network is one of the important
components.

You might also like