+ All Categories
Home > Documents > Fuzzy Sets and Fuzzy Logic - liacs.leidenuniv.nlliacs.leidenuniv.nl/~nijssensgr/CI/2013/8...

Fuzzy Sets and Fuzzy Logic - liacs.leidenuniv.nlliacs.leidenuniv.nl/~nijssensgr/CI/2013/8...

Date post: 15-Oct-2019
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
35
Fuzzy Sets and Fuzzy Logic
Transcript
Page 1: Fuzzy Sets and Fuzzy Logic - liacs.leidenuniv.nlliacs.leidenuniv.nl/~nijssensgr/CI/2013/8 fuzzy.pdf · N u m b e r o f C h ild r e n M e m b e r s h i p G r a d e s. Fuzzy sets &

Fuzzy Sets and Fuzzy Logic

Page 2: Fuzzy Sets and Fuzzy Logic - liacs.leidenuniv.nlliacs.leidenuniv.nl/~nijssensgr/CI/2013/8 fuzzy.pdf · N u m b e r o f C h ild r e n M e m b e r s h i p G r a d e s. Fuzzy sets &

Application

Page 3: Fuzzy Sets and Fuzzy Logic - liacs.leidenuniv.nlliacs.leidenuniv.nl/~nijssensgr/CI/2013/8 fuzzy.pdf · N u m b e r o f C h ild r e n M e m b e r s h i p G r a d e s. Fuzzy sets &

Application(From a press release)

Equens to offer RiskShield Fraud Protection for Card Payments

Today Equens, one of the largest pan-European card and payment Processors, announced that it has selected RiskShield from INFORM GmbH as the basis for a new approach to fraud detection and behaviour monitoring. By utilising the flexibility offered by RiskShield, Equens will be able to offer tailor-made fraud management services to issuers and acquirers.

UTRECHT, The Netherlands, 30/10/2012

Page 4: Fuzzy Sets and Fuzzy Logic - liacs.leidenuniv.nlliacs.leidenuniv.nl/~nijssensgr/CI/2013/8 fuzzy.pdf · N u m b e r o f C h ild r e n M e m b e r s h i p G r a d e s. Fuzzy sets &

ApplicationFrom the

brochureof “RiskShield”

Page 5: Fuzzy Sets and Fuzzy Logic - liacs.leidenuniv.nlliacs.leidenuniv.nl/~nijssensgr/CI/2013/8 fuzzy.pdf · N u m b e r o f C h ild r e n M e m b e r s h i p G r a d e s. Fuzzy sets &

Application

Page 6: Fuzzy Sets and Fuzzy Logic - liacs.leidenuniv.nlliacs.leidenuniv.nl/~nijssensgr/CI/2013/8 fuzzy.pdf · N u m b e r o f C h ild r e n M e m b e r s h i p G r a d e s. Fuzzy sets &

Fuzzy sets on discrete universesFuzzy set C = “desirable city to live in”

X = {SF, Boston, LA} (discrete and non-ordered)C = {(SF, 0.9), (Boston, 0.8), (LA, 0.6)}

Fuzzy set A = “sensible number of children”X = {0, 1, 2, 3, 4, 5, 6} (discrete universe)A = {(0, .1), (1, .3), (2, .7), (3, 1), (4, .6), (5, .2), (6, .1)}

N u m b e r o f C h i l d r e n

Mem

bers

hip

Gra

des

Page 7: Fuzzy Sets and Fuzzy Logic - liacs.leidenuniv.nlliacs.leidenuniv.nl/~nijssensgr/CI/2013/8 fuzzy.pdf · N u m b e r o f C h ild r e n M e m b e r s h i p G r a d e s. Fuzzy sets &

Fuzzy sets & fuzzy logicFuzzy sets can be used to define a level of truth of

factsFuzzy set C = “desirable city to live in”

X = {SF, Boston, LA} (discrete and non-ordered)C = {(SF, 0.9), (Boston, 0.8), (LA, 0.6)}

