0% found this document useful (0 votes)
92 views

Crisp and Fuzzy Logic

Fuzzy logic forms a bridge between qualitative and quantitative modeling by allowing partial set membership. Unlike binary logic which requires absolute membership, fuzzy logic uses membership functions to describe the degree to which an element belongs to a set on a scale of 0 to 1. This allows for smoother outputs when modeling vague concepts that are difficult to define precisely, like determining whether a person is tall. Fuzzy logic systems use if-then rules based on these membership functions to produce interpolated outputs.

Uploaded by

Rashika
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
92 views

Crisp and Fuzzy Logic

Fuzzy logic forms a bridge between qualitative and quantitative modeling by allowing partial set membership. Unlike binary logic which requires absolute membership, fuzzy logic uses membership functions to describe the degree to which an element belongs to a set on a scale of 0 to 1. This allows for smoother outputs when modeling vague concepts that are difficult to define precisely, like determining whether a person is tall. Fuzzy logic systems use if-then rules based on these membership functions to produce interpolated outputs.

Uploaded by

Rashika
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 32

Fuzzy Logic 

1. Crisp and fuzzy logic 


Fuzzy  logic  forms  a  bridge  between  the  two  areas  of  qualitative  and  quantitative  modelling. 
Although  the  input-output  mapping  of  such  a  model  is  integrated  into  a  system as a quantitative 
map,  internally  it  can  be  considered  as  a  set  of  qualitative  linguistic  rules.  Since  the  pioneering 
work  of  Zadeh  in  1965  and  Mamdani  in  1975,  the  models  formed  by  fuzzy  logic  have  been 
applied to many varied types of information processing including control systems. 
The  term  Fuzzy  Logic  is  a  misnomer.  It  implies  that  in  some  way  the  methodology  is  vague  or 
ill-defined.  This  is  in  fact  far  from  the  case. Fuzzy logic just evolved from the need to model the 
type  of  of  vague  or  ill-defined  systems  that  are  difficult  to  handle  using  conventional  binary 
valued logic, but the methodology itself is based on mathematical theory. 
We  are  all  familiar  with  binary  valued  logic  and  set  theory.  An  element  belongs  to  a  set  of  all 
possible elements and given any specific subset, it can be said accurately, whether that element is 
or  is  not  a  member  of  it. For example, a person belongs to the set of all human beings, and given 
a  specific  subset,  such  as  all  males,  one  can  say  whether  or  not each particular person (element) 
belongs  to  this set. This is appealing since it seems to describe the way human reason. Collecting 
many  elements  into  sets  allows  to  describe  many  occurrences  with  few  rules.  For  example,  the 
simple statement 
IF person is male AND a parent THEN person is a father 
applies to many people across the world with complete precision. The rules are formed using 
operators. Here, the intersection operator AND is used, which manipulates the sets. 
Unfortunately, not everything can be described using binary valued sets. The classification of 
persons into males and females is easy, but it is problematic to classify them as being tall or not 
tall. The set of tall people is far more difficult to define, because there is no distinct cut-off point 
at which tall begins. This is not a measurement problem, and measuring the height of all 
elements more precisely is not helpful. Such a problem is often distorted so that it can be 
described using the well-known existing methodology. Here, one could simply select a height, 
e.g. 1.80m, at which the set tall begins, see Figure 14.1a. The output of a reasoning system using 
this definition would not be smooth with respect to the height of a person. A person of height 
1.79m would produce a different output than a person of 1.81m. In human reasoning this 
property is not observed and it is also undesirable for reasoning systems that are part of a control 
system. 
Fuzzy  logic  was  suggested  by  Zadeh  as  a  method  for  mimicking  the  ability of human reasoning 
using  a  small  number  of  rules  and  still  producing  a smooth output via a process of interpolation. 
It  forms  rules  that  are  based  upon  multi-valued  logic  and  so  introduced  the  concept  of  set 
membership.  With  fuzzy  logic  an  element  could  partially  belong  to  a  set  and  this  is  represented 
by  the  set  membership.  For  example,  a  person of height 1.79m would belong to both tall and not 
tall  sets  with  a  particular  degree  of  membership.  As  the  height  of  a  person  increases  the 
membership  grade  within  the  tall  set  would  increase  whilst the membership grade within the not 
tall set would decrease, see Figure 14.1b. The output of a 
 
