White
Paper: Fuzzy Logic in Knowledge Builder
Rule based logic has been used to
capture human expertise in classification, assessment, diagnostic
and planning tasks. Probability has traditionally been used to capture
decision making under uncertain conditions. For example, consider
the rule:
IF Symptom-A is present THEN diagnosis is illness-X
There will be situations in which we are uncertain about the presence
of Symptom-A. In such cases we can enter the probability of Symptom-A
being present which will result in a confidence factor in our diagnosis
of illness-X. A number of methods have been used to propagate probabilities
during rule based inference. Many of these techniques are based
on the probabilistic inference techniques used in Mycin and
Prospector. The weakness of such techniques is that they
do not reflect the way human experts reason under uncertainty. XpertRule
Knowledge Builder allows an alternative methodology to the probabilistic
reasoning approach. This involves defining Symptom-A and illness-X
as logical attribute with values likely, unsure, unlikely.
This allows the expert to dictate the relationship between the symptoms
and diagnosis, instead of relying on the mathematical propagation
of probabilities.
Many people confuse the above example of uncertain reasoning
with fuzzy reasoning. Probabilistic reasoning is concerned
with the uncertain reasoning about well defined events or concepts
such as Symptom-A and Illness-X. On the other hand, Fuzzy Logic
is concerned with the reasoning about 'Fuzzy' events or concepts.
Examples of fuzzy concepts are 'temperature is high' and 'person
is tall'. When is a person tall, at 170 cm , 180 cm or 190 cm? If
we define the threshold of tallness at 180 cm, then the implication
is that a person of 179.9 cm is not tall. When humans reason with
terms such as 'tall' they do not normally have a fixed threshold
in mind, but a smooth fuzzy definition. Humans can reason very effectively
with such fuzzy definitions, therefore, in order to capture human
fuzzy reasoning we need fuzzy logic. An example of a fuzzy rule
which involves a fuzzy condition and a fuzzy conclusion is:
IF salary is high THEN credit risk is low
Fuzzy reasoning involves three steps:
- Fuzzification of the terms that appear in the conditions of rules.
- Inference from fuzzy rules.
- Defuzzification of the fuzzy terms that appear in the conclusions of rules.
Fuzzification
Lotfi Zadeh pioneered a method of modelling human imprecise reasoning
using fuzzy sets. Using this technique, the concept 'tall' is related
to the underlying objective term which it is attempting to describe;
namely the actual height in centimetres. The transformation of an
objective term into a fuzzy concept is called fuzzification. As
an example, the term 'tall' can be represented in this graph:

It shows the degree of membership with which a person belongs
to the category (set) 'tall'. Full membership of the class 'tall'
is represented by a value of 1, while no membership is represented
by a value of 0. At 150 cm and below, a person does not belong to
the class 'tall'. At 210cm and above, a person fully belongs to
the class 'tall'. Between 150cm and 210cm the membership increases
linearly between 0 and 1. The degree of belonging to the set 'tall'
is called the confidence factor or the membership value. The shape
of the membership function curve can be non-linear.
The purpose of the fuzzification process is to allow a fuzzy condition
in a rule to be interpreted. For example the condition 'person =
tall' in a rule can be true for all values of 'height', however,
the confidence factor or membership value of this condition can
be derived from the above graph. A person who is 180 cm in height
is 'tall' with a confidence factor of 0.5 (membership value of the
club 'tall'). It is the gradual change of the membership value of
the condition 'tall' with height that gives fuzzy logic its strength.
Normally fuzzy concepts have a number of values to describe the
various ranges of values of the objective term which they describe.
For example, the fuzzy concept 'tallness' may have the values 'Tall',
'Medium height' and 'Short'. Typically, the membership functions
of these values are as shown in the graph below:

