Fuzzy Inference Systems - WordPress.com...2019/02/04  · Slides for Fuzzy Sets, Ch. 4 of...

32
Fuzzy Inference Systems 1 DR. SYED IMTIYAZ HASSAN Assistant Professor, Deptt. of CSE, Jamia Hamdard (Deemed to be University), New Delhi, India. http://www.jamiahamdard.edu https://Syedimtiyazhassan.org [email protected] Adopted from: Slides for Fuzzy Sets, Ch. 4 of Neuro-Fuzzy and Soft Computing J.-S. Roger Jang

Transcript of Fuzzy Inference Systems - WordPress.com...2019/02/04  · Slides for Fuzzy Sets, Ch. 4 of...

Page 1: Fuzzy Inference Systems - WordPress.com...2019/02/04  · Slides for Fuzzy Sets, Ch. 4 of Neuro-Fuzzy and Soft Computing J.-S. Roger Jang Outline 1. Fuzzy Inference Systems a) Ebrahim

Fuzzy Inference Systems

1

DR. SYED IMTIYAZ HASSANAssistant Professor, Deptt. of CSE, Jamia Hamdard(Deemed to be University), New Delhi, India.http://www.jamiahamdard.edu

https://[email protected]

Adopted from:

Slides for Fuzzy Sets, Ch. 4 ofNeuro-Fuzzy and Soft Computing

J.-S. Roger Jang

Page 2: Fuzzy Inference Systems - WordPress.com...2019/02/04  · Slides for Fuzzy Sets, Ch. 4 of Neuro-Fuzzy and Soft Computing J.-S. Roger Jang Outline 1. Fuzzy Inference Systems a) Ebrahim

Outline

1. Fuzzy Inference Systems

a) Ebrahim Mamdani

b) Sugeno, or TSK (Takagi/Sugeno/Kang)

c) Tsukamoto

2. Input Space Partitioning

3. Fuzzy modeling: Required tasks

a) Surface structure identification

b) Deep structure identification

2

Page 3: Fuzzy Inference Systems - WordPress.com...2019/02/04  · Slides for Fuzzy Sets, Ch. 4 of Neuro-Fuzzy and Soft Computing J.-S. Roger Jang Outline 1. Fuzzy Inference Systems a) Ebrahim

Fuzzy Inference Systems(FIS)

Also called:

• Fuzzy rule-based system

• Fuzzy model

• Fuzzy associate memory (FAM)

• Fuzzy logic controller

• Fuzzy system

3

Page 4: Fuzzy Inference Systems - WordPress.com...2019/02/04  · Slides for Fuzzy Sets, Ch. 4 of Neuro-Fuzzy and Soft Computing J.-S. Roger Jang Outline 1. Fuzzy Inference Systems a) Ebrahim

Characteristics

• The output of FIS is always a fuzzy set irrespective of its input which can be fuzzy or crisp.

• It is necessary to have fuzzy output when it is used as a controller.

• A defuzzification unit would be there with FIS to convert fuzzy variables into crisp variables.

Page 5: Fuzzy Inference Systems - WordPress.com...2019/02/04  · Slides for Fuzzy Sets, Ch. 4 of Neuro-Fuzzy and Soft Computing J.-S. Roger Jang Outline 1. Fuzzy Inference Systems a) Ebrahim

Functional Blocks

• Rule Base − It contains fuzzy IF-THEN rules.

• Database − It defines the membership functions of fuzzy sets used in fuzzy rules.

• Decision-making Unit − It performs operation on rules.

• Fuzzification Interface Unit − It converts the crisp quantities into fuzzy quantities.

• Defuzzification Interface Unit − It converts the fuzzy quantities into crisp quantities.

Page 6: Fuzzy Inference Systems - WordPress.com...2019/02/04  · Slides for Fuzzy Sets, Ch. 4 of Neuro-Fuzzy and Soft Computing J.-S. Roger Jang Outline 1. Fuzzy Inference Systems a) Ebrahim

6

Block Diagram

Page 7: Fuzzy Inference Systems - WordPress.com...2019/02/04  · Slides for Fuzzy Sets, Ch. 4 of Neuro-Fuzzy and Soft Computing J.-S. Roger Jang Outline 1. Fuzzy Inference Systems a) Ebrahim