corresponds to a fuzzy interpretation in which C(SF) is true with degree 0.9C(Boston) is true with degree 0.8C(LA) is true with degree 0.6

membership function can be seen as a →(fuzzy) predicate.

Page 8: Fuzzy Sets and Fuzzy Logic - liacs.leidenuniv.nlliacs.leidenuniv.nl/~nijssensgr/CI/2013/8 fuzzy.pdf · N u m b e r o f C h ild r e n M e m b e r s h i p G r a d e s. Fuzzy sets &

Fuzzy logic formulasMembership functions:

B=”City is beautiful”C=”City is clean”

Formulas:

What is the truth value of such formulas for given x?

We need to define a meaning for the connectives

Page 9: Fuzzy Sets and Fuzzy Logic - liacs.leidenuniv.nlliacs.leidenuniv.nl/~nijssensgr/CI/2013/8 fuzzy.pdf · N u m b e r o f C h ild r e n M e m b e r s h i p G r a d e s. Fuzzy sets &

Fuzzy logic formulasStandard interpretations of connectives in fuzzy logic:

Negation:

Conjunction:

Disjunction:

Page 10: Fuzzy Sets and Fuzzy Logic - liacs.leidenuniv.nlliacs.leidenuniv.nl/~nijssensgr/CI/2013/8 fuzzy.pdf · N u m b e r o f C h ild r e n M e m b e r s h i p G r a d e s. Fuzzy sets &

• General requirements:

– Boundary: N(0)=1 and N(1) = 0

– Monotonicity: N(a) > N(b) if a < b

– Involution: N(N(a)) = a• Two types of fuzzy complements:

– Sugeno’s complement:

– Yager’s complement:

N aa

sas( ) = −+

1

1

N a aww w( ) ( ) /= −1 1

Page 11: Fuzzy Sets and Fuzzy Logic - liacs.leidenuniv.nlliacs.leidenuniv.nl/~nijssensgr/CI/2013/8 fuzzy.pdf · N u m b e r o f C h ild r e n M e m b e r s h i p G r a d e s. Fuzzy sets &

N aa

sas( ) = −+

1

1N a aw

w w( ) ( ) /= −1 1

Sugeno’s complement: Yager’s complement:

0 0.5 10

0.2

0.4

0.6

0.8

1(a) Sugeno's Complements

a

N(a

)

s = 20

s = 2

s = 0

s = -0.7

s = -0.95

0 0.5 10

0.2

0.4

0.6

0.8

1(b) Yager's Complements

a

N(a

)w = 0.4

w = 0.7

w = 1

w = 1.5

w = 3

Page 12: Fuzzy Sets and Fuzzy Logic - liacs.leidenuniv.nlliacs.leidenuniv.nl/~nijssensgr/CI/2013/8 fuzzy.pdf · N u m b e r o f C h ild r e n M e m b e r s h i p G r a d e s. Fuzzy sets &

• Basic requirements:

– Boundary: T(0, a) = T(a,0) = 0, T(a, 1) = T(1, a) = a

– Monotonicity: T(a, b) <= T(c, d) if a <= c and b <= d

– Commutativity: T(a, b) = T(b, a)

– Associativity: T(a, T(b, c)) = T(T(a, b), c)

Generalized intersection (Triangular/T-norm, logical and)

Page 13: Fuzzy Sets and Fuzzy Logic - liacs.leidenuniv.nlliacs.leidenuniv.nl/~nijssensgr/CI/2013/8 fuzzy.pdf · N u m b e r o f C h ild r e n M e m b e r s h i p G r a d e s. Fuzzy sets &

• Examples:

– Minimum:

– Algebraic product:

– Bounded product:

– Drastic product:

T ( a , b)=min(a , b)

T (a , b )=a⋅b

T (a , b )=max (0,( a+ b−1 ))

Generalized intersection(Triangular/T-norm)