fuzzy  reasoning  system  would  produce  similar  results  for  similar  inputs.  Fuzzy  logic  is  simply 
the  extension  of  conventional  logic  to  the  case  where  partial  set  membership  can  exist,  rule 
conditions  can  be  satisfied  partially  and  system  outputs  are  calculated  by  interpolation  and, 
therefore,  have  output  smoothness  over  the  equivalent  binary-valued  rule  base.  This  property  is 
particularly relevant to control systems. 
Figure 1: The difference between the grade of truth in (a) binary valued logic and (b) fuzzy 
logic A fuzzy logic control system is one that has at least one system component that uses fuzzy 
logic for its internal knowledge representation. Although it is possible for fuzzy systems to 
communicate information using fuzzy sets, most applications have a single fuzzy system 
component communicating with conventional system components via deterministic values. In 
this case, and also in this chapter, fuzzy logic is used purely for internal knowledge 
representation and, externally, can be considered as any other system component. 
2. Fuzzy sets 
In the classical 
set theory a set can be represented by enumerating all its elements using 
(1) 
If these elements 

the set 
characteristic function 
(2) 
In classical set theory 
has only the values 0 (``false'') and 1 (``true''), so two values of 
truth. Such sets are also called crisp sets . 
Non-crisp sets are called fuzzy sets, for which also a characteristic function can be defined. This 
function is a generalisations of that in Eq.(1) and called a membership function. The 
membership of a fuzzy set is described by this membership function 
, which 
associates to each element 
. In contrast to classical 
set theory a membership function 
of a fuzzy set can have in the normalised closed 
interval 
an arbitrary grade of truth. Therefore, each membership function maps elements of 
a given universal base set 
, which is itself a crisp set, into real numbers 
in 
. The notation for the membership function 
Fuzzy Logic 

can be represented for all elements 


Winter School on "Data Mining Techniques and Tools for Knowledge Discovery in Agricultural Datasets” 
303 

of 
a grade of membership 
are together a subset of the universal base set 
by its 
of a fuzzy set 
of 
 
Fuzzy Logic 
Winter School on "Data Mining Techniques and Tools for Knowledge Discovery in Agricultural Datasets” 
304 

(3) 
is  used.  Each  fuzzy  set  is  completely  and  uniquely  defined  by  one  particular  membership 
function.  Consequently  symbols  of  membership  functions  are  also  used  as  labels  of  the 
associated  fuzzy sets. That is, each fuzzy set and the associated membership function are denoted 
by  the  same  capital  letter.  Since  crisp  sets  and  the  associated  characteristic  functions  may  be 
viewed,  respectively,  as  special  cases  of fuzzy sets and membership functions, the same notation 
is used for crisp sets as well, see Figure 1 
The base set 
is  introduced  first  above  as  a universal set. In practical applications, physical or 
similar  quantities  are  considered  that  are  defined  in  some  interval.  When  such  quantities  are 
described by sets, a base sets can be generalized seamless to a crisp base set 
that exists in a defined interval. This is a generalization of fuzzy sets. 
Base  sets  are  not always crisp sets. Another generalisation is that the base set is itself a fuzzy set. 
This is necessary for multi-dimensional fuzzy sets, which are discussed later in this chapter. 
3. Membership functions 
The membership function 
of the base 
set 
a  large  class  of  functions  can  be  taken. 
Reasonable  functions  are  often  piecewise  linear  functions,  such  as  triangular  or  trapezoidal 
functions. 
The 
grade of membership 
describes for the special 
element 
. This value is in the unit 
interval 
, such 
that 
. This case is shown in Figure 
3. 
in the fuzzy set 
characterizes the grade of membership of 
. Of course, 
Figure 2: Membership functions of a crisp set 
, to which grade it belongs to the fuzzy set 
, whereby for 
can simultaneously belong to another fuzzy set 
describes the membership of the elements 
of a membership function 
and a fuzzy set 
to 
 
In the following, a set of important properties and characteristics of fuzzy sets will be described. 
• Having two fuzzy sets 
Fuzzy Logic 
Winter School on "Data Mining Techniques and Tools for Knowledge Discovery in Agricultural Datasets” 
305 

that have 
nonzero membership grades in 
, and it 
is subnormal when 

• The support of a fuzzy set 
(7) 
An illustration is shown in Figure 4. Figure 3: Membership grades of 
if their membership 
functions are equal, i.e. 
(4) 
• The universal set 
is defined as 
(5) 
• The height of a fuzzy set 
is the largest membership grade obtained by any element in that 
set, i.e. 
(6) 
• A fuzzy set 
Figure 4: Some characteristics of a membership function 
is called normal when 
in the sets 
is the crisp set that contains all the elements of 
and 
based on 
, i.e. 
and 