Famous Fuzzy Models

• Ebrahim Mamdani Fuzzy Models

• Sugeno Fuzzy Models

• Tsukamoto Fuzzy Models

7

Page 8: Fuzzy Inference Systems - WordPress.com...2019/02/04  · Slides for Fuzzy Sets, Ch. 4 of Neuro-Fuzzy and Soft Computing J.-S. Roger Jang Outline 1. Fuzzy Inference Systems a) Ebrahim

Mamdani Fuzzy Models

• First attempt to control steam engine and boiler combination by aset of linguistic control rules obtained from experienced humanoperator.

• Since the plant takes only crisp value as inputs, a defuzzifier is usedto convert fuzzy set to a crisp values.

8

Page 9: Fuzzy Inference Systems - WordPress.com...2019/02/04  · Slides for Fuzzy Sets, Ch. 4 of Neuro-Fuzzy and Soft Computing J.-S. Roger Jang Outline 1. Fuzzy Inference Systems a) Ebrahim

9

Mamdani composition of three SISO fuzzy outputs

Page 10: Fuzzy Inference Systems - WordPress.com...2019/02/04  · Slides for Fuzzy Sets, Ch. 4 of Neuro-Fuzzy and Soft Computing J.-S. Roger Jang Outline 1. Fuzzy Inference Systems a) Ebrahim

10

Two-rule Mamdani with min and max operators

Page 11: Fuzzy Inference Systems - WordPress.com...2019/02/04  · Slides for Fuzzy Sets, Ch. 4 of Neuro-Fuzzy and Soft Computing J.-S. Roger Jang Outline 1. Fuzzy Inference Systems a) Ebrahim

11

Two-rule Mamdani with max-product operators

Page 12: Fuzzy Inference Systems - WordPress.com...2019/02/04  · Slides for Fuzzy Sets, Ch. 4 of Neuro-Fuzzy and Soft Computing J.-S. Roger Jang Outline 1. Fuzzy Inference Systems a) Ebrahim

Defuzzification

• Centroid of Area (COA)

• Bisector of Area (BOA)

• Mean of Max (MOM)

• Smallest of Max (SOM)

• Largest of Max (LOM)

12

Page 13: Fuzzy Inference Systems - WordPress.com...2019/02/04  · Slides for Fuzzy Sets, Ch. 4 of Neuro-Fuzzy and Soft Computing J.-S. Roger Jang Outline 1. Fuzzy Inference Systems a) Ebrahim

Defuzzification

13

Page 14: Fuzzy Inference Systems - WordPress.com...2019/02/04  · Slides for Fuzzy Sets, Ch. 4 of Neuro-Fuzzy and Soft Computing J.-S. Roger Jang Outline 1. Fuzzy Inference Systems a) Ebrahim

Example

• if x is small then y is small

• if x is medium then y is medium

• if x is large then y is large14

-10 -5 0 5 100

0.5

1

X

Me

mb

ers

hip

Gra

de

s

small medium large

0 2 4 6 8 100

0.5

1

Y

Me

mb

ers

hip

Gra

de

s

small medium large

-10 -5 0 5 100

2

4

6

8

10

X

Y

Results depend on T-norm, S-norm, and defuzzification method

X = [-10, 10]

Y = [0, 10]

Page 15: Fuzzy Inference Systems - WordPress.com...2019/02/04  · Slides for Fuzzy Sets, Ch. 4 of Neuro-Fuzzy and Soft Computing J.-S. Roger Jang Outline 1. Fuzzy Inference Systems a) Ebrahim

15

-5 0 50

0.5

1

X

small large

-5 0 50

0.5

1

Y

Me

mb

ers

hip

Gra

de

ssmall large

-5 0 50

0.5

1

Z

large negative

small negative

small positive

large positive

Example

• if x is small & y is small then z is large negative

• if x is small & y is large then z is small negative

• if x is large & y is small then z is small positive

• if x is large & y is large then z is large positive

-5

0

5

-5

0

5

-2

0

2

XY

Z

