You are on page 1of 22

Chapter 5:

Fuzzy Inference Systems (FIS)


 Introduction (4.1)
 Mamdani Fuzzy models (4.2)
 Sugeno Fuzzy Models (4.3)
 Fuzzy Modeling (4.4)
Reference: Jyh-Shing Roger Jang et al.,
Neuro-Fuzzy and Soft Computing: A Computational Approach to Learning and
Machine Intelligence, First Edition, Prentice Hall, 1997. (Chapter 4)
Notice that (4.x) meaning further reading from Chapter 4.x of this book.

Introduction (1)
 Fuzzy inference is a computer paradigm based
on fuzzy set theory, fuzzy if-then-rules and fuzzy
reasoning
 Applications: data classification, decision
analysis, expert systems, times series
predictions, robotics & pattern recognition, which
all of them are Decision Making systems!
 Different names; fuzzy rule-based system, fuzzy
model, fuzzy associative memory, fuzzy logic
controller & fuzzy system
2

Introduction (2)
 FIS was 1st devloped by Mamdani at 1975.
He used FIS to control a steam engine &
boiler combination by a set of linguistic
control rules obtained from experienced
human operators

Introduction (3)
 Conventional computing system use function
as the representation of the process. Such as:
 Where g(x,y) could be any function. Such as:
 Z = g(x,y) = 2*x + 1/y;

Introduction (4)
 But for FIS, the process itself is not in a
mathematic function, but rather than a
combination of calculation with rule base. In
short, if can be called as computing with
words.

Modules of FIS (1)

Modules of FIS (2)


 Fuzzification:
 Convert the universal values to fuzzy values. It
involve of the process of designing the MFs or
input and outputs variables. The detail design of
the MFs is highly depend on knowledge
engineer.

 Inference Engine
Process to calculate the possible value of
OUTPUT MFs based on the rules given.
Generally we have two type of Inference Engine
Mamdani Fuzzy Model
Sugeno Fuzzy Model
7

Modules of FIS (3)


 Rule base
A set of rules that defined by combining input and output
variables using If Then keywords. A knowledge
engineer is needed in order to define useable rules.

 Defuzzification
It is a process to calculate the final output based on the
fuzzy values calculated by Inference Engine (that
associated with Rule Base). The are many methods of
defuzzication such as:
 Centriod of Gravity (COG), Also know as Center of
Area(COA) (Mamdani)
 Mean of Maximum (MOM) (Mamdani)
 Weighted Average (WA) (sugeno)
8

Example 1 (Mamdani Fuzzy models) (1)


 Problem statement:
Given a number between 0 and 10 that
represents the quality of service at a restaurant
(where 10 is excellent), what should the tip be?
Note This problem is based on tipping as it is
typically practiced in the United States. An
average tip for a meal in the U.S. is 15%,
though the actual amount may vary depending
on the quality of the service provided.
Can we make the tip flexible based on some
criterion and decided by FIS?
9

Example 1 (Mamdani Fuzzy models) (2)


 Variable selection must be done before
doing anything related to FIS.
 In this example, suitable inputs are Food
and service quality in the range of 0 to
10.
 Output variable is tip which from 0% to
30% of the bill

10

Example 1 (Mamdani Fuzzy models) (3)


 Fuzzification for Service.
The designer decided to have 3 (Gaussian) MFs.

11

Example 1 (Mamdani Fuzzy models) (4)


 Fuzzification for Food.
The designer decided to have 2 (trapezoid) MFs.

12

Example 1 (Mamdani Fuzzy models) (5)


 Fuzzification for tip.
The designer decided to have 3 (triangular) MFs.

13

Example 1 (Mamdani Fuzzy models) (6)


 Rule base (by designer) has 3 rules:
R1: If Service is Poor OR Food is
Rancid then Tip is Cheap
R2: If Service is Good Then Tip is
Average
R3: If Service is Excellent OR Food is
delicious then Tip is Generous

14

Example 1 (Mamdani Fuzzy models) (7)


 Mamdani Inference Engine (or used to call as
Mamdani Max-min composition) reflected from
the rules are:

15

Example 1 (Mamdani Fuzzy models) (8)


 Question: What is the tip should be given
if service = 3 and food = 7.5 using both
MOM defuzzication method.

16

Example 1 (Mamdani Fuzzy models) (9)


 Fuzzification - Note: for Gaussian membership function,
from now we use the same notation as used in Matlab
gaussmf code such as:

17

Example 1 (Mamdani Fuzzy models) (10)


 Fuzzification Note: for Trapezoid membership

function, we use the same notation as used in


Matlab trapmf code such as:

18

Example 1 (Mamdani Fuzzy models) (11)


 Inference Engine and Rule base:

19

Example 1 (Mamdani Fuzzy models) (12)


 Defuzzification:
This is the most difficult part of FIS
because we need to re-draw the MFs of
output variables and shade some region
of interest based on the values found in
inference engine

20

10

Example 1 (Mamdani Fuzzy models) (13)

tip*(MOM) = 27.8
21

Example 1 (Mamdani Fuzzy models) (14)


 The tip*(MOM) could be found by looking the mean