, then both are equal 
and 
 
Fuzzy Logic 

• The core of a normal fuzzy set 


Winter School on "Data Mining Techniques and Tools for Knowledge Discovery in Agricultural Datasets” 
306 

(11) 
• This set is called a singleton . 
The  type  of  representation  of  the  membership  function  depends  on  the  base  set.  If  this  set 
consists  of  many  values,  or  is  the  base  set  a  continuum,  then  a  parametric  representation  is 
appropriate.  For  that  functions  are  used  that  can  be  adapted  by  changing  the  parameters. 
Piecewise  linear  membership  functions  are  preferred,  because  of  their  simplicity  and  efficiency 
with  respect  to  computability.  Mostly  these  are  trapezoidal  or  triangular  functions,  which  are 
defined by four and three parameters, respectively. Figure 4 
shows a 
trapezoidal function formally described by 
(12) 
which migrates for the case 
into  a  triangular  membership  function.  For  some 
applications  the  modelling  requires  continuously  differentiable  curves  and  therefore  smooth 
transitions,  which  the  trapezoids  do  not  have.  Here,  for  example,  three  of  these  functions  are 
mentioned, which are shown in Figure 5. 
Figure 5: Membership functions with smooth transitions (Eqs.(13) to (15)) 
These are 
• The normalised Gaussian function (Figure 5a) 
(8) 
• The boundary is the crisp set that contains all the elements of 
(9) 
• Having two fuzzy sets 
(10) 
• If the support of a normal fuzzy set consists of a single element 
that have the 
membership grades of 
, which has the property 
that have the membership grades of one in 
and 
if based on 
and 
is the crisp set that contains all the elements of 
in 
, i.e. 
, then both are similar 
, i.e. 
of 
 
Fuzzy Logic 

and 
(fuzzy AND connective) can be represented as the algebraic 
product of two fuzzy sets 
, which is defined as the multiplication of 
their membership functions: 
(fuzzy OR connective) can be represented as the algebraic sum of 
two fuzzy sets 
Winter School on "Data Mining Techniques and Tools for Knowledge Discovery in Agricultural Datasets” 
307 

with the 
membership function 
(fuzzy AND connective) applied to two fuzzy 
sets 
(19) 
• The fuzzy union operator 
is 
(16) 
• The fuzzy union operator 
is 
(17) 
• The fuzzy complement (fuzzy NOT operation) applied to the fuzzy set 
(13) 
• The difference of two 
sigmoidal functions (Figure 5b) 
(14) 
• And the generalised 
bell function (Figure 5c) 
(15) 
4. Elementary operators for fuzzy sets 
The  basic  connective  operations  in  classical  set  theory  are  those  of  intersection,  union  and 
complement.  These  operations  on  characteristic  functions  can  be  generalized  to  fuzzy  sets  in 
more  than  one  way.  However,  one  particular  generalization,  which  results  in  operations  that are 
usually  referred  to  us  as  standard  fuzzy  set  operations,  has  a  special  significance  in  fuzzy  set 
theory.  In  the  following,  only  the  standard  operations  are  introduced.  The  following  operations 
can be defined: 
• The fuzzy intersection operator 
is 
(18) 
Whilst  the  operations  according  to  Eqs.  (16)  and  (17)  are  based  on  min/max  operations,  the 
complement  is  an  algebraic  one.  Union  and  intersection  can  also  be  defined  in  an  algebraic 
manner but giving different results as: 
• The fuzzy intersection operator 
(20) 
The standard connective operations for fuzzy sets are now defined. As one can easily see, these 
operations perform precisely as the corresponding operations for crisp sets when the 
and 
with the membership functions 
with the membership functions 
(fuzzy OR connective) applied to two fuzzy sets 
and 
, which is defined as: 
and 
and 
and 
 
Fuzzy Logic 

range of membership grades is restricted to the set 