X = Y = Z = [-5, 5]

Page 16: Fuzzy Inference Systems - WordPress.com...2019/02/04  · Slides for Fuzzy Sets, Ch. 4 of Neuro-Fuzzy and Soft Computing J.-S. Roger Jang Outline 1. Fuzzy Inference Systems a) Ebrahim

Example

16

Rule: 1 IF x is A3 OR y is B1 THEN z is C1

Rule: 2 IF x is A2 AND y is B2 THEN z is C2

Rule: 3 IF x is A1 THEN z is C3

Real-life example:

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

Page 17: Fuzzy Inference Systems - WordPress.com...2019/02/04  · Slides for Fuzzy Sets, Ch. 4 of Neuro-Fuzzy and Soft Computing J.-S. Roger Jang Outline 1. Fuzzy Inference Systems a) Ebrahim

Example: Step 1- Fuzzification

17

• Take the crisp inputs, x1 and y1 (project funding and project

staffing)

• Determine the degree to which these inputs belong to each of

the appropriate fuzzy sets.

Page 18: Fuzzy Inference Systems - WordPress.com...2019/02/04  · Slides for Fuzzy Sets, Ch. 4 of Neuro-Fuzzy and Soft Computing J.-S. Roger Jang Outline 1. Fuzzy Inference Systems a) Ebrahim

Example: Step 2: Rule Evaluation

18

• 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.

Page 19: Fuzzy Inference Systems - WordPress.com...2019/02/04  · Slides for Fuzzy Sets, Ch. 4 of Neuro-Fuzzy and Soft Computing J.-S. Roger Jang Outline 1. Fuzzy Inference Systems a) Ebrahim

Example: Step 2: Rule Evaluation

19

Page 20: Fuzzy Inference Systems - WordPress.com...2019/02/04  · Slides for Fuzzy Sets, Ch. 4 of Neuro-Fuzzy and Soft Computing J.-S. Roger Jang Outline 1. Fuzzy Inference Systems a) Ebrahim

Example: Step 3: Aggregation of the Rule

Outputs

20

Page 21: Fuzzy Inference Systems - WordPress.com...2019/02/04  · Slides for Fuzzy Sets, Ch. 4 of Neuro-Fuzzy and Soft Computing J.-S. Roger Jang Outline 1. Fuzzy Inference Systems a) Ebrahim

Example: Step 4-Defuzzification

21

Page 22: Fuzzy Inference Systems - WordPress.com...2019/02/04  · Slides for Fuzzy Sets, Ch. 4 of Neuro-Fuzzy and Soft Computing J.-S. Roger Jang Outline 1. Fuzzy Inference Systems a) Ebrahim

Sugeno (TSK) Fuzzy Models

22

• Two-input, one-output example:

if x is A and y is B then z = f (x, y)

Antecedents are fuzzy, consequents are crisp.

• x and y are linguistic variables;

• A and B are fuzzy sets on universe of discourses X and Y, respectively;

• f (x, y) is a mathematical function.

• A First-order TSK model.

Page 23: Fuzzy Inference Systems - WordPress.com...2019/02/04  · Slides for Fuzzy Sets, Ch. 4 of Neuro-Fuzzy and Soft Computing J.-S. Roger Jang Outline 1. Fuzzy Inference Systems a) Ebrahim

Sugeno (TSK) Fuzzy Models

23

• Special case of singleton outputs:

IF x is A AND y is B THEN z is C

• C is constant.

• A zero-order TSK model

• Also a special case of a Mamdani model.

Page 24: Fuzzy Inference Systems - WordPress.com...2019/02/04  · Slides for Fuzzy Sets, Ch. 4 of Neuro-Fuzzy and Soft Computing J.-S. Roger Jang Outline 1. Fuzzy Inference Systems a) Ebrahim

Sugeno (TSK) Fuzzy Models

The output is a weighted average:

24

, ( , )

,

( , ,) ( )

)

( )