T (a , b )={a if b=1b if a=10 otherwise ]

Page 14: Fuzzy Sets and Fuzzy Logic - liacs.leidenuniv.nlliacs.leidenuniv.nl/~nijssensgr/CI/2013/8 fuzzy.pdf · N u m b e r o f C h ild r e n M e m b e r s h i p G r a d e s. Fuzzy sets &

0 0.5 10

0.5

10

0.5

1

X = a

(c) Bounded Product

Y = b

0 10 200

10

200

0.5

1

X = xY = y

0 0.5 10

0.5

10

0.5

1

X = a

(d) Drastic Product

Y = b

0 10 200

10

200

0.5

1

X = xY = y

Minimum:Tm(a, b)

Algebraicproduct:Ta(a, b)

Boundedproduct:Tb(a, b)

Drasticproduct:Td(a, b)

≥ ≥≥

0 0.5 10

0.5

10

0.5

1

a

(a) Min

b

0 10 200

10

200

0.5

1

X = xY = y

0 0.5 10

0.5

10

0.5

1

X = a

(b) Algebraic Product

Y = b

0 10 200

10

200

0.5

1

X = xY = y

Page 15: Fuzzy Sets and Fuzzy Logic - liacs.leidenuniv.nlliacs.leidenuniv.nl/~nijssensgr/CI/2013/8 fuzzy.pdf · N u m b e r o f C h ild r e n M e m b e r s h i p G r a d e s. Fuzzy sets &

• Basic requirements:

– Boundary: S(1, a) = 1, S(a, 0) = S(0, a) = a– Monotonicity: S(a, b) < S(c, d) if a < c and b < d

– Commutativity: S(a, b) = S(b, a)– Associativity: S(a, S(b, c)) = S(S(a, b), c)

• Examples:

– Maximum:

– Algebraic sum:

– Bounded sum:

– Drastic sum

S ( a ,b )=max(a ,b)

