You are on page 1of 18

ADHIKESAVAN ARAVINDAN-20019794

COMP 4033 – FUZZY LOGIC AND FUZZY SYSTEMS

QUESTION 1:
(a) Classical 2-valued logic are defined by strict boundaries. (i.e., either True(1) or false(1))
and therefore, may not be useful in solving all real-world problems. For example, let’s define
a set such that people with height greater than or equal to 65 inches as tall and below that
are Short. If a person with height 69 inches, then the output will be tall, then it’s fine but for
a person with height 64 inches will be labelled as Short which is unfair interpretation by the
set. To solve this type of inadequacies of classical 2 valued logic sets, Fuzzy logic was
introduced.

(b) Fuzzy sets are the sets which do not have sharp boundaries unlike Classical two-valued
sets. In other words, it allows partial membership which means that it contains elements that
have varying degrees of membership in the set.

(c) ”Bottle X is full” with truth value/fuzzy membership value 0.5 which means that Bottle X’s
degree of membership within the set of full bottle is 0.5
”Bottle Y is full” with probability 0.5 which means there is a 50 % probability that Bottle Y
is full.
With the above differences in definitions, one could draw to the following conclusions:
1) Bottle X cannot be empty whereas Bottle Y has a chance to be empty.
2) We cannot say anything in the case of empty or partially full bottle with respect to the
Bottle Y as we only know only the probability percentage whether the the bottle will be full
or not whereas we can say that Bottle X is partially full.

1
ADHIKESAVAN ARAVINDAN-20019794

(d)Let’s take the term “Too Old”, we can clearly observe that elements in it has varying degree
of membership in the set. Hence, the above said fuzzy set allows partial membership.
When we look at the elements(for example,50) it is a member of “middle-aged” as well as
“Old” at the same time.
Linguistic Variable(Age): A linguistic variable is a collection of fuzzy sets representing linguistic
terms of a concept. It collects elements into similar groups where we can deal with less
precisely and hence we can handle complex problems. In simple words, it is a variable made
up number of words(linguistic terms) with associated degree of membership.

(e) T-norms(triangular norms) and T-conorms(triangular co-norms) is used to carry out fuzzy
set operations.
If A,B are two fuzzy sets with membership function μA, μB , then the T-norm(fuzzy
intersection) C of A and B has membership function μA ∩ B(x) = T[μA(x), μB(x)]. Depending on
the choice of T-norm we can get different fuzzy intersections. The T-norm operator denoted
by T(a,b) is a function mapping [0,1] x [0,1] to [0,1] that satisfies the following conditions for
any a,b,c,d € [0,1]
Boundary: T(0,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)

2
ADHIKESAVAN ARAVINDAN-20019794

The most two common T-norms are Minimum T-norms and Product T-Norms. The following
plots have been obtained using R. One can easily observe that minimum T-norm is the normal
intersection. Tm(a,b) = min(a,b) = a ∧ b.

Product T-norm intersection is the algebraic product of a and b.(i.e., Ta(a,b) = a.b). The result
of product T-norm intersection can be observed from the above plot.

3
ADHIKESAVAN ARAVINDAN-20019794

If A,B are two fuzzy sets with membership function μA, μB , then the T-conorm(fuzzy union)
C of A and B has membership function μA ∪ B(x) = u[μA(x), μB(x)].Depending on the choice of
T-conorm we can get different fuzzy unions.
T-conorm operator can also be denoted by S-norm. Using it here for convenience to
understand,
The S-norm operator denoted by S(a,b) is a function mapping [0,1] x [0,1] to [0,1] that satisfies
the following conditions for any a,b,c,d € [0,1]
Boundary: S(0,0)= 0, S(a,1) = S(1,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)
The most two common S-norms are Maximum S-norms and Bounded S-norms. One can
easily observe that maximum S-norm is the normal union. Sm(a,b) = max(a,b) = a νb.

4
ADHIKESAVAN ARAVINDAN-20019794

Bounded S-norm union is defined by max{0, (a+b-1)}. One can observe the union of bounded
S-norm from the above plot.

------------------------------------------------ please scroll next page-------------------------------------------

5
ADHIKESAVAN ARAVINDAN-20019794

QUESTION 2:
(a)

6
ADHIKESAVAN ARAVINDAN-20019794

