Sunteți pe pagina 1din 15

Computational Intelligence: Fuzzy relations, rules, and inference

Fuzzy Relations

Having described the operations on fuzzy sets, we need to look at how we can represent
linguistic statements mathematically. In fact, many application problems are described using
fuzzy relations.

Relation

The concept of relation has a natural extension to fuzzy sets and plays an important role in
the theory of such sets and their applications. A fuzzy relation R from fuzzy set A in X to
fuzzy set B in Y is a fuzzy set is the Cartesian product B A in Cartesian product space
Y X . R is characterized by the membership function expressing various degrees of strength
of relation as

( )

= = = ) ( ), ( min ) , /( ) , ( y x y x y x B A R
B A R
u u u (1)

= = = ) ( * ) ( ) , /( ) , ( y x y x y x B A R
B A R
u u u (2)

Note: the sum does not mean a mathematical summation operation, it means all possible
combinations of all elements.

R is also called the relational matrix. Cartesian product is implemented in the same fashion,
as is the cross product of two vectors. For example, fuzzy set A with 4 elements (a column
vector of dimension 41) and fuzzy set B with 5 elements (a row vector of dimension 15)
will provide the resulting fuzzy relation R which is represented by a matrix of dimension 45.

Example 1:

Let A and B be two fuzzy sets defined as

0/4} 0.3/3 1/2 {0.5/1 B
0.5/4} 0.6/3 /2 8 . 0 {1/1 A
+ + + =
+ + + =


The fuzzy relation i.e. the Cartesian product of A and B using the min operation will be:

=
0 3 . 0 5 . 0 5 . 0
0 3 . 0 6 . 0 5 . 0
0 3 . 0 8 . 0 5 . 0
0 3 . 0 1 5 . 0
R
http://www.infm.ulst.ac.uk/~siddique
Computational Intelligence: Fuzzy relations, rules, and inference
The fuzzy relation using the product operation will be:

=
0 15 . 0 5 . 0 25 . 0
0 18 . 0 6 . 0 3 . 0
0 24 . 0 8 . 0 4 . 0
0 3 . 0 1 5 . 0
R

Compositional Rule of Inference

If R is fuzzy relation in Y X and A is fuzzy set in X then the fuzzy set B in Y is given by

R A B o = (3)

B is inferred from A using the relation matrix R which defines the mapping between X and Y
and the operation is defined as the max-min operation.

Example 2:

Let A be a fuzzy set defined as

0/3} /2 4 . 0 {0.9/1 A + + =

and given is the fuzzy relation R via the following relational matrix:

= =
1 . 0 3 . 0 6 . 0
3 . 0 6 . 0 8 . 0
1 . 0 8 . 0 1
B A R

Then the fuzzy output B in Y using max-min operation will be

= =
1 . 0 3 . 0 6 . 0
3 . 0 6 . 0 8 . 0
1 . 0 8 . 0 1
3
0
2
4 . 0
1
9 . 0
R A B o o

=
) 1 . 0 , 0 ( ) 3 . 0 , 0 ( ) 6 . 0 , 0 (
) 3 . 0 , 4 . 0 ( ) 6 . 0 , 4 . 0 ( ) 8 . 0 , 4 . 0 (
) 1 . 0 , 9 . 0 ( ) 8 . 0 , 9 . 0 ( ) 1 , 9 . 0 (
B

http://www.infm.ulst.ac.uk/~siddique
Computational Intelligence: Fuzzy relations, rules, and inference
Taking the min values row wise and max values column wise, we get

| | 3 . 0 8 . 0 9 . 0
0 0 0
3 . 0 4 . 0 4 . 0
1 . 0 8 . 0 9 . 0
B =

=

Fuzzy If-Then Rules

Fuzzy sets and fuzzy sets operations are the subjects and verbs of fuzzy logic. If-Then rule
statements are used to formulate the conditional statements that comprise fuzzy logic.

A single fuzzy If-Then rule assumes the form

If x is A
1
Then y is B
2
(4)

where A
1
and B
2
are linguistic variables defined by fuzzy sets on the ranges (i.e. universe of
discourse) X and Y respectively. The If-part of the rule x is A
1
is called the antecedent or
premise and the Then-part of the rule y is B
2
is called the consequent.

In other words, the conditional statement can be expressed in a mathematical form

If A
1
Then B
2
or A
1
B
2
(5)
Example 3:

Speed and pressure of a steam engine can be expressed with the following linguistic
conditional statement
If Speed is Slow Then Pressure should be High.
Graphically, this statement looks like

u(x)
1
x speed
A
1
slow A
2
fast
u(y)
1
y pressure
B
1

low B
2
high

Figure 1: If-Then rule.
http://www.infm.ulst.ac.uk/~siddique
Computational Intelligence: Fuzzy relations, rules, and inference
Rule Forms
In general, three forms of rule exist for any linguistic variables.

Assignment statement
e.g. x is not large AND not very small
Conditional statement
e.g. IF x is very big THEN y is medium
Unconditional statement
e.g. set pressure high

Compound Rules

A linguistic statement expressed by a human might involve compound rule structures. By
using basic properties and operations defined for fuzzy sets, any compound rule structure
may be decomposed and reduced to a number of simple canonical rules.

Conjunctive antecedents: For a multiple conjunctive antecedents of the form

IF x is A
1
AND x is A
2
AND x is A
n
THEN y is B
s
(6)
can be rewritten as
IF x is A
s
THEN y is B
s
(7)

Where A
s
= A
1
A
2
A
3
A
n
and A
s
is expressed by means of membership
function based on the definition of fuzzy intersection operation as

| | ) ( , ), ( ), ( min ) (
2 1
x x x x
n s
A A A A
u u u u L =
(8)

Disjunctive antecedents: For a multiple disjunctive antecedents of the form

IF x is A
1
OR x is A
2
OR x is A
n
THEN y is B
s
(9)

can be rewritten as

IF x is A
s
THEN y is B
s
(10)

Where A
s
= A
1
A
2
A
3
A
n
and A
s
is expressed by means of membership
function based on the definition of fuzzy union operation as

http://www.infm.ulst.ac.uk/~siddique
Computational Intelligence: Fuzzy relations, rules, and inference
| | ) ( , ), ( ), ( max ) (
2 1
x x x x
n s
A A A A
u u u u L =
(11)

Aggregation of rules
Most rule-based systems have more than one rule. The process of obtaining the overall of the
consequent from the individual consequent contributed by each rule in the rule-base is the
aggregation of rules.

In the case of a system of rules that must be jointly satisfied, the rules are connected by AND
connectives. The aggregated output y is found by fuzzy intersection of the entire individual
rule consequent , where i .
i
y r , , 3 , 2 , 1 L =

y = y
1
AND y
2
AND AND y
r
(12)
or
y = y
1
y
2
y
r

which is defined by the membership function

| | ) ( , ), ( ), ( min ) (
2 1
y y y y
r
y y y
y
u u u u L =
for
Y y
(13)

For the case of a disjunctive system of rules where at least one rule must be satisfied, the
rules are connected by OR connectives. The aggregated output y is found by fuzzy union of
all the individual rule consequent , where
i
y r i , , 3 , 2 , 1 L = .

y = y
1
OR y
2
OR OR y
r
(14)
or
y = y
1
y
2
y
r

which is defined by the membership function

| | ) ( , ), ( ), ( max ) (
2 1
y y y y
r
y y y
y
u u u u L =
for
Y y
(15)






http://www.infm.ulst.ac.uk/~siddique
Computational Intelligence: Fuzzy relations, rules, and inference
Example: 4

Lets consider a fuzzy system with two inputs x
1
and x
2
(antecedents) and a single output y
(consequent). Inputs x
1
and x
2
have three linguistic variables small, medium and big with
triangular membership function. Output y has two linguistic variables small and big with
triangular membership function. The rule-base consists of the two following rules:

IF x
1
is small AND x
2
is medium THEN y is big
IF x
1
is medium AND x
2
is big THEN y is small

Inputs x
1
and x
2
are crisp values and the membership values of inputs x
1
and x
2
are calculated
for triangular membership functions. The aggregated output for r rules is given by

| | | | ) ( ), ( min max ) (
2 1
i i i
x x y u u u =

where . In this example r equals to 2. The minimum membership value for the
antecedents propagates through to the consequent and truncates the membership function for
the consequent of each rule. The truncated membership functions for each rule are aggregated
using the graphical equivalent of either for conjunctive or disjunctive rules.
r i , , 3 , 2 , 1 L =

The aggregation operation max results in an aggregated membership function comprised of
the outer envelope of the individual truncated membership forms from each rule. Figure 2
below illustrates the rule-base and aggregation process using max-min method of inference.


x1 x2 y
1 9 1 9
x1= 3.89
x2=5.58
small
medium
medium
big
small
AND
AND
big
aggregation
1 7

Figure 2: Max-min inference method.
http://www.infm.ulst.ac.uk/~siddique
Computational Intelligence: Fuzzy relations, rules, and inference
Fuzzification

The process that allows converting a numeric value (or crisp value) into a fuzzy input is
called fuzzification. There are two ways to do fuzzification:

A
ui
is a fuzzy singleton

=
=
otherwise
u u if
u
i
A
ui
0
1
) ( u (16)

A
ui
is a fuzzy set such that

=
=
i
i
A
u from moves u as from decreases
u u if
u
ui
1
1
) ( u (17)

Singleton fuzzification is generally used in implementation where there is no noise.




u
A
(u)
1
u
A
u
i
u
1
u
A
(u
1
)

Figure 3: Fuzzification in different MFs

Defuzzification
Defuzzification is the reverse process of fuzzification. Mathematically, the defuzzification of
a fuzzy set is the process of conversion of a fuzzy quantity into a crisp value, i.e. rounding off
from its location in the unit hypercube to the nearest vertex. This may be necessary if we
wish to output a number to the user. For example, if we do an expert system for blood
pressure control, we will probably want to tell the user of what a blood pressure is expected
to be in X hours.

http://www.infm.ulst.ac.uk/~siddique
Computational Intelligence: Fuzzy relations, rules, and inference
Fuzzy control engineers have many different ways of defuzzifying; fuzzy reasoning,
however, can usually use quite simple methods. It is intuitive that fuzzification and
defuzzification should be reversible; that is, if we fuzzify a number into a fuzzy set and
immediately defuzzify it, we should get the same number back again.

There are many defuzzification methods available in the literature. Among the many four of
these methods are widely used. The decision as to which method to use is a fairly technical
matter; but the experts should know that these method are available and should try to see
which works best.

Max-membership method: Also known as the height method. The max-membership
method is both simple and quick method. This method takes the peak value of each fuzzy set
and builds the weighted sum of these peak values. This method is given by the algebraic
expression as
for all ) ( ) (
*
x x
c c
u u X x (18)
This is shown in Figure 4(a).

Centre of Gravity method: In the literature also referred to as centre of area and centroid
method. This is the most used and prevalent and physically appealing of all the
defuzzification methods. The centre of area method divides the first moment of area under
membership function into half, and the x value marking the dividing line is the defuzzified
value of X. In the continuous case it is given by the expression as

=
dx x
xdx x
x
c
c
) (
). (
*
u
u
(19)

or for a discrete universe with m quantisation levels in the output

=
=
=
m
i
i c
m
i
i i c
x
x x
x
1
1 *
) (
). (
u
u
(20)
This method determines the centre of the area below the combined membership function.
Figure 4(b) shows this operation in a graphical way.
http://www.infm.ulst.ac.uk/~siddique
Computational Intelligence: Fuzzy relations, rules, and inference

x
u
x*
1

(a): Max-membership defuzzification

x
u
x*
1

(b): Centre of gravity defuzzification


x
u
a
1
b
.5

(c): Weighted average defuzzification

x
u
1
a x* b
.5

(d): Mean-max defuzzification

u
1
x*
.5

(e): Centre of sums defuzzification
Figure 4: Different defuzzification methods
http://www.infm.ulst.ac.uk/~siddique
Computational Intelligence: Fuzzy relations, rules, and inference
Weighted average method: This method is only valid for symmetrical output membership
functions. It is given by the algebraic expression as

=
) (
). (
*
x
x x
x
c
c
u
u
(21)

where denotes an algebraic sum. It is shown in Figure 10(c). For example, the two
functions shown in Figure 4(c) would result in the following defuzzified value:

{ }
( ) 5 . 0 1
) 5 . 0 ( ) 1 (
*
+
+
=
b a
x

Mean-max membership: Also called middle of maxima. If the mean or average of all local
maxima in X is taken, a single defuzzified output is generated by this mean of maximum
approach through


N
x
x
N
i
i
=
=
1
max
*
) ( u
(22)

where x
j
= max u(x) and N is the number of times the membership function reaches the
maximum support value. It is shown in Figure 4(d). The defuzzified output is then

2
) (
*
b a
x
+
= (23)

Centre of sums: This is faster than many defuzzification methods that are presently in use.
This process involves the algebraic sum of individual output fuzzy sets, say C
1
and C
2
,
instead of their union. One drawback of this method is that the intersecting areas are added
twice. The defuzzified value x* is given in discrete case by the following expression:




= =
= =
=
m
i
n
k
i k
m
i
n
k
i k i
x
u x
x
1 1
1 1 *
) ( .
) ( .
u
u
(24)

Centre of sums method is shown in Figure 4(e).

http://www.infm.ulst.ac.uk/~siddique
Computational Intelligence: Fuzzy relations, rules, and inference
Example 5

1
x*
.5

Figure 5: Defuzzified value using COG

1
x1 x2 y
2
1 9 1 9
x1= 3.89
x2=5.58
small
medium
medium
big
small
AND
AND
1 7
3.72
big
aggregation
fuzzification
defuzzification

Figure 6: Fuzzification and defuzzification.
u

Inference Mechanism

Inference is the process of formulating a nonlinear mapping from a given input space to
output space. The mapping then provides a basis from which decisions can be taken. The
process of fuzzy inference involves all the membership functions, fuzzy logic operators and
if-then rules.

There are three types of fuzzy inference, which have been widely employed in various
applications. The differences between these three fuzzy inferences, also called fuzzy models,
http://www.infm.ulst.ac.uk/~siddique
Computational Intelligence: Fuzzy relations, rules, and inference
lie in the consequents of their fuzzy rules, aggregations and defuzzification procedures. These
fuzzy inferences are

1. Mamdani fuzzy inference
2. Sugeno fuzzy inference
3. Tsukamoto fuzzy inference
1. Mamdani Fuzzy Inference
The Mamdani type fuzzy modelling was first proposed as the first attempt to control a steam
engine and boiler by a set of linguistic control rules obtained from experienced human
operator (Mamdani and Assilian, 1974). Figure 7 is an illustration of a two input-single
output Mamdani type fuzzy model.
The choice of T-norm and T-conorm operators can be max-min and max-product. Max-min is
the most common rule of composition. In max-min rule of composition the inferred output of
each rule is a fuzzy set chosen from the minimum firing strength. In max-product rule of
composition the inferred output of each rule is a fuzzy set scaled down by its firing strength
via algebraic product.



u

u

u

u

x
x y
y
x1 y1
A1
A2
B1
B2
min
u

u

u

z
z
z
ZCOA
C1
C2
MAX
u

u

u

z
z
z
ZCOA
C1
C2
MAX
product

Figure 7: Two-input single-output Mamdani fuzzy model.

A typical rule in Mamdani-type fuzzy model with two-input single-output has the form
If x is A and y is B then z is C
http://www.infm.ulst.ac.uk/~siddique
Computational Intelligence: Fuzzy relations, rules, and inference

In Mamdanis fuzzy model crisp values are used as inputs and defuzzification (see section
4.4) is used to convert a fuzzy set to a crisp value.

2. Sugeno Fuzzy Inference
The Sugeno fuzzy model, also known as the TSK fuzzy model, was proposed by Takagi,
Sugeno and Kang (Takagi and Sugeno, 1985; Sugeno and Kang, 1988) in an effort to develop
a systematic approach to generate fuzzy rules from a given input-output data set. A typical
fuzzy rule in Sugeno fuzzy model has the form

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

where A and B are fuzzy sets in the antecedent part, while z=f(x,y) is crisp function in the
consequent part. Usually f(x,y) is polynomial in the input variables x and y but it can be any
function as long as it can appropriately describe the output of the model within the fuzzy
region specified by the antecedent of the rule. When f(x,y) is a first-order polynomial, the
resulting fuzzy inference system is called a first-order Sugeno fuzzy model which was
proposed in (Sugeno and Kang, 1988; Takagi and Sugeno, 1985). When f(x,y) is a constant, it
is zero-order Sugeno fuzzy model, which can be considered as a special case of Mamdani
fuzzy model, in which the consequent of each rule is specified by a fuzzy singleton or by a
pre-defuzzified consequent or a special case of Tsukamoto fuzzy model in which the
consequent of each rule is specified by an MF of a step function.

The output of zero-order Sugeno model is a smooth function of its input variables as long as
neighbouring MFs in the antecedent have enough overlap. In other words, the overlap of MFs
in the consequent of a Mamdani model does not have a decisive effect on the smoothness; it
is the overlap of the antecedent MFs that determines the smoothness of the resulting input-
output behaviour. The overall output of a Sugeno fuzzy model is obtained via weighted
average of the crisp output, thus avoiding the time consuming process of defuzzification
required by Mamdani model. Moreover, a zero-order Sugeno fuzzy model is functionally
equivalent to a radial basis function network under certain minor constraints (Jang and Sun,
1993).

In practice, the weighted average operator is sometimes replaced with the weighted sum
operator to reduce computation further, especially in the training of a fuzzy inference system.
However, this simplification could lead to the loss of MF linguistic meaning unless the sum
of firing strengths is close to unity. Figure 8 illustrates a two-input single-output Sugeno
fuzzy model.
http://www.infm.ulst.ac.uk/~siddique
Computational Intelligence: Fuzzy relations, rules, and inference

3. Tsukamoto Fuzzy Inference

In the Tsukamoto fuzzy model, the consequent of each fuzzy if-then rule is represented by a
fuzzy set with a monotonic MF (Tsukamoto, 1979). As a result, the inferred output of each
rule is defined as crisp value included by the rules firing strength. The overall output is taken
as the weighted average of each rules output. Since each rule infers a crisp output, the
Tsukamoto fuzzy model aggregates each rules output by the method of weighted average
and thus avoids the time-consuming process of defuzzification. Figure 9 illustrates a two-
input single-output Tsukamoto fuzzy model.



u

u

u

u

x
x y
y
x y
A1
A2
B1
B2
min or product
w1
w2
weighted average
1 1 1 1
r y q x p z + + =

2 2 2 2
r y q x p z + + =

2 1
2 2 1 1
w w
z w z w
z
+
+
=


Figure 8: Two-input single-output Sugeno fuzzy model.

http://www.infm.ulst.ac.uk/~siddique
Computational Intelligence: Fuzzy relations, rules, and inference
http://www.infm.ulst.ac.uk/~siddique


u
u
u
u
x
x y
y
x1 y1
A1
A2
B1
B2
min or product
u
u
z
z
C1
C2
weighted average
z1
z2
2 1
2 2 1 1
w w
z w z w
z
+
+
=

Figure 9: Two-input single-output Tsukamoto fuzzy model.




References

1. Mamdani, E.H. and Assilian, S. (1974). Application of fuzzy algorithms for control of
simple dynamic plant, Proceedings of. IEE vol. 121, pp.1585-1588.
2. Takagi, T. and Sugeno, M. (1985). Fuzzy identification of systems and its application
to modeling and control, IEEE Transaction on Systems, Man and Cybernetics, Vol.
15, pp. 116-132.
3. Sugeno, M. and Kang, G.T., (1988). Structure identification of fuzzy model, Fuzzy
Sets and Systems, Vol. 28, pp. 15-33.
4. Tsukamoto, Y. (1979). An approach to fuzzy reasoning method, In Madan M. Gupta,
Rammohan K. Ragade and R. Yager edts. Advances in fuzzy set theory and
applications, North-Holland, Amsterdam, pp. 137-149.
5. Jang, J.-S. R. and Sun, C.-T. (1993). Functional Equivalence between Radial basis
Function Networks and Fuzzy Inference System, IEEE Transaction on Neural
networks, Vol. 4, pp. 156-159.

S-ar putea să vă placă și