.  That  is,  the  standard  fuzzy 
operations  are  generalizations  of  the  corresponding  classical  set  operations.  However,  they  are 
not  the  only  possible  generalization.  As  shown  above,  the  fuzzy  intersection,  union  and 
complement  are  not  unique  operations,  contrary  to  their  crisp  counterparts.  Different  functions 
may  be  appropriate  to  represent  these  operations  in  different  contexts.  The  capability  to 
determine  appropriate  membership  functions  and  meaningful  fuzzy  operations  in  the  context  of 
each particular application is crucial for making fuzzy set theory practically useful. 
When  fuzzy  operators  are later applied within more complex fuzzy logic operations for rules and 
fuzzy  reasoning,  one has to take care of the right combinations of fuzzy operations. For example, 
in  classical  set  theory,  the  operations  of  intersection  and  union  are  dual  with  respect  to  the 
complement in the sense that they satisfy the De Morgan laws 
It  is  desirable  that  this  duality  be  satisfied  for  fuzzy  sets  as  well.  Other  combinations  need 
equivalences  for  commutativity,  associativity  and  distributivity.  From  Table  1  the  type  of 
operations  can  be  determined  for  which  operations  are  valid.  Only  distributivity  is  not  given  in 
the  arithmetic  case.  Therefore,  one  has  to  be  careful  in  applications  where  arithmetic operations 
are performed. 
Table 1: 
Validity of fuzzy equivalences 
5. Ideas of the fuzzy control methodology 
Before  coming  to  the  details,  the  main  ideas  of  fuzzy  control  methodology  on  the  example  of  a 
situation  will  be  illustrated  in  which  everyone  feels  himself  an  expert.  One  of  the  most  widely 
used  control  systems  is  the  simplest  rule-based  system  imaginable,  a  thermostatic  temperature 
controller. This rule-based system operates with two rules: 
(1) IF temperature is below set point THEN heat is on (2) IF temperature is above set point 
THEN heat is off 
Winter School on "Data Mining Techniques and Tools for Knowledge Discovery in Agricultural Datasets” 
308 

and 
 
The success of this controller is due to the combination of the properties, that it is simple, robust 
and does not require a complex process model. The model is: when the heat is on, the 
temperature rises slowly, and when the heat is off, the temperature falls slowly. The two 
IF-THEN clauses above can also be formally rewritten as 
IF 
In  the  thermostat  example  there  is  only  one  input  variable  (linguistic  variable),  the temperature. 
In  the  general  case,  there  are  several  input  variables,  so,  in  addition  to  the  logical  connective 
IF-THEN, another logical connective is needed, AND. Then the IF- THEN clauses are 
IF is AND is ... AND is THEN is . 
Here, 
are  words  from  natural  language 
(linguistic  terms),  like  ``below  set  point'',  ``on'',  ``small'',  ``large'',  ``approximately  1.5'',  etc.  If 
the  standard  mathematical  notation  for  IF-THEN  and  AND  is  used,  the  above  rules  can  be 
re-formulated as follows: 
(21) 
where 
.  The  set  of  rules  is  usually  called  a  rule  base.  The  left-hand  side  of  a  rule  is 
called  premise,  the  right-hand  side  conclusion  and  the rule itself implication. . The set of rules is 
usually  called  a  rule  base.  The  left-hand  side  of  a  rule  is  called  premise,  the  right-  hand  side 
conclusion and the rule itself implication. 
The  general  idea  is  to  represent  the  rule  base  in  a  computer.  It  has  a  clear  structure. A rule base 
consists  of  rules  and  each  rule,  in  its  turn,  is  obtained  from  properties  expressed  by  linguistic 
variables  and  terms  and  using  logical  connectives.  In  view  of  this  structure,  it  is  reasonable  to 
represent  the  rule  base  by  first  representing  the  basic  elements  of  the  rule  base,  premises  and 
conclusions,  and  then by extending this representation to the rule base as a whole. It makes sense 
to use the following steps in the methodology: 
1. Representation of the basic properties 
. 2. Representation of the logical 
connectives. 3. The representation of the basic properties and of the logical connectives is used 
to 
get the representations of all the rules. 4. Combination of the representations of different 
rules into a representation of a rule 
base. 
As  a  result  of  these  four  steps,  one  obtains  an expert system that can give advise for a specialist, 
who  has  to  make  a  decision.  In  control,  a  system  to  automatically  make  a  decision  based  on  its 
own  conclusions  is  wanted.  Therefore,  for  control  situations,  a  fifth  follow-up  step  is  needed. 
Based on facts for and on the rule base a reasoning procedure makes a decision. 
Fuzzy Logic 

is the rule number, and 


Winter School on "Data Mining Techniques and Tools for Knowledge Discovery in Agricultural Datasets” 
309 

is 
THEN 
is 
and 
and 
for 
 
Fuzzy Logic 