7
ADHIKESAVAN ARAVINDAN-20019794

8
ADHIKESAVAN ARAVINDAN-20019794

9
ADHIKESAVAN ARAVINDAN-20019794

Output set: 0.4/0 + 0.4/1 + 0.4/2 + 0.4/3 + 0.5/4 + 0.5/5 + 0.5/6 + 0.3/7 + 0.1/8 + 0/9 +0/10

10
ADHIKESAVAN ARAVINDAN-20019794

(b) Alternative methods for numeric defuzzification:


1) Centre of gravity method: It is one of the common defuzzication technique to defuzzify
the outputs sets. The aim of this method is to find out the imaginary balance point in the total
area of the membership function distribution. To find out the point, the total area of the
membership function is divided into number of sub-areas, then the area and centroid of each
sub-area is calculated and the summation of all these sub-areas is taken to find the defuzzified
value of the discrete fuzzy set.
Formula:

Output set: 0.4/0 + 0.4/1 + 0.4/2 + 0.4/3 + 0.5/4 + 0.5/5 + 0.5/6 + 0.3/7 + 0.1/8 + 0/9 +0/10
Using Center of gravity method:
=(0.4*0 + 0.4*1 + 0.4*2 + 0.4*3 + 0.5*4 + 0.5*5 + 0.5*6 + 0.3*7 + 0.1*8 + 0*9 + 0*10)/ (0.4 +
0.4 + 0.4 + 0.4 + 0.5 + 0.5 + 0.5 + 0.3 + 0.1 + 0 + 0)
=12.8/3.5
=3.66

2) Mean of maxima method: The element with the maximum membership values is taken
as defuzzified value. When there are more than one element having maximum membership
values, the mean value of the maxima is taken.
Formula:

Output set: 0.4/0 + 0.4/1 + 0.4/2 + 0.4/3 + 0.5/4 + 0.5/5 + 0.5/6 + 0.3/7 + 0.1/8 + 0/9 +0/10
Using Mean of maxima method:
Maximum membership value = 0.5
Elements with maximum membership values = 4, 5, 6
Mean(4,5,6) = 15/3 = 5

11
ADHIKESAVAN ARAVINDAN-20019794

(c) Example set 1 : (taken from part(a))


0.4/0 + 0.4/1 + 0.4/2 + 0.4/3 + 0.5/4 + 0.5/5 + 0.5/6 + 0.3/7 + 0.1/8 + 0/9 +0/10
Example set 2 :
0.1/0 + 0.2/1 + 0.3/2 + 0.4/3 + 0.8/4 + 0.8/5 + 0.8/6 + 0.6/7 + 0.4/8 + 0.3/9 +0.1/10
Let’s defuzzify both the example set 1 and 2 with the Mean of maxima method:
Using mean of maxima method on example set 1,
Maximum membership value = 0.5
Elements with maximum membership values = 4, 5, 6
Mean(4,5,6) = 15/3 = 5

Using mean of maxima method on example set 2,


Maximum membership value = 0.8
Elements with maximum membership values = 4, 5, 6
Mean(4,5,6) = 15/3 = 5

Surprisingly, both the example sets gives same defuzzified value “5”. But when we observe
the sets, one can clearly understand that both are entirely different sets. To distinguish
between two sets, one can look out for other numeric metrics such as
1)Membership grade value at defuzzification point(indicates the confidence of the result)
2)Maximum membership grade values(measure of maximum strength of rules fired)
3)Calculation of other numeric metrics such as Normalised Area and Fuzzy entropy
Formulas of Normalised area and fuzzy entropy:

Membership grade value at defuzzification point of set A and set B are 0.5 and 0.8 and
moreover maximum membership grade value of set A and B are 0.5 and 0.8 respectively. So,
we can clearly distinguish these sets by using the above said metrics.

12
ADHIKESAVAN ARAVINDAN-20019794