( ,

,

i k

i k

A B m i k

A B

i i

i

x y yz

f x

w

y

w yf x

x

where wi is the firing strength of the i-th output

Double summation over all i (x MFs) and all k (y MFs)

Summation over all i(fuzzy rules)

Page 25: Fuzzy Inference Systems - WordPress.com...2019/02/04  · Slides for Fuzzy Sets, Ch. 4 of Neuro-Fuzzy and Soft Computing J.-S. Roger Jang Outline 1. Fuzzy Inference Systems a) Ebrahim

Sugeno (TSK) Fuzzy Models

25

Page 26: Fuzzy Inference Systems - WordPress.com...2019/02/04  · Slides for Fuzzy Sets, Ch. 4 of Neuro-Fuzzy and Soft Computing J.-S. Roger Jang Outline 1. Fuzzy Inference Systems a) Ebrahim

Example

• If x is small then y = 0.1x + 6.4

• If x is medium then y = –0.5x + 5

• If x is large then y = x – 226

-10 0 100

0.5

1

X

Me

mb

ers

hip

Gra

de

s

small medium large

(a) Crisp Antecedent MFs

-10 0 100

2

4

6

8

X

Y

(b) Crisp I/O Curve

-10 0 100

0.5

1

X

Me

mb

ers

hip

Gra

de

ssmall medium large

(c) Fuzzy Antecedent MFs

-10 0 100

2

4

6

8

X

Y

(d) Fuzzy I/O Curve

Page 27: Fuzzy Inference Systems - WordPress.com...2019/02/04  · Slides for Fuzzy Sets, Ch. 4 of Neuro-Fuzzy and Soft Computing J.-S. Roger Jang Outline 1. Fuzzy Inference Systems a) Ebrahim

Example

• If x is small and y is small then z = –x + y + 1

• If x is small and y is large then z = –y + 5

• If x is large and y is small then z = –x + 3

• If x is large and y is large then z = x + y + 2

27

-5 0 50

0.5

1

XM

em

be

rsh

ip G

rad

es

Small Large

-5 0 50

0.5

1

Y

Me

mb

ers

hip

Gra

de

s

Small Large

-5

0

5

-5

0

5

0

5

10

XY

Z

Page 28: Fuzzy Inference Systems - WordPress.com...2019/02/04  · Slides for Fuzzy Sets, Ch. 4 of Neuro-Fuzzy and Soft Computing J.-S. Roger Jang Outline 1. Fuzzy Inference Systems a) Ebrahim

Tsukamoto Fuzzy Models

• Special type of Mamdani model

• Output MFs are open

• Crisp output is weighted average of fuzzy outputs

28

Page 29: Fuzzy Inference Systems - WordPress.com...2019/02/04  · Slides for Fuzzy Sets, Ch. 4 of Neuro-Fuzzy and Soft Computing J.-S. Roger Jang Outline 1. Fuzzy Inference Systems a) Ebrahim

29

Tsukamoto Fuzzy Models

Page 30: Fuzzy Inference Systems - WordPress.com...2019/02/04  · Slides for Fuzzy Sets, Ch. 4 of Neuro-Fuzzy and Soft Computing J.-S. Roger Jang Outline 1. Fuzzy Inference Systems a) Ebrahim

Fuzzy Modeling

• Fuzzy modeling consists of constructing a fuzzy inference system. This can be done using:

• Domain (expert) knowledge

• Numerical training data

30

Page 31: Fuzzy Inference Systems - WordPress.com...2019/02/04  · Slides for Fuzzy Sets, Ch. 4 of Neuro-Fuzzy and Soft Computing J.-S. Roger Jang Outline 1. Fuzzy Inference Systems a) Ebrahim

Fuzzy Modeling

Fuzzy modeling includes two stages:

• Surface structure identification• Specify input and output variables

• Specify the type of fuzzy inference system

• Specify the number of MFs for inputs and outputs

• Specify the fuzzy if-then rules

• Deep structure identification• Specify the type of MFs

• Specify the MF parameters using human expertise and numerical optimization

31

Page 32: Fuzzy Inference Systems - WordPress.com...2019/02/04  · Slides for Fuzzy Sets, Ch. 4 of Neuro-Fuzzy and Soft Computing J.-S. Roger Jang Outline 1. Fuzzy Inference Systems a) Ebrahim

Thank You

32