6. Fuzzy relations 
First, relations are explained by a simple example from daily life using discrete fuzzy sets. 
Let us describe the relationship between the colour of a fruit and characterise thelinguistic 
variable colour by a crisp set 
with three linguistic terms as 
green 
And similarly the grade of maturity as 
verdant 
Winter School on "Data Mining Techniques and Tools for Knowledge Discovery in Agricultural Datasets” 

310 One knows that a crisp formulation of a relation 


between the two crisp sets would look 
like this in tabular form: 
verdant half-mature mature green 1 0 0 yellow 0 1 0 red 0 0 1 
The zeros and ones describe the grade of membership to this relation. This relation is now 
a new kind of crisp set that is built from the two crisp base sets 
. This new set is now 
called 
and can be expressed also by the rules: 
(1) 
(2) 
IF the colour is green THEN the fruit is verdant 
(3) 
IF the colour is yellow THEN the fruit is half-mature 
IF the colour is red THEN the fruit is mature 
As can be seen from this example, a relation, which is called a rule or rule base, can be used to 
provide a model. 
This crisp relation 
represents  the  presence  or  absence  of  association,  interaction  or 
interconnection  between  the  elements  of  these  two  sets.  This  can  be  generalized  to  allow  for 
various  degrees  of  strength  of  association  or  interaction  between  elements.  Degrees  of 
association  can  be  represented  by  membership  grades  in  a  fuzzy  relation  in  the  same  way  as 
degrees  of  the  set  membership  are  represented  in  a  fuzzy set. Applying this to the fruit example, 
the table can be modified to 
verdant half-mature mature 
green 1 0.5 0 yellow 0.3 1 0.4 
half-mature 
yellow 
red 
mature 
and the grade of maturity 
and 
 
Fuzzy Logic 

red 0 0.2 1 
where there are now real numbers in 
.  This  table  represents  a  fuzzy  relation  and  models 
the  connectives  in  a  fuzzy  rule  base.  It  is  a  two-dimensional  fuzzy  set  and  the  question  now  is, 
how can this set be determined from its elements. 
In order to do this, the elements are generalized. In the above example, the linguistic terms where 
treated  as  crisp  terms.  For  example,  when  one  represents the colours on a colour spectrum scale, 
the  colours  would  be  described  by  their  spectral  distribution  curves  that  can  be  interpreted  as 
membership  functions  and  then  a  particular  colour  is  a  fuzzy  term.  Treating  also  the  grades  of 
maturity  as  fuzzy  terms,  the  above  relation  is  a  two-dimensional  fuzzy  set  over  two  fuzzy  sets. 
For  example,  taking  from  the  fruit  example  the  relation  between  the  linguistic  terms  red  and 
mature  ,  and  represent  them  by  the  membership  functions  as  shown  in  Figure  6a,  a  fruit  can  be 
characterized by the 
Figure 6: Relation between two fuzzy sets: (a) membership functions, (b) 3-D view of the membership 
functions, (c) membership function of the relation after applying the 
operation to (b) 
property red AND mature . This expression can be re-written in mathematical form using 
elementary connective operators (see Eqs. (16) or (19)) for the membership functions by 
Winter School on "Data Mining Techniques and Tools for Knowledge Discovery in Agricultural Datasets” 
311 

or 
(23) 
(22) 
 
Fuzzy Logic 

Figure  6b  shows  a  3-dimensional  view  of  these  two  fuzzy  terms  and  Figure  6c  the  result  of  the 
connective  operation  according  to  Eq.(22).  This  result  combines  the  two  fuzzy  sets  by  an 
operation that is a Cartesian product 
(24) 
From this example it is obvious that the connective operation in a rule for the 
operation  is 
simply  performed  by  a fuzzy intersection in two dimensions. For this, both intersection operators 
from Eqs. (16) or (19) can be used. 
Combining rules into a 
rule base the example from above may help when it is rewritten as (1) 
IF the colour is green THEN the fruit is verdant OR 
(2) 
IF the colour is yellow THEN the fruit is half-mature OR (3) IF the colour is red THEN the 
fruit is mature 
Which describes in a linguistic way a union of three rules. For the complete rule base 
one can combine the relations formed for each individual rule with a fuzzy union operator, 
which is the fuzzy OR according to Eqs. (17) or (22). 
Winter School on "Data Mining Techniques and Tools for Knowledge Discovery in Agricultural Datasets” 
312 

