Professional Documents
Culture Documents
BY
H.G.Bhatt
Asstt.Professor 1
Fuzzy Sets
2
Membership Functions (MFs)
About MFs
Subjective measures
Not probability functions
.8
.5 “tall” in the US
“tall” in NBA
.1
180 Heights
(cm)
3
Fuzzy If-Then Rules
• Mamdani style
If pressure is high then volume is small
high small
• Sugeno style
If speed is medium then resistance = 5*speed
medium
resistance = 5*speed
4
Fuzzy Inference System (FIS)
.3
.1
2 Speed
Rule 1: w1 = .3; r1 = 2
Rule 2: w2 = .8; r2 = 4*2 Resistance = S(wi*ri) / Swi
Rule 3: w3 = .1; r3 = 8*2 = 7.12
5
ANFIS: Mamdani’s model
Layer 1: input layer
Layer 2: input membership or fuzzification layer
Neurons represent fuzzy sets used in the antecedents of fuzzy rules determine the
membership degree of the input.
Activation fn: the membership fn.
Layer 3: fuzzy rule layer
Each neuron corresponds to a single fuzzy rule.
Conjunction of the rule antecedents: product
Output: the firing strength of fuzzy rule R i , R i = Aj Bk
The weights b/t layer 3 and layer 4 : the normalized degree (k.a. certainty factors)
of confidence of the corresponding fuzzy rules.
They’re adjusted during training.
Layer 4: Output membership layer
Disjunction of the outputs: C i = Rj Rj = ∑ Rj : sum
the integrated firing strength of fuzzy rule neurons R j and R k.
Activation fn: the output membership fn.
Layer 5: defuzzification layer
Each neuron represents a single output.
E.g.) centroid method.
6
ANFIS: Mamdani’s model
Learning
A various learning algorithm may be applied: Back propagation
Adjustment of weights and modification of input/output membership functions.
7
ANFIS: Mamdani’s model
8
First-Order Sugeno FIS
• Rule base
If X is A1 and Y is B1 then Z = p1*x + q1*y + r1
If X is A2 and Y is B2 then Z = p2*x + q2*y + r2
• Fuzzy reasoning
A1 B1 z1 =
w1
p1*x+q1*y+r1
X Y
A2 B2 z2 =
w2 p2*x+q2*y+r2
X Y w1*z1+w2*z2
x=3 y=2 z=
P w1+w2
9
Adaptive Networks
x
z
y
Architecture:
Feedforward networks with diff. node functions
Squares: nodes with parameters
Circles: nodes without parameters
Goal:
To achieve an I/O mapping specified by training data
Basic training method:
Backpropagation or steepest descent
11
Derivative-Based Optimization
12
Fuzzy Modeling
13
Neuro-Fuzzy Modeling
Adaptive networks
Generalization Specialization
14
ANFIS
• Fuzzy reasoning
A1 B1 z1 =
w1
p1*x+q1*y+r1
w1*z1+w2*z2
z= w1+w2
A2 B2 z2 =
w2
p2*x+q2*y+r2
x y
• ANFIS (Adaptive Neuro-Fuzzy Inference System)
A1 w1 w1*z1
x P
S Swi*zi
A2
B1
P w2*z2 / z
y Sw i
B2 w2 S
15
Four-Rule ANFIS
17
Neuro Fuzzy System
a neuro fuzzy system which can automatically generate a complete set of f
uzzy if-then rules, given input-output linguistic values.
Extract fuzzy rules directly from numerical data.
e.g.) 8 rule neuro fuzzy system for XOR operation: 22 2 = 8 rules.
Set the initial weights b/t layer 3-4 to 0.5.
After training, eliminate all rules whose certainty factors are less than some sufficient
ly small number, e.g. 0.1.
18
ANFIS Architecture: Sugeno’s ANFIS
19
ANFIS Architecture: Sugeno’s ANFIS
20
ANFIS Architecture: Sugeno’s ANFIS
where
21
ANFIS Architecture: Sugeno’s ANFIS
22
ANFIS Architecture: Tsukamoto ANFIS
Tsukamoto ANFIS:
23
ANFIS Architecture
Improvement: 2 input first-order Sugeno fuzzy model with 9 rules
How the 2-dimensional input space is partitioned into 9 overlapping fuzzy
regions, each of which is governed by a fuzzy if-then rule.
i.e. The premise part of a rule defines a fuzzy region, while the consequent
part specifies the output within the region.
24
Questions?
25
26
Automatics and Code Design:
FUZZY LOGIC Systems GUI
28
Application: Employer Salary Raise Fuzzy Logic Model
(interpreted) (assigned)
30
Generic Fuzzy Logic Code for Teacher Salary Raise Model
%Establish constants
Teach_Ratio = 0.8
Lo_Raise =0.01;Avg_Raise=0.05;Hi_Raise=0.1;
• Naïve model
Raise_Range=Hi_Raise-Lo_Raise;
Bad_Teach = 0;OK_Teach = 3; Good_Teach = 7; Great_Teach = 10;
Teach_Range = Great_Teach-Bad_Teach;
Bad_Res = 0; Great_Res = 10;
Res_Range = Great_Res-Bad_res;
• Base salary raise +
%If teaching is poor or research is poor, raise is low Work performance
• Base + Development
if teaching < OK_Teach
raise=((Avg_Raise - Lo_Rasie)/(OK_Teach - Bad_Teach)
*teaching + Lo_Raise)*Teach_Ratio
+ (1 - Teach_ratio)(Raise_Range/Res_Range*research
+ Lo_Raise);
& research performance
%If teaching is good, raise is good
elseif teaching < Good_Teach • Base + 80%
raise=Avg_raise*Teach_ratio
+ (1 - Teach_ratio)*(Raise_Range/res_range*research Development and 20%
+ Lo_Raise);
%If teaching or research is excellent, raise is excellent
else
research
raise = ((Hi_Raise - Avg_Raise)/(Great_Teach - Good_teach)
*(teach - Good_teach + Avg_Raise)*Teach_Ratio
+ (1 - Teach_Ratio)
*(Raise_Range/Res_Range*research+Lo_Raise);
31
Fuzzy Logic Model for Employer Salary Raise
Fuzzy Inference
System Editor
Rule Editor
32
Fuzzy Logic Model for Employer Salary Raise
Membership
function
Editor
33
Fuzzy Logic Model for Employer Salary Raise
Rule
Viewer
Surface
Viewer
34
Fuzzy Logic Model for Employer Salary Raise
(interpreted) (assigned)
figure('name',
['Initial plots for the Membership functions for Y',
...
num2str(k)],'NumberTitle','off');
for i=1:col_X
[x,mf] = plotmf(in_fis,'input',i);
subplot(col_X,1,i),
plot(x,mf);
xlabel('input 1');
end
1
1
Deg.Memb.
Deg.Memb.
0.5
0.5
0
0
10 15 20 25 30 35 10 15 20 25 30 35
1 1
Deg.Memb.
Deg.Memb.
0.5 0.5
0 0
0.945 0.95 0.955 0.96 0.965 0.97 0.975 0.98 0.985 0.945 0.95 0.955 0.96 0.965 0.97 0.975 0.98 0.985
water activity (Aw) water activity (Aw)
38
ANFIS for Classifying Salt data
Final membership functions of the input variables
Deg.Memb.
0.5
0
10 15 20 25 30 35
Temprature (T)
1
Deg.Memb.
0.5
0
0.945 0.95 0.955 0.96 0.965 0.97 0.975 0.98 0.985
water activity (Aw)
39
ANFIS for Classifying Salt data
Training confusion matrix
100
50
0
2
1.8 2
1.6 1.8
1.4 1.6
1.2 1.4
1.2
1 1
Test confusion matrix
30
20
10
0
2
1.8 2
1.6 1.8
1.4 1.6
1.2 1.4
1.2
1 1
40
ANFIS for Classifying Salt data
CCR = 0.94
Conf_Mat_training =
41.00 6.00
2.00 77.00
CCR = 0.91
Conf_Mat_test =
24.00 5.00
0 24.00
41
ANFIS for Classifying Salt data
Reg
0.95
KNN
0.9 PNN
FFN
0.85
ANFIS
0.8
Mean of CCR
0.75
0.7
0.65
0.6
0.55
0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 0.22
Standard deviation of CCR
42
ANFIS for Classifying Salt data
43
References and WWW Resources
References:
“Neuro-Fuzzy and Soft Computing”, J.-S. R. Jang, C.-T. Sun and E. Mizut
ani, Prentice Hall, 1996
“Neuro-Fuzzy Modeling and Control”, J.-S. R. Jang and C.-T. Sun, the Pr
oceedings of IEEE, March 1995.
“ANFIS: Adaptive-Network-based Fuzzy Inference Systems,”, J.-S. R. Ja
ng, IEEE Trans. on Systems, Man, and Cybernetics, May 1993.
Internet resources:
44