QUESTION 3:
(a) The Sugeno Fuzzy model (also known as the TSK fuzzy model) was proposed by Takagi,
Sugeno, and Kang in an effort to develop a systematic approach to generating fuzzy rules
from a given input-output dataset. A typical fuzzy rule in a Sugeno fuzzy model has the
form:
If x is A and y is B then Z=f(x,y)
where x, y and z are linguistic variables
A and B are fuzzy sets on universe of discourses X and Y
f (x, y) is a mathematical function
Now, answering our question, (Conversion of Mamdani to TSK)
We should understand that Zeroth order TSK inference system is a special case of Mamdani
inference systems in which each rule’s consequent is specified by a fuzzy singleton (or a pre-
defuzzified consequent). A fuzzy singleton is a fuzzy set with a membership function that is
unity at a single particular point on the universe of discourse and zero everywhere else.
In simple words, TSK model ignores the fuzziness of linguistic variables in the consequent, but
accounts for the fuzziness of variables in the antecedants.
Rules in a Mamdani form are converted to Zeroth order TSK form:
R1: IF Code is poor OR Report is poor OR Engagement is poor, THEN Grade is z1
R2: IF Code is average AND Report is average AND Engagement is average THEN Grade is z2
R3: IF Code is good AND Report is good AND Engagement is good THEN Grade is z3
R4: IF Code is good AND Report is average, THEN Grade is z4
R5: IF Report is good AND Engagement is average, THEN Grade is z5
R6: IF Code is average AND Report is average AND Engagement is good, THEN Grade is z6
Now, the resulting TSK inference systems have constant(zeroth order) output membership
function(z1,z2…z6) that corresponds to the centroids of the Mamdani output membership
functions.
Then, the antecedents are evaluated as per Mamdani to find the firing strength (truth) of
each rule: wi. The weighted average of the zi associated with each rule gives the overall
output.

13
ADHIKESAVAN ARAVINDAN-20019794

TSK inference process on every rule:

Each rule generates two values:


• zi — Rule output level, which is either a constant value or a linear function of the input
values:
zi=ax+by+c (generalised form)
Here, x and y are the values of input 1 and input 2, respectively, and ai, bi, and ci are constant
coefficients. For a zeroth-order TSK system, zi is a constant (a = b = 0).
• wi — Rule firing strength derived from the rule antecedent
wi = AndMethod(F1(x),F2(y))
Here, F1(...) and F2(...) are the membership functions for inputs 1 and 2, respectively.
The output of each rule is the weighted output level, which is the product of wi and zi.
Since each rule has a crisp output, the overall output is obtained via weighted average, thus
avoiding the time-consuming process of defuzzification required in a Mamdani model.

14
ADHIKESAVAN ARAVINDAN-20019794

(b) A first-order Sugeno system has rules of form:


IF x is A1 AND y is B1 THEN z = p1x + q1y + r1
IF x is A2 AND y is B2 THEN z = p2x + q2y + r2
...
IF x is An AND y is Bn THEN z = pnx + qny + rn where pi , qi and ri are constants
We know that from last part, for zeroth-order TSK (pn = qn =0).
Now, we can understand the difference between first order TSK and zeroth order TSK is the
computation of the consequent output for each rule.
First-order TSK : First order polynomial function
Zeroth-order TSK: Constant function

Let’s take the example of tipper problem’s 3-D surface to examine the difference of Zeroth-
order TSK and First order TSK.

FIG 1: First-order TSK(left-most) and First order TSK(right)

First order TSK rules,


If Service is poor or Food is rancid then Tip = service + food + 5
If Service is good then Tip = service + food + 15
If Service is excellent or Food is delicious then Tip = service + food + 25
In the case of Tipper problem, First-order TSK is roughly same as the addition of Service+ food
with the zeroth-order.

15
ADHIKESAVAN ARAVINDAN-20019794

(c)
MAMDANI FIS TSK FIS
Through defuzzification of rules consequent No defuzzification here. Using weighted
of crisp result is obtained average of the rules of consequent crisp
result is obtained
The output of surface is discontinuous The output of surface is continuous
Output membership function is present No output membership function is present
It is using in MISO (Multiple Input and It is using only in MISO (Multiple Input and
Single Output) and MIMO (Multiple Input Single Output) systems
and Multiple Output) systems
Antecedent evaluation is the same Antecedent evaluation is the same
Implication operates across consequent set Implication is single multiplication (perhaps
e.g. 101 min operations across universe three for 1st order)
(per rule)
Aggregation operates across each rule Single summation
result set e.g. 101 x #rules max operations

TSK inference systems were proven to be more computationally efficient with similar results
(i.e., works well with linear techniques. Hence, it is used most often on control applications)