(25) 
Where 
th rule. This representation is the standard 
max/min representation of a 
rule  base  that  will  be  later  used  for  fuzzy controllers. Instead of the 
max/min  representation  a  so  called  max-prod  representation  is  also  usual,  where  the  algebraic 
product 
(26) 
is used to build the relation between the premise and the conclusion. 
7. Fuzzy composition 
Explaining  reasoning  by  the  fruit  example,  it  is  assumed  that  one  has  a  crisp  fact:  a  green  fruit. 
The  decision  from  the  rule  base  is  obvious:  the  fruit  is  verdant,  and  this  is  similar  for  the  other 
facts:  yellow  and  red.  But  if  one  has  a  fact  like:  the  fruit  is  orange,  one  does  not  know  how  to 
determine  which  rule  fires  the  decision  and  what  the  decision  is.  In  the  following,  a  new  fuzzy 
operation  type  is  introduced,  that  allows  to  operate  with  a  given  fact  and  a  fuzzy  relation  to 
produce  an  output  that  represents  the  decision  in  a  fuzzy  way.  This  operation  is  called  fuzzy 
reasoning, which is a special case of the more general operation called fuzzy composition . 
Two relations of the form given in Eq. (24) 
is the premise of the 
 
Fuzzy Logic 

can be composed to one relation 


This process is known as composition and, using the max and min operators for union and 
intersection, one can express the composition operation 
by the corresponding 
membership functions as follows: 
(27) 
When one takes the above fruit example again with the colour-maturity relation 
verdant half-mature mature 
green 1 0.5 0 yellow 0.3 1 0.4 red 0 0.2 1 
and define for 
sour tasteless sweet verdant 1 0.2 0 half-mature 0.7 1 0.3 
mature 0 0.7 1 
then by applying Eq. (27) to the elements of these two tables, the following is obtained: 
sour tasteless sweet green 1 0.5 0.3 
yellow 0.7 1 0.4 red 0.2 0.7 1 
When the fuzzy set 
as a fact 
obtained from some measurement data, then the fuzzy set 
is the result from the 
reasoning process, which is in this case a relation. In the following, first, a one-dimensional crisp 
fact is taken. Define the fruit colour green as a fact by the 
singleton 
Where the numbers are the intensity grades of the colours green, yellow and red. When one 
calculates the composition 
by applying Eq. (27), where in this case the first operand 
has only one dimension, the fuzzy set for the maturity 
Winter School on "Data Mining Techniques and Tools for Knowledge Discovery in Agricultural Datasets” 
313 

a maturity-taste relation 
is now interpreted as a rule base and the fuzzy set 
 
Fuzzy Logic 

is obtained. The result is obvious from the first rule of the rule base 
. When a different 
colour is taken than included in the rule base entries, say orange as 
then there is no problem to obtain the value for the maturity 
by applying the composition formula. The reasoning process is now solved. In the same manner 
as relations can be composed, the one-dimensional facts can be composed with the 
rule base to realise the reasoning operation. This can now be precisely 
re-formulated for the general case of a rule base. If for the 
rule base 
its membership function is described by Eq. (25) or (26) and if there is a fact described by the 
fuzzy set 
and its membership function 
of the fuzzy reasoning is represented by the membership function 
(28) 
8. Fuzzy Systems 
The  idea  of  a  fuzzy  system  is  introduced  here.  Its  main components are described and discussed 
in  detail  using  examples.  The  results  from  the  fuzzification  module  drives  the  rule  base.  The 
fuzzy  inference  machine  is  developed  which  solves  the  reasoning. The methods to transform the 
fuzzy  results  of  the  reasoning  process  to  crisp  data  is  shown  in  detail.  The  mainstream  in  the 
fuzzy  system  of  this  module  is  the  Mamdani  approach  which  needs  the  defuzzification step, but 
the Takagi-Sugeno-type of fuzzy system is also introduced which avoids defuzzification. 
In  the  previous section, elementary fuzzy terms and fuzzy logic operations have been introduced. 
In  this  section,  the  application  to  the  treatment  of  rule-based  knowledge  follows.  For  this  a 
rule-based fuzzy system is needed, containing a rule base and a 
reasoning algorithm, which is used to process crisp or fuzzy input values 
to 
a crisp or fuzzy output value 
Winter School on "Data Mining Techniques and Tools for Knowledge Discovery in Agricultural Datasets” 
314 

, see Figure 7. 


, the result 
 
