You are on page 1of 29

FUZZY INFERENCE ITS662 – INTELLIGENT SYSTEM

DEVELOPMENT
FUZZY INFERENCE
There are several stages in fuzzy
inferences:
❖Fuzzification
❖Match the rules
❖Determine the degree to which the
conclusion is supported
❖Combining all rule outputs
❖Defuzzification
RULES
We examine a simple two-input one-output problem that includes three rules:
Rule 1: IF speed_error is zero
AND acceleration is zero
THEN throttle is ‘reduce small amount’
Rule 2: IF speed_error is positive
OR acceleration is negative
THEN throttle is ‘reduce high amount’
Rule 3: IF speed_error is negative
THEN throttle is ‘increase small amount’
DEGREE OF MEMBERSHIP (GRAPH)
STEP 1: FUZZIFICATION
The first step is to take the crisp inputs, x1 and y1 speed error and acceleration), and
determine the degree to which these inputs belong to each of the appropriate fuzzy
sets.
Suppose that, from the reading on the sensors, the speed error is -1 and the acceleration is 8.

 ( speed_error = -1 ) = 0.20 -> positive


 ( speed_error = -1 ) = 0.85 -> zero
 ( speed_error = -1 ) = 0.0 -> negative

SPEED ERROR
STEP 1: FUZZIFICATION (CONT.)
Suppose that, from the reading on the sensors, the speed error is -1 and the
acceleration is 8.

 ( acceleration = 8 ) = 0.0 -> positive


 ( acceleration = 8 ) = 0.25 -> zero
 ( acceleration = 8 ) = 0.8 -> negative

ACCELERATION
STEP 2 : MATCHING RULES
❖The second step is to take the fuzzified inputs, and apply them to the
antecedents of the fuzzy rules.
❖If a given fuzzy rule has multiple antecedents, the fuzzy operator (AND or
OR) is used to obtain a single number that represents the result of the
antecedent evaluation.
❖This number (the truth value) is then applied to the consequent membership
function.
STEP 2 : MATCHING RULES
Rule 1 : IF speed_error is zero (0.85)
AND acceleration is zero (0.25)
THEN throttle is ‘reduce small amount’ MIN(0.85, 0.25) = 0.25
Rule 2: IF speed_error is positive (0.2)
OR acceleration is negative (0.8)
THEN throttle is ‘reduce high amount’ MAX(0.2, 0.8) = 0.8
Rule 3: IF speed_error is negative (0.0)
THEN throttle is ‘increase small amount’(0.0)
STEP 3: DETERMINE THE DEGREE TO WHICH THE
CONCLUSION IS SUPPORTED
From all three rules fired, we can determine the degree to which the conclusion is
supported.

Rule 1:  throttle = reduce small = 0.25

Rule 2:  throttle = reduce high = 0.8

Rule 3:  throttle = increase small = 0.0


STEP 4: COMBINING ALL RULES OUTPUT
Show the combination by clipping of the output graph.

 throttle = reduce small = 0.25


 throttle = reduce high = 0.8
 throttle = increase small = 0.0
STEP 5: DEFUZZIFICATION
Defuzzification is the last stage where the fuzzy output being converted (defuzzified) into crisp value, which gives
more meaning to the user. Center of Gravity (COG) can be used to calculate this.
EXAMPLE 1:
Rule: 1 IF project_funding is adequate
OR project_staffing is small
THEN risk is low

Rule: 2 IF project_funding is marginal


AND project_staffing is large
THEN risk is normal

Rule: 3 IF project_funding is inadequate


THEN risk is high
STEP 1: FUZZIFICATION
Crisp Input Crisp Input
x1 y1

1 1 B1 B2
A1 A2 A3 0.7
0.5
0.2 0.1
0 0
x1 X y1 Y
 (x = A1) = 0.5  (y = B1) = 0.1
 (x = A2) = 0.2  (y = B2) = 0.7

(a) Project Funding (a) Project Staffing


A1: inadequate B1: small
A2: marginal B2: large
A3: adequate
STEP 2: MATCHING RULES
1 1 1 Rule: 1
A3 B1 C1 C2 C3 IF project_funding is adequate
0.1 OR 0.1
0.0
(max)
OR project_staffing is small
0 x1 X 0 y1 Y 0 Z THEN risk is low
Rule 1: IF x is A3 (0.0) OR y is B1 (0.1) THEN z is C1 (0.1)
1 1 1 Rule: 2
0.7
C1 C2 C3 IF project_funding is marginal
A2 0.2 B2 AND 0.2
(min)
AND project_staffing is large
0 x1 X 0 y1 Y 0 Z THEN risk is normal
Rule 2: IF x is A2 (0.2) AND y is B2 (0.7) THEN z is C2 (0.2)
1 1
Rule: 3
A1 0.5 0.5 C1 C2 C3 IF project_funding is inadequate
THEN risk is high
0 x1 X 0 Z
Rule 3: IF x is A1 (0.5) THEN z is C3 (0.5)
STEP 3: DETERMINE THE DEGREE TO WHICH THE
CONCLUSION IS SUPPORTED
Rule 1:  risk is low = 0.1