(center) of the fuzzy values of the shade area.
(Only if your drawing is very accurate!)
 Another way is using the equation (with a sutaible
sampling rate, which is 1 for this case):

22

11

Example 1 (Mamdani Fuzzy models) (15)


 View of FIS process using Matlab

23

Example 2 (1)
 A two inputs (x, y) and one output (z) FIS is use for
control system. Given that the fuzzy values of z
after inference engine are:
and the MFs of z are given as

24

12

Example 2 (2)
 Redraw the MFs of z, and shade the region of
interest (area) that will be used for defuzzication.
 Find the final out z using COG and MOM.

25

Example 2 (3)
 For COG, assume the sampling rate is 0.1.

26

13

Example 2 (4)
 For MOM, assume the sampling rate is 0.1.

 Another way is to exam the graph you draw, but you


might be wrong if your drawing is not accurate.

27

Exercise 1
 Develop and solve the Example 1 using
Matlab Fuzzy Logic Toolbox. Find the
tip*(COG). Solving this question by
Manual Calculation will not be accept.

28

14

Example 3: Sugeno Fuzzy Models (1)


 Repeat the same tip problem using
Sugeno Fuzzy Model!
 Fuzzification:
No change MFs for input variables, but there is
NO NEED to design MF for output variables!

 Rule base:
It must be changed because output is defined
as function rather than MFs.
29

Example 3: Sugeno Fuzzy Models (2)


 Rule base (by designer) has 3 rules:
R1: If Service is Poor OR Food is rancid then
Tip1 = p1*service + q1*food + r1
R2: If Service is Good Then
Tip2 = p2*service + q2*0 + r2
R3: If Service is Excellent OR Food is delicious then
Tip3 =p3*service + q3*food + r3
Where p1, p2, p3, q1, q2, q3, r1, r2 and r3 are constant
number need to be select by designer.
30

15

Example 3: Sugeno Fuzzy Models (3)


 In this case, all p and q are set to 0 (simple, yet logic!), r1 = 5,
r2 = 15, r3 = 25
 The rules become:
R1: If Service is Poor OR Food is rancid then
Tip1 = r1 = 5
R2: If Service is Good Then
Tip2 = r2 = 15
R3: If Service is Excellent OR Food is delicious then
Tip3 =r3 = 25
31

Example 3: Sugeno Fuzzy models (4)


 Fuzzification (SAME AS Mamdani as shown above!):
for Gaussian membership function, from now we use the
same notation as used in Matlab gaussmf code such
as:

32

16

Example 3: Sugeno Fuzzy models (5)


 Fuzzification Note: (SAME AS Mamdani as shown
above!): for Trapezoid membership function, we use

the same notation as used in Matlab trapmf code


such as:

33

Example 3: Sugeno Fuzzy Model (6)


 For sugeno, the inference engine need an extra
variable, name as weight for every rule:

 These weight will be use during defuzzification.


34

17

Example 3: Sugeno Fuzzy Model (7)


 The general equation of Defuzzification for Sugeno Fuzzy
Model, namely Weighted Average is:

 For this tip case, it is:

35

Exercise 2 (1)
 Consider a non-linear (XOR) classification:
 (Manually) Develop a Mamdani Fuzzy Model that
able to solve this classification task.

36

18

Exercise 2 (2)
 Your design of FIS must consider the
following issue:
MFs (number of MF, name of MFs, shape of
MFs)
What are the useful rules? How many of them?
Use both COG and MOM defuzzification

37

Exercise 3
 Repeat Exercise 2, but using Sugeno
Fuzzy Model with Weighted Average of
defuzzification method.
Exercise 4:
 Repeat Exercise 3 and 4 using Matlab
Fuzzy Logic Toolbox!
38

19

Remark (1)
 We have covered several types of fuzzy
inference systems (FISs)
 A design of a fuzzy inference system is
based on the past known behavior of a
target system
 A developed FIS should reproduce the
behavior of the target system
39

Remark (2)
 Examples of FIS
Replace the human operator that regulates &
controls a chemical reaction, a FIS is a fuzzy
logic controller
Target system is a medical doctor; a FIS
becomes a fuzzy expert system for medical
diagnosis
we will study more detail on Fuzzy Logic
Controller in next chapter.

40

20

Remark (3)
How to construct a FIS for a specific
application?
Incorporate human expertise about the target
system: it is called the domain knowledge (linguistic
data!)
Use conventional system identification techniques for
fuzzy modeling when input-output data of a target
system are available (numerical data)

41

Remark (4)
 General guidelines about fuzzy modeling
A. Identification of the surface structure
i. Select relevant input-output variables
ii. Choose a specific type of FIS
iii. Determine the number of linguistic terms associated with
each input & output variables (for a Sugeno model,
determine the order of consequent equations)

Part A describes the behavior of the target system by


means of linguistic terms
42

21

Remark (5)
B.

Identification of deep structure


i.
ii.

Choose an appropriate family of parameterized MFs


Interview human experts familiar with the target
systems to determine the parameters of the MFs used
in the rule base
iii. Refine the parameters of the MFs using regression &
optimization techniques (best performance for a plant
in control!)
(i) + (ii): assumes the availability of human experts
(iii): assumes the availability of the desired input-output
data set
43

22

You might also like