introduction to fuzzy systems
TRANSCRIPT
-
8/7/2019 Introduction to Fuzzy Systems
1/38
Total Slides 37 1
INTRODUCTION TO
FUZZY SYSTEMS
By
Dr. M. Tahir Khaleeq
-
8/7/2019 Introduction to Fuzzy Systems
2/38
2
Fuzzy Sets
Fuzzy logic is an approach to uncertainty that combines
real values [0,1] and logic operations
Fuzzy logic is based on the ideas of fuzzy set theory and
fuzzy set membership.Ex: He is very tallp how does this differ from tall?
In normal sets, membership is binary.
An item is either in the set or not in the set.
Ex: U = { 1,2,3,4,5,6,7,8,9}
A = {1,3,5,7,9}
B = {2,4,6,8}.
-
8/7/2019 Introduction to Fuzzy Systems
3/38
3
Fuzzy Sets (continue)
In fuzzy sets, membership is based on a degreebetween 0 and 1
0 means that the object is not a member of the set
1 means that the object belongs entirely to the set If degree is between 0 and 1, then this degree is the
degree to which the item is thought to be in the set.
Each value of the function is called a membership
degree.
Ex: Jun is 43, 1.0 in set Hot
August is 40, 0.7 in set Hot
September is 35, 0.2 in set Hot
-
8/7/2019 Introduction to Fuzzy Systems
4/38
4
Fuzzy Sets (continue)
The notion of the fuzzy set was introduced by Lotfi Zadehin 1965.
Fuzzy sets have imprecise boundaries.
Transition between fuzzy sets is gradual.
Fuzzy v Crisp:
Fuzzy (approximate) Crisp (precise)
- Elements can belong to Elements belong to one
two sets at same time. set or the other only.- cold, warm, hot 20, 30, 40 (C)
- slow, normal, fast 50, 70, 100 (km/h)
- dry, normal, humid 10, 25, 75 (% R.H.)
-
8/7/2019 Introduction to Fuzzy Systems
5/38
5
Fuzzy Sets (continue)
Difference between an ordinary (crisp set) and a fuzzy setis shown in the figure
cool medium
Fuzzy setmedium
Crisp set
Crisp sets use clear cut
on the boundaries.
Fuzzy sets use grades.
Ex: values 14.99 and 15.01.
- Belong to the fuzzy set
medium.- Associated with different
crisp sets, cool and
medium.
-
8/7/2019 Introduction to Fuzzy Systems
6/38
6
Fuzzy Sets (continue)
Example: Three fuzzy sets , values of a variable height are:short, medium, tall.
Medium TallShort
Height (cm)
25017030
0.2
0.7
1 The value 170cm belongs
to fuzzy set medium to a
degree of 0.2 and at the
set tall to a degree of 0.7.
-
8/7/2019 Introduction to Fuzzy Systems
7/38
7
Conceptualizing in Fuzzy terms
The representation of a problem in fuzzy terms is called
conceptualization in fuzzy terms.
Linguistic terms are used in the process of identification
and specification of a problem and construction of rules.
Ex: higher, lower, very strong, slowly, much dependent,
less dependent, good, bad etc.
Linguistic variable is a variable which takes fuzzy values
and has a linguistic meaning.
Ex: Linguistic variable: Velocity.
Value: low, moderate, or high.
-
8/7/2019 Introduction to Fuzzy Systems
8/38
8
Conceptualizing in Fuzzy terms (continue)
Linguistic values are also called fuzzy labels, fuzzy
predicates, or fuzzy concepts.
Linguistic values have semantic meaning and can be
expressed numerically by their membership functions.
Linguistic variables can be
Quantitative
Ex: temperature: low, high
time: early, late
Qualitative
Ex: truth, certainty, belief
The process of representing a linguistic variable into a set
of linguistic values is called fuzzy quantization.
-
8/7/2019 Introduction to Fuzzy Systems
9/38
9
Crisp Membership Function
Rule: IF temp >37 THEN day = hot.
Precise value of set { hot } at 37 C
Each temp U belongs to only one set.
1.0
0.8
0.6
0.4
0.2
0
35 36 37 38 39 40
hot
Temp (C)
U
Q
-
8/7/2019 Introduction to Fuzzy Systems
10/38
10
Fuzzy Membership Functions
Following are the most useful membership functions in
fuzzy expert systems design:
1. Single-valued (Singleton)
2. Triangular
3. Trapezoidal
4. S-function (sigmoid function)
5. Z-function
6.4 function (bell function
-
8/7/2019 Introduction to Fuzzy Systems
11/38
11
Single-valued (Singleton)
U = b. B is a scalar value
UbTriangular Function
The triangular functions are uniformly distributed over
the universe U.
-
8/7/2019 Introduction to Fuzzy Systems
12/38
12
Membership function (for a
-
8/7/2019 Introduction to Fuzzy Systems
13/38
13
Trapezoidal Function
Member ship function (for a e b < c e d )
m x a b c,dx a
b a
d x
d ctrap( ; , , ) max{min{ , },!
1, 0 },
- Fuzzy membership foru between 36 and 38 C as uU
- About half of persons would call the day hot when the
temp is 37 C. m(T) represents the fraction of people,
who would assign the term hot to the day.
-
8/7/2019 Introduction to Fuzzy Systems
14/38
14
S-Function (sigmoid function)
Member function for a
-
8/7/2019 Introduction to Fuzzy Systems
15/38
15
Fuzzy Logic
Just as fuzzy sets are an extension to sets, fuzzy logic isan extension to classical logic.
Fuzzy logic is a multi-valued logic while the classical
logic is a binary logic.
Classical logic holds that every thing can be expressed in
binary terms: 0 or 1, black or white, yes or ne, in terms of
Boolean algebra, every thing is in one set or another butnot in both.
Fuzzy logic allows for values between 0 and 1, shades of
gray and may be partial membership in a set.
-
8/7/2019 Introduction to Fuzzy Systems
16/38
16
Fuzzy Logic (continue)
When the approximate reasoning of fuzzy logic is usedwith an expert system, logical inferences can be drawn
from imprecise relationships.
EX: To optimize automatically the wash cycle of a
washing machine by sensing
the load size
fabric mix, and
quantity of detergent. The most distinguishing property of fuzzy logic is that
deal with fuzzy propositions, which contain fuzzy
variables and fuzzy values.
-
8/7/2019 Introduction to Fuzzy Systems
17/38
17
Fuzzy Rules
Several types of fuzzy rules have been used for fuzzy
knowledge engineering.
IF x is A THEN y is B
Where (x is A) and (y is B) are two fuzzypropositions:
x and y are fuzzy variables defined overuniverse
of discourse U and V respectively; and
A and B are fuzzy sets defined by their fuzzy
membership functions
A : U p [0,1], B : V p [0,1]
-
8/7/2019 Introduction to Fuzzy Systems
18/38
18
May contain AND, OR, NOT and other operators
The conclusion is computed by applying these fuzzy
operators to the fuzzified inputs
Implication operation will be applied to rule outputExample: IF day is hot THEN drink lots of water
Fuzzy Rules (continue)
-
8/7/2019 Introduction to Fuzzy Systems
19/38
19
The rule would recommend to drink 6 - 10 glasses ofwater.
The implication of the rule will be the minimum of theintersection of the 0.7 membership line with the lotsof implication weight function.
Fuzzy Rules (continue)
m x y m x m yA B A Bp !( , ) min[ ( ), ( )]
-
8/7/2019 Introduction to Fuzzy Systems
20/38
20
Fuzzification
When the input data are crisp then the fuzzification is
applied over fuzzy rules of the type
IF x1 is A1 AND x2 is A2 THEN y is B.
Fuzzification is the process of finding the membership
degrees A1(x1) and A2(x2) to which input data x1and x2 belong to the fuzzy sets A1 and A2 in the
antecedent part of a fuzzy rule.
-
8/7/2019 Introduction to Fuzzy Systems
21/38
21
Crisp input x is input to fuzzy membership function m(x)Example: Temperature = 37.4 degC
Result is fuzzy degree of membership
Example: Membership in hot is 0.7
Fuzzification (continue)
-
8/7/2019 Introduction to Fuzzy Systems
22/38
22
RULE EVALUATION
Rule evaluation takes place after the fuzzificationprocedure.
It deals with single values of membership degreesmA(x) and mA(y) and produces output membership
function. There are two major methods which can be applied:
1. Minimum inference:
2. Product inference:m x y m x m yp !( , ) min[ ( ), ( )]
m x y m x m yA B A Bp !( , ) ( ) ( )
-
8/7/2019 Introduction to Fuzzy Systems
23/38
23
DEFUZZIFICATION
If the output is crisp then the defuzzification is applied
over fuzzy rules.
Defuzzification is the process of calculating a single-
output numerical value for a fuzzy output variable on
the basis of the inferred resulting membership function
for this variable.
Following two methods are widelyused
1. The Center-of-Gravity method (COG)
2. The Mean-of-Maxima method (MOM)
-
8/7/2019 Introduction to Fuzzy Systems
24/38
24
The Center-of-Gravity Method
This method finds the geometical centre y in theuniverse V of an output variable y, which is center
balance the inferred membership function B as a fuzzy
value fory.
The Mean-of-Maxima Method
This method finds the value y for output variable ywhich has maximum membership degree according to
the fuzzy membership function B.
If values have maximum values then find mean of them.
y =7
v . mB(v)7 mB(v)
-
8/7/2019 Introduction to Fuzzy Systems
25/38
25
0.7
1 2 3 40
1
1.51.9
y'(MOM)
y'(COG)
y'(COG) =(0 0) + (1 1) + (1 2) + (0.7 3)
1 + 1 + 0.7} 1.9
y'(MOM) = = 1.51 + 2
2
y
Example
-
8/7/2019 Introduction to Fuzzy Systems
26/38
26
Fuzzy Expert System
A fuzzy expert system is like an ordinary expert system
but methods of fuzzy logic are applied.
Fuzzy expert systems use:
Fuzzy data (fuzzy input and output variables)
Fuzzy rules
Fuzzy inference
Other components of the ordinary expert system
-
8/7/2019 Introduction to Fuzzy Systems
27/38
27
Fuzzy Rule Base Learning Fuzzy Rules
Fuzzy Inference
MachineData Base (Fuzzy)
Fuzzification
DefuzzyficationMembership
Function
User Interface
Fuzzy data/Exact data
Fuzzy queries/Exact queries
Block diagram of a fuzzy expert system
-
8/7/2019 Introduction to Fuzzy Systems
28/38
28
1. Fuzzy Rule-Base
The fuzzy rules and the membership functions make up
the system knowledge base.
Some systems use production rules extended with fuzzy
variables and confidence factors.
Different types of production rules can be used:antecedent part p consequent part
Crispp Crisp (CF)
Crispp Fuzzy (CF)Fuzzyp Crisp (CF)
Fuzzyp Fuzzy (CF)
-
8/7/2019 Introduction to Fuzzy Systems
29/38
29
2. Data-Base
Data can be exact or fuzzy data with certainty factors.
Ex: economic situation good CF = 0.95
3. Fuzzy Inference Machine
A fuzzy inference machine is built on the theoretical
basis of fuzzy inference methods
A fuzzy inference machine activates all the satisfied
rules at every cycle.
A characteristic of fuzzy expert system is the realizationof partial match between exact or fuzzy facts.
A rule is fired only if the matching degree of the left
hand side of the rule is greater than a predefined
threshold.
-
8/7/2019 Introduction to Fuzzy Systems
30/38
30
A measure of the degree of matching is calculated for
every case.
Ex: f uzzy fact --- fuzzy condition
Crisp fact --- fuzzy condition
fuzzy fact --- exact condition
crisp fact --- exact condition
4. Fuzzification and Defuzzification
These may be used according to the type of inference
machine implemented in the fuzzy expert system.
-
8/7/2019 Introduction to Fuzzy Systems
31/38
31
5. User Interface
The interface unit communicates with the user or the
environment, or both for collecting input data andreporting output results.
Fuzzy queries might be possible when the user inputinformation in fuzzy terms.
Ex: high temperature, severe headache etc.6. Learning Fuzzy Rules
This is optional module.
Learning can take place either before the inference
machine starts the reasoning process, or during the fuzzyinference process.
If learning takes place before the inference machinestarts the learning module uses AI machine learning
methods or neural networks.
-
8/7/2019 Introduction to Fuzzy Systems
32/38
32
If the learning takes place during the fuzzy inference
process the fuzzy neural networks can be used forlearning.
7. Explanation
The explanation module explains the way the expert
system is functioning during the inference process or
explains how the final solution has been reached.
The system mayuse fuzzy terms for explanation as well as
exact terms and values.
-
8/7/2019 Introduction to Fuzzy Systems
33/38
33
Fuzzy System Design
The following are the main steps of the fuzzy systemdesign:
1. Identification the Problem
Identify the problem and choosing the type of fuzzy
system, which best suits the problem requirements. A modular system can be designed consisting of several
modules linked together.
The modular approach simply the design of the whole
system, reduce the complexity and make the system morecomprehensible.
2. Defining the Input and Output Variables:
Define the input and output variables, their fuzzy values
and their membership functions.
-
8/7/2019 Introduction to Fuzzy Systems
34/38
34
3. Articulating the Set of Fuzzy Rules
4. Choosing the fuzzy inference method, fuzzification and
defuzzification methods if necessary.
5. Experiment and Validate the System
Experimenting with the fuzzy system prototype,
drawing the goal function between input and output fuzzyvariables,
changing the membership functions and fuzzy rules ifnecessary,
tuning the fuzzy system,
validation of the results.
-
8/7/2019 Introduction to Fuzzy Systems
35/38
35
Methods for Obtaining Fuzzy Rules
The main problem in building fuzzy expert systems is thatof articulating the fuzzy rules and membership functionsfor the fuzzy terms.
Some methods for obtaining fuzzy rules are as follows:
1. Interview an Expert Sometimes, communication between expert and
interviewer can be difficult because of a lake of commonunderstanding.
The shape of membership functions, the number of labels,and so forth should be defined by the expert. But,sometimes the human expert is unfamiliar with fuzzy setsor fuzzy logic and the knowledge engineer is unfamiliar
with the domain area.
-
8/7/2019 Introduction to Fuzzy Systems
36/38
36
2. Imagine the Behavior of the System
The system designer has to be particularly experienced
with the system in order to imagine physical behavior of
the system and think about physical meaning in natural
and technical languages.
3. Using Learning Methods
Use the methods of machine-learning, neural networks,
and genetic algorithms to learns fuzzy rules from dataand to learn membership functions if they are not given
in advance.
-
8/7/2019 Introduction to Fuzzy Systems
37/38
37
END
-
8/7/2019 Introduction to Fuzzy Systems
38/38
38
All lectures are available on
www.geocities.com/mtkhaleeq/AI.htm