bababaS ⋅−+=),(

S ( a ,b )=min(1,( a+b ))

Page 16: Fuzzy Sets and Fuzzy Logic - liacs.leidenuniv.nlliacs.leidenuniv.nl/~nijssensgr/CI/2013/8 fuzzy.pdf · N u m b e r o f C h ild r e n M e m b e r s h i p G r a d e s. Fuzzy sets &

Maximum:Sm(a, b)

Algebraicsum:

Sa(a, b)

Boundedsum:

Sb(a, b)

Drasticsum:

Sd(a, b)≤ ≤≤

0 0.5 10

0.5

10

0.5

1

X = a

(c) Bounded Sum

Y = b

0 10 200

10

200

0.5

1

X = xY = y

0 0.5 10

0.5

10

0.5

1

X = a

(d) Drastic Sum

Y = b

0 10 200

10

200

0.5

1

X = xY = y

0 0.5 10

0.5

10

0.5

1

X = a

(a) Max

Y = b

0 10 200

10

200

0.5

1

X = xY = y

0 0.5 10

0.5

10

0.5

1

X = a

(b) Algebraic Sum

Y = b

0 10 200

10

200

0.5

1

X = xY = y

Page 17: Fuzzy Sets and Fuzzy Logic - liacs.leidenuniv.nlliacs.leidenuniv.nl/~nijssensgr/CI/2013/8 fuzzy.pdf · N u m b e r o f C h ild r e n M e m b e r s h i p G r a d e s. Fuzzy sets &

Generalized De Morgan’s LawT-norms and T-conorms are duals which support the

generalization of DeMorgan’s law:T(a, b) = N(S(N(a), N(b)))S(a, b) = N(T(N(a), N(b)))

Tm(a, b)Ta(a, b)Tb(a, b)Td(a, b)

Sm(a, b)Sa(a, b)Sb(a, b)Sd(a, b)

Page 18: Fuzzy Sets and Fuzzy Logic - liacs.leidenuniv.nlliacs.leidenuniv.nl/~nijssensgr/CI/2013/8 fuzzy.pdf · N u m b e r o f C h ild r e n M e m b e r s h i p G r a d e s. Fuzzy sets &

Fuzzy if-then rulesGeneral format:

If x is A then y is BExamples:

If pressure is high, then volume is smallIf a restaurant is expensive, then order small dishesIf a tomato is red, then it is ripeIf the speed is high, then apply the brake a little

Page 19: Fuzzy Sets and Fuzzy Logic - liacs.leidenuniv.nlliacs.leidenuniv.nl/~nijssensgr/CI/2013/8 fuzzy.pdf · N u m b e r o f C h ild r e n M e m b e r s h i p G r a d e s. Fuzzy sets &

A coupled with B

AA

B B

A entails By

xx

y

Implication in traditional logicCommon in Fuzzy logic

Interpretation of Implication

Page 20: Fuzzy Sets and Fuzzy Logic - liacs.leidenuniv.nlliacs.leidenuniv.nl/~nijssensgr/CI/2013/8 fuzzy.pdf · N u m b e r o f C h ild r e n M e m b e r s h i p G r a d e s. Fuzzy sets &

Use the T-norm...

0 0.5 10

0.5

10

0.5

1

a

(a) Min

b

0 10 200

10

200

0.5

1

xy

0 0.5 10

0.5

10

0.5

1

a

(b) Algebraic Product

b

0 10 200

10

200

0.5

1

xy

0 0.5 10

0.5

10

0.5

1

a

(c) Bounded Product

b

0 10 200

10

200

0.5

1

xy

0 0.5 10

0.5

10

0.5

1

a

(d) Drastic Product

b

0 10 200

10

200

0.5

1

xy

Page 21: Fuzzy Sets and Fuzzy Logic - liacs.leidenuniv.nlliacs.leidenuniv.nl/~nijssensgr/CI/2013/8 fuzzy.pdf · N u m b e r o f C h ild r e n M e m b e r s h i p G r a d e s. Fuzzy sets &

A entails BBoolean fuzzy implication (based on )

Zadeh's max-min implication (based on )

Zadeh's arithmetic implication (based on )

Goguen's implication

mR( x , y )=max (1−mA( x ) ,mB( y ))

¬A∨B

¬A∨( A∧B)

mR( x , y )=max (1−mA( x ) ,min (mA( x ) ,mB( y )))

¬A∨BmR( x , y )=min (1−mA( x )+ mB( y ) ,1)

mR( x , y )=min (mB( x )/mA( y ) ,1)

Page 22: Fuzzy Sets and Fuzzy Logic - liacs.leidenuniv.nlliacs.leidenuniv.nl/~nijssensgr/CI/2013/8 fuzzy.pdf · N u m b e r o f C h ild r e n M e m b e r s h i p G r a d e s. Fuzzy sets &

0 0.5 10

0.5

10

0.5

1

a

(a) Zadeh's Arithmetic Rule

b

0 10 200

10

200

0.5

1

xy

0 0.5 10

0.5

10

0.5

1

a

(b) Zadeh's Max-Min Rule

b

0 10 200

10

200

0.5

1

xy

0 0.5 10

0.5

10

0.5

1

a

(c) Boolean Fuzzy Implication

b

0 10 200

10

200

0.5

1

xy

0 0.5 10

0.5

10

0.5

1

a

(d) Goguen's Fuzzy Implication

b

0 10 200

10

200

0.5

1

xy

Page 23: Fuzzy Sets and Fuzzy Logic - liacs.leidenuniv.nlliacs.leidenuniv.nl/~nijssensgr/CI/2013/8 fuzzy.pdf · N u m b e r o f C h ild r e n M e m b e r s h i p G r a d e s. Fuzzy sets &

Fuzzy inference systemsGiven a number of fuzzy rules:

if temperature is low, then set heating highif air is dry, then set heating low

If we do the observationtemperature is 15c,air humidity 30%

how do we set the heating?

Discussed here: Mamdani systems

Page 24: Fuzzy Sets and Fuzzy Logic - liacs.leidenuniv.nlliacs.leidenuniv.nl/~nijssensgr/CI/2013/8 fuzzy.pdf · N u m b e r o f C h ild r e n M e m b e r s h i p G r a d e s. Fuzzy sets &

Building blocksFuzzifier (in the simplest case, turn a measurement into a

crisp set)Rule baseInference engineDefuzzifier

Fuzz

i fie

r

Def

uz z

ifie

rRule base(knowledge base)

Inference engine

input

outp

ut

Page 25: Fuzzy Sets and Fuzzy Logic - liacs.leidenuniv.nlliacs.leidenuniv.nl/~nijssensgr/CI/2013/8 fuzzy.pdf · N u m b e r o f C h ild r e n M e m b e r s h i p G r a d e s. Fuzzy sets &

Mamdani Systems:Illustration on case 1When given are

a fuzzy rule A B, where A and B are fuzzy sets defined →by membership functions and

a measurement a for AThe membership function for A B is defined by→

For a measurement a the membership for y is

Page 26: Fuzzy Sets and Fuzzy Logic - liacs.leidenuniv.nlliacs.leidenuniv.nl/~nijssensgr/CI/2013/8 fuzzy.pdf · N u m b e r o f C h ild r e n M e m b e r s h i p G r a d e s. Fuzzy sets &

Mamdani Systems:Illustration on case 2When rules contain multiple conditions, the min is

taken over these conditions

Page 27: Fuzzy Sets and Fuzzy Logic - liacs.leidenuniv.nlliacs.leidenuniv.nl/~nijssensgr/CI/2013/8 fuzzy.pdf · N u m b e r o f C h ild r e n M e m b e r s h i p G r a d e s. Fuzzy sets &

Mamdani Systems:Illustration on case 3

Page 28: Fuzzy Sets and Fuzzy Logic - liacs.leidenuniv.nlliacs.leidenuniv.nl/~nijssensgr/CI/2013/8 fuzzy.pdf · N u m b e r o f C h ild r e n M e m b e r s h i p G r a d e s. Fuzzy sets &

• Rule: if x is A then y is B• Observation: x is A’ (fuzzy set)• Conclusion: y is B’ (fuzzy set)

defined as follows:

Graphic Representation)(

)())]()(([)( ''

yw

yxxy

B

BAAxB

µµµµµ

∧=∧∧∨=

A

X

w

A’ B

Y

x is A’

B’

Y

A’

Xy is B’

Fuzzy observations

Page 29: Fuzzy Sets and Fuzzy Logic - liacs.leidenuniv.nlliacs.leidenuniv.nl/~nijssensgr/CI/2013/8 fuzzy.pdf · N u m b e r o f C h ild r e n M e m b e r s h i p G r a d e s. Fuzzy sets &

• Rule: if x is A and y is B then z is C• Fact: x is A’ and y is B’• Conclusion: z is C’Graphic Representation

A B T-norm

X Y

w

A’ B’ C2

Z

C’

ZX Y

A’ B’

x is A’ y is B’ z is C’

Page 30: Fuzzy Sets and Fuzzy Logic - liacs.leidenuniv.nlliacs.leidenuniv.nl/~nijssensgr/CI/2013/8 fuzzy.pdf · N u m b e r o f C h ild r e n M e m b e r s h i p G r a d e s. Fuzzy sets &

A1 B1

A2 B2

T-norm

X

X

Y

Y

w1

w2

A’

A’ B’

B’ C1

C2

Z

Z

C’Z

X Y

A’ B’

x is A’ y is B’ z is C’

Page 31: Fuzzy Sets and Fuzzy Logic - liacs.leidenuniv.nlliacs.leidenuniv.nl/~nijssensgr/CI/2013/8 fuzzy.pdf · N u m b e r o f C h ild r e n M e m b e r s h i p G r a d e s. Fuzzy sets &

Defuzzification rulesCentroid-of-area

Bisector of area

Mean of maximum

Smallest of maximum

Largest of maximum

∫∫=

Z A

Z A

dzz

dzzzz

)(

)(*

µ

µ

∫ ∫∞−∞

=*

*)()(

z

z AA dzzdzz µµ

*})(|{',*

'

' µµ ===∫∫

zzZdz

dzzz A

Z

Z

zZz '

min∈

zZz '

max∈

range of valueswheremembershipis maximal

Page 32: Fuzzy Sets and Fuzzy Logic - liacs.leidenuniv.nlliacs.leidenuniv.nl/~nijssensgr/CI/2013/8 fuzzy.pdf · N u m b e r o f C h ild r e n M e m b e r s h i p G r a d e s. Fuzzy sets &

Mamdani - single input

-10 -8 -6 -4 -2 0 2 4 6 8 100

0.2

0.4

0.6

0.8

1

1.2

X

Me

mb

ersh

ip G

rad

es small medium large

0 1 2 3 4 5 6 7 8 9 100

0.2

0.4

0.6

0.8

1

1.2

Y

Me

mb

ersh

ip G

rad

es small medium large

X is Small →Y is Small

X is Medium →Y is Medium

X is Large →Y is Large

Page 33: Fuzzy Sets and Fuzzy Logic - liacs.leidenuniv.nlliacs.leidenuniv.nl/~nijssensgr/CI/2013/8 fuzzy.pdf · N u m b e r o f C h ild r e n M e m b e r s h i p G r a d e s. Fuzzy sets &

Mamdani - single input

-10 -8 -6 -4 -2 0 2 4 6 8 100

1

2

3

4

5

6

7

8

9

10

X

Y

-10 -8 -6 -4 -2 0 2 4 6 8 100

0.2

0.4

0.6

0.8

1

1.2

X

Mem

bers

hip G

r ades

small medium large

0 1 2 3 4 5 6 7 8 9 100

0.2

0.4

0.6

0.8

1

1.2

Y

Mem

bers

hip G

r ades

small medium large

Page 34: Fuzzy Sets and Fuzzy Logic - liacs.leidenuniv.nlliacs.leidenuniv.nl/~nijssensgr/CI/2013/8 fuzzy.pdf · N u m b e r o f C h ild r e n M e m b e r s h i p G r a d e s. Fuzzy sets &

Mamdani - double input

-5 -4 -3 -2 -1 0 1 2 3 4 50

0.5

1

X

Mem

bers

hip

Gra

des

small large

-5 -4 -3 -2 -1 0 1 2 3 4 50

0.5

1

Y

Mem

bers

hip

Gra

des

small large

-5 -4 -3 -2 -1 0 1 2 3 4 50

0.5

1

Z

Mem

bers

hip

Gra

des

large negative small negative small positive large positive

X is Small and Y is Small Z is →negative Large

X is Small and Y is Large Z is →negative Small

X is Large and Y is Small Z is →positive Small

if X is Large and Y is Large Z →is positive Large

Page 35: Fuzzy Sets and Fuzzy Logic - liacs.leidenuniv.nlliacs.leidenuniv.nl/~nijssensgr/CI/2013/8 fuzzy.pdf · N u m b e r o f C h ild r e n M e m b e r s h i p G r a d e s. Fuzzy sets &

Mamdani - double input

-5 -4 -3 -2 -1 0 1 2 3 4 50

0.5

1

X

Mem

bers

hip

Gra

des

small large

-5 -4 -3 -2 -1 0 1 2 3 4 50

0.5

1

Y

Mem

bers

hip

Gra

des

small large

-5 -4 -3 -2 -1 0 1 2 3 4 50

0.5

1

Z

Mem

bers

hip

Gra

des

large negative small negative small positive large positive

-5

0

5

-5

0

5

-3

-2

-1

0

1

2

3

XY

Z


Recommended