------------------------------------------------ please scroll next page-------------------------------------------

16
ADHIKESAVAN ARAVINDAN-20019794

QUESTION 4:
(a) i)Structure of Fuzzy model: It includes finding the number of linguistic variables needed,
appropriate fuzzy membership functions, formation of rules, choosing appropriate defuzzifier
etc for the corresponding fuzzy model.
ii)Parameters of Fuzzy model: It includes finding the exact values of the membership
function parameters, rule weights, defuzzification parameters, etc for the corresponding
fuzzy model.
iii)Direct and Indirect Objective functions: it includes maximising Objective
functions/performance of the corresponding fuzzy model’s aim. For example, in tipper
problem, the fundamental aim was to maximise the tip. So, here objective function is ‘tip’.
Indirective objective function comes into play when there is no pre-specified target output
for the fuzzy model. For example, recommendation of buying/selling shares because we don’t
have a measure whether the recommendations are good or bad.

(b) Our aim is to predict monthly energy consumption for households in Nottingham from
historical data such as number of rooms, number of occupiers, smart meter readings. Now,
we are trying to find the best optimised parameter values for the membership function of
the FIS. We can achieve this by many ways. But for this problem as described, let’s focus on
three tuning methods.
1)Exhaustive search: Basically, a brute force search to find the best optimised value for the
parameters. This cannot be done for most real problems – there are too many combinations
and too computationally expensive.
2) Hill climbing with random initialisation: In this method, we are starting at random position
in the search space and evaluating the current position. Then, at each step , we evaluate our
surroundings and move where we get better values. Since this is heuristic algorithm, this is
guaranteed to find local maximum at least but may not be the best(global maxima). I would
recommend this method for finding the optimised parameters of the membership function
of the given fuzzy interference model since it at least ensures to provide better parameter
values in a given time
3) Monte-Carlo method: In this method, we randomly start at the position of the search space
, evaluate it and store it as a best and repeat the process(i.e., randomly initialising at a new
position and evaluate it). If the new position is better than best we have found before, replace
it and repeat the process until you are satisfied. It is somewhat effective on finding the best
parameter values.

17
ADHIKESAVAN ARAVINDAN-20019794

(c) In this study engine size, fuel consumption, number of seats, and price have been taken
for aircraft classification. Aircrafts are manually grouped into three major categories:
Passenger aircraft, Helicopter and Military aircrafts.
Adaptive-Neuro-fuzzy(ANFIS) techniques has developed from the combination of artificial
neural networks and fuzzy inference systems. When these two systems are linked, they may
qualitatively and quantitatively obtain an appropriate result. To make adaptive Neuro-fuzzy
inference system, training, testing and checking data sets is required. To start ANFIS learning,
first one needs to have a training data set that contains desired input/output data pairs of
the target system to be modelled. If one has information on desirable membership functions
with detailed parameters or shapes, he can build a fuzzy inference system(manually by
Mamdani model). If one does not have any idea of what the initial membership functions
should look like, he can use grid partition or a sub clustering to create an initial Fuzzy
interference systems. Initial FIS can be train either by back propagation gradient descent
algorithm or by a hybrid algorithm as an optimization method after setting out the stopping
criteria i.e. number of training epochs and training error tolerance. The training process stops
whenever the maximum epoch number is reached or the training error goal is achieved.
Problem associated with models is the selection of representative data which the trained
model is intended to emulate, yet sufficiently distinct from the training data set so as not to
render the validation process trivial. If the collected dataset is huge in quantity, then the
probability of data containing the necessary representative features will be high. Thereby, it
becomes easier to select the data set for checking or testing purposes. However, if noisy
measurements are expected to be presented to the model, it is probable that the training
data set does not include all of the representative features, desired to model. The testing
data is used to check the generalization capability of the resulting fuzzy inference system. It
is observed that after a certain point in training, the model begins overfitting the training data
set. In order to avoid this, checking data set for model validation is used. Generally, there is
a decrease in the model error in the checking data set as the training takes place up to the
point where overfitting begins, and then there is a sudden increase. Overfitting is accounted
by testing the FIS trained on the training data against the checking data and choosing the
membership function parameters that are associated with the minimum checking error if
these errors indicate model overfitting.

------------------------------------------------------THE END--------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------

18

You might also like