inputs and one output 
Using  multiple  inputs  and  one  output  implies  no  restriction  as  a  multi-input-multi-output  fuzzy 
system  can always be decomposed into multiple systems according to Figure 7. Such systems are 
the basis for the realisation of fuzzy controllers. As there are mostly crisp input 
values 
, a fuzzy system must 
contain additional components, fuzzification anddefuzzification. 
9. Fuzzification 
The fuzzification comprises the process of transforming crisp values into grades of membership 
for 
linguistic terms of fuzzy sets. The membership function is used to associate a 
grade to each linguistic term. 
Example: For the fuzzification of the car speed value 
the two membership 
functions 
from Figure 8 can be used, which characterise a low and a medium 
speed fuzzy set, respectively. The given speed value of 
belongs with a grade 
of 
to the fuzzy set 
``medium''. 
Figure 8: Fuzzification of a car speed 
Fuzzy Logic 

from measurements and for controllers only a crisp output 


and 
Winter School on "Data Mining Techniques and Tools for Knowledge Discovery in Agricultural Datasets” 
315 

Figure 7: Rule-based fuzzy system with 


to the fuzzy set ``low'' and with a grade of 
 
Fuzzy Logic 

10. Fuzzy Inference Machine 


The  core  section  of  a  fuzzy  system  is  that  part,  which  combines  the  facts  obtained  from  the 
fuzzification  with  the  rule  base  and  conducts  the  fuzzy  reasoning  process.  This  is called a fuzzy 
inference machine 

In the following, for simplicity it is assumed that there is only one input 
Winter School on "Data Mining Techniques and Tools for Knowledge Discovery in Agricultural Datasets” 
316 

and the rule 


base is described with max/min operators from Eq. (25) by 
(29) 
then inserting Eq. (29) into Eq. (28) yields 
(30) 
The 
operations can be reordered such that only the relevant operands are on the right- hand 
side. Then 
is obtained for the reasoning process. The inner term 
, which combines the fact with the 
premise, is a constant and is called degree of relevance of the rule 
. It characterises the 
relevance of the fired rule 
and can be treated as a de-normalised universal fuzzy set. The 
following example will help to interpret and provide understanding of this reasoning operation 
by applying graphical means. 
Example:  A  simple  fuzzy  system  is  given,  which  models  the  brake  behaviour  of  a  car  driver 
depending  on  the  car  speed.  The  inference  machine should determine the brake force for a given 
car  speed. The speed is specified by the two linguistic terms ``low'' and ``medium'', and the brake 
force by ``moderate'' and ``strong''. 
(1) 
The rule base includes the two 
rules 
(2) 
IF the car speed is low THEN the brake force is moderate 
IF the car speed is medium THEN the brake force is strong 
For the linguistic terms in the premises ``speed is low'' and ``speed is medium'' those from Figure 
8 are used. The terms ``force is moderate'' and ``force is strong'' are defined in Figure 9. 
 
Fuzzy Logic 

Figure 9: Fuzzy set of a car brake force 


For these two rules the membership functions for the premises are 

and for the conclusions 
, which is a crisp 
value and therefore can be represented in fuzzy notation by 
the singleton 
with 
and 
In rule 1, there is only a relation between 
for rule 1 is a 
horizontal line of height 0.75, which is the value from the fuzzification as shown in 
Figure 10a. The reasoning operation 
Winter School on "Data Mining Techniques and Tools for Knowledge Discovery in Agricultural Datasets” 
317 

. Inserting these values into Eq. (30), one obtains 



. The car speed is 
and 
. The degree of relevance 

 
Fuzzy Logic 
Winter School on "Data Mining Techniques and Tools for Knowledge Discovery in Agricultural Datasets” 
318 

Figure 10: 
Fuzzy inference example: (a) inference with rule 1, (b) with rule 2, and (c) final fuzzy 
set 
with rule 1 cuts the membership function 
by  this  line  (yellow  area).  The  rule  2  is 
evaluated  analogously,  as  shown  in  Figure  10b.  Figure 10c shows the final result from the union 
operation over all yellow areas from the inferences obtained with the individual rules. 
rule The inference shown above is based on the max/min representation of a 
base from Eq. 
(25). Taking alternatively the max-prod representation from Eq. (26) 
is  obtained  for  the  max-prod  inference.  The  difference  between  the  max/min  and  max-prod 
inference  is  that  in  the  first  case  the  membership  function  of  the  conclusion  is  cut  and  in  the 
second case scaled. Figure 11 illustrates this. 
 