Typically, fuzzy concepts have an odd number of values; 3, 5 or
7. We can extend the above values by adding very short and very
tall. The real power of fuzzy logic systems, compared to crisp logic
systems, lies in the ability to represent a concept using a small
number of fuzzy values. This therefore reduces the number of rules
required to capture the knowledge relating to that concept. To achieve
the same accuracy with crisp logic, a large number of logical values
would be required resulting in a large rule base.
Fuzzy Inference
Inference from a set of fuzzy rules involves fuzzification of
the conditions of the rules, then propagating the confidence factors
(membership values) of the conditions to the conclusions (outcomes)
of the rules. Consider the following rule:
IF (applicant is young) AND (income is low) THEN credit limit is low
Inference from this above rule involves (using fuzzification)
looking up the membership value (MV) of the condition 'applicant
is young' given the applicant's age, and the MV of 'income is low'
given the applicant's salary. The method proposed by Lotfi Zadeh
is to take the minimum MV of all the conditions and to assign it
to the outcome 'credit limit is low'. An enhancement of this method
involves having a weight for each rule between 0 and 1 which multiplies
the MV assigned to the outcome of the rule. This weight can be edited
on the Pattern rules view, or assigned at run time. By default each
rule weight is set to 1.0.
In a fuzzy rule base a number of rules with the outcome 'credit
limit is low' will be fired. The inference engine will assign the
outcome 'credit limit is low', the maximum MV from all the fired
rules.
In summary fuzzy inference involves:
- Defuzzification of the conditions of each rule and assigning
the outcome of each rule the minimum MV of its conditions multiplied
by the rule weight.
- Assigning each outcome the maximum MV from its fired rules.
- Fuzzy inference will result in confidence factors (MVs) assigned
to each outcome in the rule base.
Defuzzification
If the conclusion of the fuzzy rule set involves fuzzy concepts,
then these concepts will have to be translated back into objective
terms before they can be used in practice. For a rules set including
the credit limit rule described in the previous section, fuzzy inference
will result in the terms 'credit limit is low', 'credit limit is
medium' and 'credit limit is high' being assigned membership values.
However, in practice, to use the conclusions from such a rule base
we need to defuzzify the conclusions into a crisp credit limit figure.
To do this we need to define the membership functions for the credit
limit outcomes as shown in this diagram:

One method of defuzzification is to place the confidence factors
(MV) generated by inference for each fuzzy outcome at the point
where the membership function has its highest value. The required
defuzzified value can then be calculated as the centre of gravity
of the three MV vectors. This is illustrated in the example below,
assuming that fuzzy inference results in MV of 0.3 , 0.5 and 0.7
for the low, medium and high credit limit outcomes respectively.

