Fuzzy Rule-Based Models
Fuzzy Rule-Based Models
Models
Contents
11.1 Fuzzy rules as a vehicle of knowledge representation
11.2 General categories of fuzzy rules and their semantics
11.3 Syntax of fuzzy rules
11.4 Basic functional modules
11.5 Types of rule-based systems and architectures
11.6 Approximation properties of fuzzy rule-based models
11.7 Development of rule-based systems
Certainty-qualified rules
[0,1]
: degree of certainty of the rule
= 1 rule is certain
Gradual rules
the more X is A the more Y is B
relationships between changes in X and Y
captures tendency between information granules
Examples:
the higher the income, the higher the taxes
the lower the temperature, the higher energy consumption
Rule
Base
Parameters
of the FRBS
Data
Base
Fuzzy
Inference
Output Interface
Input Interface
Input interface
(attribute) of (input) is (value)
the temperature of the motor is high
Canonical (atomic) form
p: X is A
Low
Medium
High
x (C)
P( x1 , x2 ,K , xn ) = A1 ( x1 )tA2 ( x2 )t KtAn ( xn ) = T Ai ( xi )
i =1
t (T) = t-norm
Example
Fuzzy relation associated with (X,Y) is P
Triangular fuzzy sets A1(x,4,5,6) = A, A2(y,8,10,12) = B
t-norm: algebraic product
(b) Contours of P
y
20
P
10
0
0
10
Q( x1 , x2 ,K , xn ) = A1 ( x1 ) sA2 ( x2 ) s K sAn ( xn ) = S Ai ( xi )
i =1
s (S) = t-conorm
Example
Fuzzy relation associated with (X,Y) is Q
Triangular fuzzy sets A1(x,4,5,6) = A, A2(y,8,10,12) = B
t-conorm: probabilistic sum
(d) Contours of Q
20
10
0
0
10
Rule base
Fuzzy rule: If X is A then Y is B relationship between X and Y
Semantics of the rule is given by a fuzzy relation R on XY
R determined by a relational assignment
R(x,y) = f (A(x),B(y)) (x, y)XY
f : [0,1]2 [0,1]
In general f can be
fuzzy conjunction: ft
fuzzy disjunction: fs
fuzzy implication: fi
Pedrycz and Gomide, FSE 2007
Fuzzy conjunction
Choose a t-norm t and define:
R(x,y) ft (x,y) = A(x) t B(y) (x,y) XY
Examples:
t = min
Rc(x,y) fc (x,y) = min[A(x) t B(y)]
(Mamdani)
t = algebraic product
Rp(x,y) fp (x,y) = A(x)B(y)
(Larsen)
Example: t = min
Rp(x,y) =A(x)B(y)
(A(x), B(y))[0,1]2
Rp(x,y) = A(x)B(y)
A(x) = A(x,4,5,6)
B(y) = B(y,4,5,6)
Fuzzy disjunction
Choose a t-conorm s and define:
Rs(x,y) fs (x,y) = A(x) s B(y) (x,y) XY
Examples:
s = max
Rm(x,y) fm (x,y) = max[A(x) t B(y)]
s = Lukasiewicz t-conorm
Rl (x,y) fl (x,y) = min[1, A(x) + B(y)]
Example: s = max
Example: s = Lukasiewicz
Fuzzy implication
Choose a fuzzy implication fi and define:
Ri(x,y) fi (x,y) (x,y) XY
2. fi (0, B(y)) = 1
dominance of falsity
neutrality of truth
exchange
6. fi (A(x), A(x)) = 1
identity
boundary condition
8. fi is a continuous function
continuity
Definition
Comment
Pseudo-Lukasiewicz
1 A( x) + ( + 1) B( y )
f ( A( x) , B( y )) = min 1,
1 + A( x)
> -1
Pseudo-Lukasiewicz
f w ( A( x ) , B ( y )) = min [1, (1 A( x ) w + B ( y ) w )1 / w ]
w> 0
Gaines
Gdel
Goguen
1 if A( x) B( y )
f a ( A( x) , B( y )) =
otherwise
0
if A( x) B( y )
1
f g ( A( x) , B ( y )) =
otherwise
B( y)
if A( x) B ( y )
1
B( y )
f e ( A( x) , B( y )) =
otherwise
A( x)
Kleene
f b ( A( x) , B( y )) = max [1 A( x) , B ( y )]
Reichenbach
f r ( A( x) , B( y )) = 1 A( x) + A( x) B( y )]
Zadeh
Klir-Yuan
Example: fl = Lukasiewicz
Example: fk = KlirYuan
Rk (x,y) = 1 A(x)+A(x)2B(y)
(A(x), B(y))[0,1]2
Rk (x,y) = 1 A(x)+A(x)2B(y)
A(x) = A(x,4,5,6)
B(y) = B(y,4,5,6)
( x , y ) X Y
fb ( A( x), B ( y )) = max[1 A( x) , B ( y )]
Kleene
2. r-implications
fir ( A( x), B ( y )) = sup[c [0 ,1] | A( x) t c B( y )]
( x , y ) X Y
t = min
if A( x) B ( y )
1
f g ( A( x), B ( y )) =
B( y ) A( x) > B( y )
Gdel
Pedrycz and Gomide, FSE 2007
B(y)
1.0
1.0
A(x)
BRd
x
Example: Rd = fa = Gaines
1 if B ( y ) A( x)
Rd ( x, y ) =
0 otherwise
(a) Gradual rule Rd = fa
1
0.8
0.6
0.4
0.2
0
1
B(y)
0.8 A(x)
0.5
0.6
0.4
0.2
0
Rd(x,y)
(A(x), B(y))[0,1]2
Rd (x,y)
A(x) = A(x,3,5,7)
B(y) = B(y,3,5,7)
Pedrycz and Gomide, FSE 2007
Fuzzy graph
Fuzzy rule base R collection of rules R1, R2,....,RN
Each fuzzy rule Ri is a fuzzy granule (point)
Fuzzy graph R is a collection of fuzzy granules
granular approximation of a function
N
i =1
i =1
R = U Ri = U ( Ai Bi )
R = R1 or R2 or....or RN
general form
N
R( x, y ) = S [ Ai ( x)tBi ( y )]
i=1
Point
(a)
(b)
10
10
y
4
P
4
B(y)
8 x 10
(c)
1
A(x)
Point P in XY
P = AB
A is a singleton in X
B is a singleton in Y
0
0
8 x 10
Granule
(a)
(b)
10
10
6
4
B(y)
8 x 10
8 x 10
(c)
1
A
A(x)
Granule G in XY
G = AB
A is an interval in X
B is an interval in Y
0
0
(a)
10
10
B(y)
10
(c)
1
fuzzy granule R in XY
R = AB
A is a fuzzy set on X
B is a fuzzy set on Y
A(x)
0
0
8 x 10
10
10
R1
8
B1
R2
7
B2
R3
6
B3
R4
5
B4
4
R5
4
B5
3
2
2
1
0
1
B(y)
0
0
x 10
(c)
A1
A2
A3
A4
A5
Ri = AiBi
0
0
10
12
12
11
10
10
Ri = AiBi
R1
9
R2
R3
R4
5
f
4
R5 R6
R7
R8
2
1
0
0
10
12
10
11 x 12
9
8
7
R = Union Ri
6
5
4
3
2
1
0
0
9 x
10
y
9
8
7
R = Union Ri
6
5
4
3
2
1
0
0
9 x
10
Fuzzy implication
Fuzzy rule base R collection of rules R1, R2,....,RN
Each fuzzy rule Ri is a fuzzy implication
Fuzzy rule base R is a collection of fuzzy relations
relation R is obtained using intersection
N
i =1
i =1
i =1
R = I Ri = I fi = I ( Ai Bi )
R = R1 and R2 and....and RN
general form
N
R = T fi ( Ai ( x) , Bi ( y ))
i=1
10
10
6
4
B(y)
8 x 10
8 x 10
(c)
1
fuzzy rule R in XY
R = fl (A,B)
Lukasiewicz implication
A
A(x)
0
0
6
5
4
3
2
1
0
0
10
min t-norm
Pedrycz and Gomide, FSE 2007
6
5
4
3
2
1
0
0
10
Lukasiewicz implication
10
9
8
7
6
5
4
3
2
1
0
0
9 x 10
Zadeh implication
min t-norm
Pedrycz and Gomide, FSE 2007
10
9
8
7
6
5
4
3
2
1
0
0
9 x
10
Zadeh implication
Lukasiewicz t-norm
Pedrycz and Gomide, FSE 2007
Data base
Data base contains definitions of:
universes
scaling functions of input and output variables
granulation of the universes membership functions
Granulation
granular constructs in the form of fuzzy points
granules along different regions of the universes
Construction of membership functions
expert knowledge
learning from data
Granulation
granular constructs in
the form of fuzzy points
Fuzzy inference
Basic idea of inference
(a)
12
x=a
y = f (x)
y=b
ac
10
b = ProjY (ac f )
0
0
10
12
b = ProjY ( I )
(b)
12
x=A
y = f (x)
B = f (A) ={f (x), xA}
10
Ac
B = ProjY (Ac f )
A
0
0
10
12
B = ProjY ( I )
(a)
12
x is A
(x,y) is R
y is B
10
Ac
B
I
B = ProjY (Ac R )
A
0
0
10
12
B = ProjY ( I )
12
Ac
10
X is A
(fuzzy set on X)
(X,Y) is R (fuzzy relation on XY)
Y is B
(fuzzy set on Y)
B
I
f
2
A
2
10
12
B = ProjY (Ac R )
B = ProjY ( I )
B ( y ) = sup { A( x )tR ( x , y )}
xX
Fuzzy inference
Compositional rule of inference
X is A
(X,Y) is R
Y is B
B = Ao R
X is A
(X,Y) is R
Y is AoR
X is A and Y is B
input
R1:
rule base
RN:
If X is A1 and Y is B1 then Z is C1
......................
If X is Ai and Y is Bi then Z is Ci
.......................
If X is AN and Y is BN then Z is CN
Z:
Z is C
output
Ri:
X is A and Y is B
i = 1,..., N
Using the compositional rule of inference (t = min)
N
C = P o R = P o U Ri
i =1
i =1
i =1
i =1
C = P o R = P o U Ri = U ( P o Ri ) = U Ci
Ci = P o Ri
Ci ( z ) = sup{min[ P ( x , y ), Ri ( x , y , z )]} = sup{ A( x) B ( y ) Ai ( x) Bi ( y ) Ci ( z )]}
x ,y
x ,y
sup[ B ( y ) Bi ( y )] = Poss( B , Bi ) = ni
y
Ci ( z ) = mi ni Ci ( z )
C ( z ) = max{( mi ni )Ci ,i = 1,K , N } = max{i Ci ( z ), i = 1,K , N }
i is the degree of activation of i th rule
1
mj
Ai Aj A
Bi
B Bj
mi
y
Cj
Cj
nj
nj
ni
mi
Ci
Ci
z
C1
Ai,Bi
(A,B)
Poss
C1
Ci
AN,BN
Poss
Min
C
Min
Ci
Max
CN
Min
CN
1 if y = yo
and B ( y ) =
0 otherwise
Numeric output
zC ( z )dz
z= Z
Z C ( z )dz
centroid defuzzification
(mi ni )vi
z = i =1
(mi ni )
i =1
Example
(xo, yo), xo, yo [-2, 2]
inputs
P:
X is xo and Y is yo
R1:
If X is A1 and Y is B1 then Z is C1
rules
R2:
If X is A2 and Y is B2 then Z is C2
N = 2,
centroid defuzzification
(a) Input and output fuzzy sets
A1
Ai(x)
A2
0.5
-1.5
Bi(y)
-0.5
0.5
B2
1.5
B2
-0.5
0.5
0
-2
-1.5
-1
-0.5
0.5
C1
Ci(z)
-1
0.5
0
-2
1.5
-2
y
-1
C2
0.5
1
0
-2
-1
-2
-1.5
-1
-0.5
0.5
1.5
1
2
X is A and Y is B
i = 1,..., N
Using the compositional rule of inference (t = min)
Ci ( z ) = sup[ A( x ) B ( y ) Ai ( x) Bi ( y ) Ci ( z )]
x ,y
C ( z) =
wiCi
i =1
1
mj
Ai Aj A
Bi
B Bj
mi
y
Cj
Ci
nj
nj
ni
mi
Ci
Ci
Cj
z
C1
Ai,Bi
(A,B)
Poss
C1
w1
Ci
AN,BN
Poss
Min
Min
CN
Min
wi
Ci
wN
CN
Example
(xo, yo), xo, yo [-2, 2]
inputs
P:
X is xo and Y is yo
R1:
If X is A1 and Y is B1 then Z is C1
rules
R2:
If X is A2 and Y is B2 then Z is C2
N=2
w1 = w2 = 1, centroid defuzzification
(a) Input and output fuzzy sets
A1
Ai(x)
A2
0.5
-1.5
-1
-0.5
0.5
1.5
0.5
0
-2
B2
Bi(y)
-0.5
0.5
0
-2
-1.5
-1
-0.5
0.5
C1
Ci(z)
B2
1.5
-2
y
-1
C2
0
0.5
1
0
-2
-1
-2
0
-1.5
-1
-0.5
0.5
1.5
1
2
Ci ( z ) = mi ni Ci ( z )
0
-0.5
N
C ( z ) = S p Ci ( z )
i =1
-2
y
-1
0
1
-1
-2
-1
-2
0
2
2- Productsum
0.5
Ci ( z ) = mi ni Ci ( z )
1
2
0
-0.5
C ( z ) = Ci ( z )
i =1
-2
y
-1
0
1
0
2
1
2
C ( z ) = Ci ( z )
i =1
1
0.5
0
-0.5
a b = max{0 , a + b 1}
-1
-2
a b = min{1, a + b}
-1
0
a,b [0 ,1]
-1
-2
0
2
1
2
X is x and Y is y
input
R1:
rule base
degree of activation
Ri:
RN:
z = wi ( x , y ) fi ( x , y ) ,
i =1
wi =
i
N
i ( x , y )
output
i =1
A1,B1
w1
f2(x,y)
Ai,Bi
(x,y)
wi
fN(x,y)
AN,BN
wN
Example 1
x [0, 3]
inputs
P:
X is x
R1:
If X is A1 then z = x
rules
R2:
If X is A2 then z = x + 3
1.2
A1
A2
Ai
2.5
0.8
0.6
1.5
0.4
0.2
0.5
f2
f1
0
0
0.5
1.5
2.5
0.5
1.5
2.5
if x (0 ,1]
x
z = A1 ( x) x + A2 ( x)( x + 3) if x [1,2]
x + 3
if x [2 ,3)
2
1.8
1.6
1.4
1.2
output
1
0.8
0.6
0.4
0.2
0
0
0.5
1.5
2.5
Example 2
x [0, 3]
inputs
P:
X is x
R1:
If X is A1 then y = sin(2x)
R2:
If X is A2 then y = 0.5x
R3:
If X is A3 then y = sin(3x)
rules
output
(a) Antecedent fuzzy sets
1.2
1.5
A2
A1
A3
0.8
0.5
0.6
0.4
-0.5
0.2
-1
0
-5
-4
-3
-2
-1
4 x
-1.5
-5
-4
-3
-2
-1
4 x
Example 2
x [0, 3]
inputs
P:
X is x
R1:
If X is A1 then y = 1
R2:
If X is A2 then y = x
R3:
If X is A3 then y = 1
rules
output
(a) Antecedent fuzzy sets
1.2
1.5
A2
A1
A3
0.8
0.5
0.6
0.4
-0.5
0.2
-1
0
-5
-4
-3
-2
-1
4 x
-1.5
-5
-4
-3
-2
-1
i =1
i =1
C = I (Ci ) i = I Ci
C1
Ai
x
Poss
C1
Ci
AN
Poss
C1
C
C1
Ci
Min
CN
C1
CN
A1
A2
C1 C2
2
x
C1
C2
z
Example
inputs
P:
X is x
R1:
x [0, 3]
rules
R2:
A1
A2
Ai
0.8
3.5
0.6
0.4
0.2
0
1
1.5
2.5
3.5
2.5
C1
C2
2
Ci
0.8
0.6
1.5
0.4
0.2
0
1
1.5
2.5
3.5
1.5
2.5
3.5
(additive models)
Expert-based development
Knowledge provided by domain experts
basic concepts and variables
links between concepts and variables to form rules
Fuzzy
Controller
Process
t
Change of Error (de) / Error (e)
NM
NS
ZE
PS
PM
NB
PM
NB
NB
NB
NM
NM
PM
NB
NS
NM
NM
NS
PM
NS
NS
NM
PM
NS
NS
NM
PS
PM
PS
NS
NM
PM
PM
PM
PS
PM
NM
PB
PM
PM
PM
PM
NM
Pedrycz and Gomide, FSE 2007
Data-driven development
Given a finite set of input/output pairs
{(xk, yk), k = 1,..., M}
xk = [x1k, x2k,...., xnk] Rn
zk = [xk, yk] Rn+1, k = 1,..., M
Clustering zk = [xk, yk] Rn+1, k = 1,..., M (e.g. using FCM)
v1, v2,....,vN
prototypes/cluster centers
vi Rn+1, i = 1,..., N
Idea: fuzzy clusters fuzzy rules
Pedrycz and Gomide, FSE 2007
Example
R3
R2
v3
v2
R4
R1
v4
v1
wik fi (x k ,ai ) ,
i =1
wik =
i ( xk )
N
i ( xk )
i =1
Ta ,
z ik
i
i =1
T
z ik = [1, wik x T
k]
Let
a1
a
a= 2
M
a
N
yk = z1Tk
zT
2k
a1
a
T
L z Nk 2
M
a
N
and
y1
y
y= 2
M
y
M
then
zT
11
T
z12
Z =
M
z T
1M
T
z12
zT
22
M
zT
2M
z TN1
T
L zN2
O
M
L z TNM
L
y = Za
Min a J L (a) = y Zi ai 2
i =1
zT
i1
T
z
Zi = i 2
M
T
z iM
Solution
aiopt = Zi# y
Zi# = (ZiT)1ZiT
Pedrycz and Gomide, FSE 2007
consistency
completeness
accuracy
data
rules
Completeness of rules
All data points represented through some fuzzy set
maxi = 1,..., M Ai(xk) > 0 for all k = 1,2,..., M
Input space completely covered by fuzzy sets
maxi = 1,..., M Ai(xk) > for all k = 1,2,..., M
Consistency of rules
Rules in conflict
similar or same conditions
completely different conclusions
Conditions and
Conclusions
Similar
Conclusions
Different
Conclusions
Similar Conditions
rules are in
conflict
Different
Conditions
different rules;
could be eventually
merged
different rules
Ri:
If X is Ai then Y is Bi
Rj:
If X is Aj then Y is Bj
M
cons(i , j ) = {| Bi ( yk ) B j ( yk ) | | Ai ( xk ) A j ( xk ) |}
i =1
Alternatively
M
Curse of dimensionality
number of variables increase
exponential growth of the number of rules
Example
n variables
each granulated using p fuzzy sets
number of different rules = pn
Scalability challenges
Stability
Interpretability
Accuracy
Knowledge
Representation