Figure 11: 
Example: 
the 
inference of the two fuzzy rules 
should be evaluated. The linguistic term S stands for ``small'', M for ``medium'', L for ``large'', N 
for ``negative'' and P for ``positive''. 
Each rule contains two premises, which are differently connected. In rule 1 the connective 
operation is the intersection, which can be performed by the 
operation according to 
Eq. (18) for 
, and in rule 2 the premise is a union of the two 
premises 
operation according 
to Eq. (19) for 
. In the first case the degree of relevance 
is 
.  The  membership  functions  of  the 
conclusion  of  each  rule  will  be  determined  using  the  degree  of  relevance  of  the  corresponding 
rule  by  applying  either  the  max/min  inference  method  according  to  Eq.  (29)  or  the  max-prod 
inference  method  according  to  Eq.  (30).  The  reasoning  process  using  both  inference  methods  is 
visualised in Figure 12. 
Figure 12: Example of the application with two premises with (a) max/min inference and (b) max- prod 
inference 
Fuzzy Logic 

Membership function of a conclusion using (a) max/min and (b) max-prod inference 
For a fuzzy system with the two inputs 
Winter School on "Data Mining Techniques and Tools for Knowledge Discovery in Agricultural Datasets” 
319 

N) and 
and in the second case 
and 
and 
S), which can be performed by the 
and 
and the output 
 
Fuzzy Logic 

11. Defuzzification 
As a result of applying the previous steps, one obtains a fuzzy set 
from the 
reasoning process that describes, for each possible value 
, how reasonable it is to use this 
particular value. In other words, for every possible value 
, one gets a grade of 
membership that describes to what extent this value 
is reasonable to use. Using a fuzzy 
system as a controller, one wants to transform this fuzzy information into a single value 
that  will  actually  be  applied.  This  transformation  from  a  fuzzy  set  to  a  crisp  number  is  called a 
defuzzification  .  It  is  not  a  unique  operation  as  different  approaches  are  possible.  The  most 
important ones for control are described in the following. 
(i) Centre of gravity method (COG) 
This approach has its origin in the idea to select a value 
that, on average, would lead to the 
smallest error in the sense of a criterion. If 
, then 
the error is 
the least squares method can be used. As weights 
for each square 
is a 
reasonable value. As a result one has to find 
Winter School on "Data Mining Techniques and Tools for Knowledge Discovery in Agricultural Datasets” 
320 

(31) 
Differentiating with respect to the unknown 
and equating the derivative to zero, the formula 
(32) 
is obtained, which determines the value of the abscissa of the centre of gravity of the area 
below the membership function 

(ii) Centre of singleton method (COS) 
The defuzzification can be strongly simplified if the membership functions 
of the 
conclusions are singly defuzzified for each rule such that each function is reduced to 
a singleton that has the position 
of the individual membership function's centre of gravity. 
The centre of singletons is calculated by using the degree of relevance as follows: 
(16.6) 
The simplification consists in that the singletons can be determined already during the 
design of the fuzzy system and that the membership function 
with  its  complicated 
geometry  is  no  longer  needed.  The  defuzzification  using  this  formula is an approximation of the 
defuzzification  by  Eq.  (32).  Experiences  from  control  show  that  there  are  slight  differences 
between both approaches, which can be in most cases neglected. 
. Thus, to determine 
, one can take the grade of membership 
is chosen, and the best value is 
with which 
 
(iii) Maximum methods 
This class of methods determines 
by  selecting the membership function with the maximum 
value. If the maximum is a range, either the lower, upper or the middle value is taken for 
depending  on  the  method.  Using  these methods, the rule with the maximum activity 
always  determines  the  value,  and  therefore  they  show  discontinuous  and  step  output  on 
continuous  input.  This  is  the  reason  why  these  types  of  method  are  not  attractive  for  use  in 
controllers. 
(iv) Margin properties of the centroid methods 
As the centre of gravity of the area below the membership functions cannot reach the margins of 
,  the  membership  functions,  which  are  at  the  margins,  must  be  symmetrically 
expanded  when  obtaining  the  centre  of  gravity.  This  is  necessary  in  order  to  have  the full range 
of 
available. This is shown in Figure 13. The same expansion is also necessary for the 
COS method. 
Figure 13: Margin of 
Fuzzy Logic 
Winter School on "Data Mining Techniques and Tools for Knowledge Discovery in Agricultural Datasets” 
321 

(a) original and (b) expanded 

You might also like