The defuzzified value of credit limit is calculated as the centre
of gravity of the three Mvs (viewed) as weights placed at 500, 1000,
and 1500. The expression for the defuzzified value is:
(HV_low * MV_low + HV_med * MV_med + HV_high * MV_high) / (MV_low
+ MV_med + MV_high)
HV_low, HV_med , HV_high are the values of credit limit that give
the highest membership values for low, medium and high credit.
MV_low, MV_med , MV_high are the MV values generated by fuzzy
inference for low, medium and high credit outcomes.
Applying the above formula to the above example gives a defuzzified
credit limit value of UK pounds £1133.33.
Note that the defuzzification stage is not required if the outcomes
are crisp concepts such as 'diagnosis is a faulty printer'. In these
cases, fuzzy inference results in assigning confidence factors (or
probabilities) to the various outcomes.
While the main principles of fuzzy logic are broadly agreed on,
there are a number of various methods of fuzzy inference and defuzzification.
The methods described above are the most widely used and are the
ones implemented in XpertRule Knowledge Builder.
Fuzzy logic implementation in XpertRule Knowledge Builder
Design Concepts
The fuzzy logic implementation in Knowledge Builder was developed
with three objectives in mind; to provide comprehensive features,
to maintain ease of use and to integrate seamlessly with the non
fuzzy (crisp) Rules in Knowledge Builder.
Fuzzy Objects
- An Object of type List is defined as Fuzzy by setting its isFuzzy
Property to True.
- A Fuzzy Object can either be used to represent Fuzzy Knowledge
(Rules), or to represent a Fuzzy Attribute used in the definition
of those Rules.
Fuzzy Attributes
- The fuzzyValue property of a Fuzzy Object holds its numeric
runtime input value. This can be assigned by using procedural
commands (e.g. @Assign Pressure.fuzzyValue = 50).
- The numeric range of the fuzzyValue property is mapped to the
Object Values using the Fuzzy Membership Functions. These graphical
functions derive the Fuzzy Membership Value (fuzzyMV) of each
of the discrete Values (Instances) for any given fuzzyValue input.
Fuzzy Rules
- The fuzzyValue property holds the "defuzzified" numeric
output value for the Rules Object, which is derived from the fuzzyMV
and Fuzzy Membership Functions of each of the Values (Instances).
- The derivation of fuzzyMV of each of the Values (Instances)
is based on which Rules fire at runtime and the fuzzyMV of the
Values of the individual Fuzzy Attributes used by those rules.
- The Value with the highest fuzzyMV is selected.
- A Fuzzy Rules Object can contain both Fuzzy and non-Fuzzy Attributes
(where the fuzzyMV is assumed to be 1.0 for the selected Value
and 0.0 for all other Values).
- Fuzzy Rules inference for an Object can be made from either
Cases/Rules or a Decision Tree (depending on the setting of the
knowledgeMode property)
- More than one Rule / Tree Path may fire
- The rule condition is considered to be True if the fuzzyMV
of its Values is greater then 0.
- For Objects where the multiSelect property is set to True,
the "defuzzified" fuzzyValue is not required (and therefore
no Fuzzy Membership Functions are defined). The output from such
an object, which is still held in fuzzyMV for each of the Values,
represent the Confidence Factors in each of the possible rule
outcomes. Here all Object Values with fuzzyMV > 0 are selected.
- A Fuzzy Rules Object can be used as an Attribute in another
Fuzzy (or non-Fuzzy) Rules Object
Defining a Fuzzy Object in XpertRule Knowledge Builder
- Using the Knowledge Representation Wizard on the Object Wizards
Tab, select the Fuzzy Option. Alternatively the isFuzzy Property
can be set directly on the Object Control Properties Tab.
- Make sure that the "Values" of the List Object are
defined on the Instance Properties Tab.
- On the Fuzzy Membership Functions Tab (this is not necessary
if the Object's multiSelect Property is set to True):
- Define the Minimum and Maximum range for the fuzzyValue (on
the x-axis)
- Select the Membership function of each Value (highlight then
right-mouse-click)
- Enter the reflex points for each function (2 for S &
Z, 3 for Lamda and 4 for Pi)
XpertRule Knowledge Builder Inference from Fuzzy Logic
Inference from a set of fuzzy rules involves fuzzification of the
conditions of the rules, then propagating the confidence factors
(membership values) of the conditions to the conclusions (outcomes)
of the rules. Consider the following rule:
IF (applicant is young) AND (income is low) THEN credit limit
is low
Inference from this above rule involves (using fuzzification) looking
up the membership value (MV) of the condition 'applicant is young'
given the applicant's age, and the MV of 'income is low' given the
applicant's salary. The method proposed by Lotfi Zadeh is to take
the minimum MV of all the conditions and to assign it to the outcome
'credit limit is low'
In a fuzzy rule base a number of rules with the outcome 'credit
limit is low' will be fired. The inference engine will assign the
outcome 'credit limit is low', the maximum MV from all the fired
rules.
In summary fuzzy inference involves:
- Defuzzification of the conditions of each rule and assigning
the outcome of each rule the minimum MV of its conditions multiplied
by the rule weight.
- Assigning each outcome the maximum MV from its fired rules.
- Fuzzy inference will result in confidence factors (MV's) assigned
to each outcome in the rule base.
|