Rule 2:  risk is normal = 0.2

Rule 3:  risk is high = 0.5


STEP 4: COMBINING ALL RULES OUTPUT

1 1 1
C1 C2 C3
0.5 0.5
0.2 0.2
0.1 0.1
0 Z 0 Z 0 Z 0 Z
z is C 1 (0.1) z is C 2 (0.2) z is C 3 (0.5) 
STEP 5: DEFUZZIFICATION
FUZZY INFERENCE SYSTEM
Fuzzy inference systems have been successfully applied in fields:
automatic control,
data classification,
decision analysis,
expert systems, and
computer vision.
FUZZY INFERENCE SYSTEM
Because of its multidisciplinary nature, fuzzy inference systems are associated with a
number of names:
fuzzy-rule-based systems,
fuzzy expert systems,
fuzzy modelling,
fuzzy associative memory,
fuzzy logic controllers, and
simply (and ambiguously) fuzzy systems.
MAMDANI-STYLE FUZZY INFERENCE
Mamdani-type inference process is performed in four steps:
1. Fuzzification of the input and output variables
2. Fuzzy logical operations
3. Aggregation
4. Defuzzification
Mamdani-type inference expects the output membership functions to be fuzzy sets.
MAMDANI STYLE OF RULE EVALUATION
1 1 1
A3 B1 C1 C2 C3
0.1 OR 0.1
0.0
(max)
0 x1 X 0 y1 Y 0 Z

Rule 1: IF x is A3 (0.0) OR y is B1 (0.1) THEN z is C1 (0.1)


1 1 1
0.7
C1 C2 C3
A2 0.2 B2 AND 0.2
(min)
0 x1 X 0 y1 Y 0 Z
Rule 2: IF x is A2 (0.2) AND y is B2 (0.7) THEN z is C2 (0.2)
1 1
A1 0.5 0.5 C1 C2 C3

0 x1 X 0 Z
Rule 3: IF x is A1 (0.5) THEN z is C3 (0.5)
CLIPPING VS. SCALING
❑ The most common method of correlating the rule consequent with the truth value of the rule
antecedent is to cut the consequent membership function at the level of the antecedent truth.
❑ This method is called clipping. Since the top of the membership function is sliced, the clipped
fuzzy set loses some information.
❑ However, clipping is still often preferred because it involves less complex and faster
mathematics and generates an aggregated output surface that is easier to defuzzify.

While clipping is a frequently used method, scaling offers a better approach for
preserving the original shape of the fuzzy set.
The original membership function of the rule consequent is adjusted by multiplying all its
membership degrees by the truth value of the rule antecedent.
This method, which generally loses less information, can be very useful in fuzzy expert
systems.
CLIPPING VS. SCALING
Degree of Degree of
Membership Membership
1.0 1.0

C2 C2

0.2 0.2

0.0 0.0
Z Z
SUGENO-STYLE FUZZY INFERENCE
❑Mamdani-style inference, as we have just seen, requires us to find the centroid of a
two-dimensional shape by integrating across a continuously varying function. In
general, this process is not computationally efficient.
❑Michio Sugeno suggested to use a single spike, a singleton, as the membership
function of the rule consequent. A singleton, or more precisely a fuzzy singleton, is a
fuzzy set with a membership function that is unity at a single particular point on the
universe of discourse and zero everywhere else.
SUGENO-STYLE FUZZY INFERENCE
Sugeno-style fuzzy inference is very similar to the Mamdani method. Sugeno changed
only a rule consequent. Instead of a fuzzy set, he used a mathematical function of the
input variable. The format of the Sugeno-style fuzzy rule is
IF x is A IF x is A
AND y is B AND y is B
THEN z is k
THEN z is f (x, y)

where x, y and z are linguistic variables; where k is a constant.


A and B are fuzzy sets on universe of
discourses X and Y, respectively;
and f (x, y) is a mathematical function.
SUGENO-STYLE OF RULE EVALUTION
All consequent membership functions are represented by singleton spikes.
SUGENO-STYLE OF COMBINING RULE OUTPUT
SUGENO-STYLE OF DEFUZZIFICATION
HOW TO MAKE A DECISION ON WHICH
METHOD TO APPLY? MAMDANI OR SUGENO?
• This method is widely accepted for capturing expert
knowledge. It allows us to describe the expertise in

Mamdani more intuitive, more human-like manner.


• However, Mamdani-type fuzzy inference entails a
substantial computational burden.

• This method is computationally effective.

Sugeno
• It works well with optimisation and adaptive
techniques, which makes it very attractive in control
problems, particularly for dynamic nonlinear systems.

You might also like