Unformatted text preview: ecture Lecture 4 Fuzzy expert systems: Fuzzy
Fuzzy logic Fuzzy Introduction, or what is fuzzy thinking? Fuzzy sets Linguistic variables and hedges Operations of fuzzy sets Fuzzy rules Summary
1 Introduction, or what is fuzzy thinking? Introduction,
Experts rely on common sense when they solve when problems. How can we represent expert knowledge that uses vague and ambiguous terms in a computer? Fuzzy logic is not logic that is fuzzy, but logic that is used to describe fuzziness. Fuzzy logic is the theory of fuzzy sets, sets that calibrate vagueness. Fuzzy logic is based on the idea that all things admit of degrees. Temperature, height, speed, distance, beauty – all come on a sliding scale. The motor is running really hot. Tom is a very tall guy. motor really Tom guy.
2 Boolean logic uses sharp distinctions. It forces us Boolean to draw lines between members of a class and nonto members. For instance, we may say, Tom is tall because his height is 181 cm. If we drew a line at 180 cm, we would find that David, who is 179 cm, is small. Fuzzy logic reflects how people think. It attempts Fuzzy to model our sense of words, our decision making and our common sense. As a result, it is leading to new, more human, intelligent systems. new, 3 Fuzzy, or multivalued logic was introduced in the Fuzzy, 1930s by Jan Lukasiewicz , a Polish philosopher. Jan While classical logic operates with only two values 1 (true) and 0 (false), Lukasiewicz introduced logic (true) that extended the range of truth values to all real numbers in the interval between 0 and 1. He used a numbers number in this interval to represent the possibility that a given statement was true or false. For example, the possibility that a man 181 cm tall is really tall might be set to a value of 0.86. It is likely that the man is tall. This work led to an inexact reasoning technique often called possibility theory. theory
4 In 1965 Lotfi Zadeh, published his famous paper In Lotfi published “Fuzzy sets”. Zadeh extended the work on possibility theory into a formal system of mathematical logic, and introduced a new concept for applying natural language terms. This new logic for representing and manipulating fuzzy terms was called fuzzy logic, and Zadeh became the fuzzy and Master of fuzzy logic. Master fuzzy 5 Why fuzzy? As Zadeh said, the term is concrete, immediate and As descriptive; we all know what it means. However, many people in the West were repelled by the word fuzzy , fuzzy because it is because Why logic? usually used in a negative sense. Fuzziness rests on fuzzy set theory, and fuzzy logic is just a small part of that theory. 6 Fuzzy logic is a set of mathematical principles for knowledge representation based on degrees of membership. Unlike twovalued Boolean logic, fuzzy logic is multivalued. It deals with degrees of It degrees membership and degrees of truth. Fuzzy logic membership degrees uses the continuum of logical values between 0 (completely false) and 1 (completely true). Instead of just black and white, it employs the spectrum of colours, accepting that things can be partly true and partly false at the same time.
7 Range of logical values in Boolean and fuzzy logic 0 01 01 1 00 0.2 0.4 0.6 0.8 11 (a) Boolean Logic. (b) Multivalued Logic . 8 Fuzzy sets The concept of a set is fundamental to The mathematics. However, our own language is also the supreme However, expression of sets. For example, car indicates the set of cars. When we say a car , we mean one out of the of When car set of cars. set 9 The classical example in fuzzy sets is tall men. tall The elements of the fuzzy set “tall men” are all men, but their degrees of membership depend on their height. their 10 Crisp and fuzzy sets of “tall men”
Degree of Membership 1. 0 0. 8 0. 6 0. 4 0. 2 0. 0 150 Degree of Membership 1. 0 0. 8 0. 6 0. 4 0. 2 0. 0 150 160 170 180 190 200 210 Height, cm
11 Crisp Sets 160 170 180 Fuzzy Sets 190 200 210 Height, cm The xaxis represents the universe of discourse – The axis the range of all possible values applicable to a chosen variable. In our case, the variable is the man height. According to this representation, the universe of men’s heights consists of all tall men. universe The yaxis represents the membership value of the The axis fuzzy set. In our case, the fuzzy set of “tall men” fuzzy maps height values into corresponding membership values. values. 12 A fuzzy set is a set with fuzzy boundaries. Let X be the universe of discourse and its elements Let be denoted as x. In the classical set theory, crisp In set A of X is defined as function f (x) called the (x)
1, i f x ∈ A f characteristic1}, whereof AA ( x) = fA(x): X →{0, function ): {0, 0, i f x ∉ A
A This set maps universe X to a set of two elements. This to For any element x of universe X, characteristic For function fA(x) is equal to 1 if x is an element of set function is is A, and is equal to 0 if x is not an element of A. and
13 In the fuzzy theory, fuzzy set A of universe X is In defined by function µA(x) called the membership called function of set A
µ A(x): X → [0, 1], where µ A(x) = 1 if x is totally in A; [0, if µ A (x) = 0 if x is not in A; if 0 < µ A (x) < 1 if x is partly in A. if This set allows a continuum of possible choices. For any element x of universe X, membership For function µ A(x) equals the degree to which x is an function equals is element of set A. This degree, a value between 0 element and 1, represents the degree of membership, also and degree called membership value, of element x in set A. called membership of
14 How to represent a fuzzy set in a How computer? computer? First, we determine the membership functions. In First, our “tall men” example, we can obtain fuzzy sets of our example, tall, short and average men. tall men. The universe of discourse – the men’s heights – The consists of three sets: short, average and tall men. short tall As you will see, a man who is 184 cm tall is a As member of the average men set with a degree of membership of 0.1, and at the same time, he is also a member of the tall men set with a degree of 0.4. set 15 Crisp and fuzzy sets of short, average and tall men Crisp
Degree of Membership 1.0 0.8 0.6 0.4 0.2 0.0 150 Degree of Membership 1.0 0.8 0.6 0.4 0.2 0.0 150 160 170 180 190 200 210
16 Crisp Sets Short Average Tall 160 170 180 Fuzzy Sets 190 200 210 Height, cm Short Average Tall Representation of crisp and fuzzy subsets Representation
X Fuzzy Subset A µ (x ) 1 Crisp Subset A 0 Fuzziness x If X is the reference super set and A is a subset of X, then A is said to be a fuzzy subset of X if ,and only if then A={(x, µA(x))} x € X, µA(x):X[0,1]
17 Linguistic variables and hedges At the root of fuzzy set theory lies the idea of At linguistic variables. linguistic A linguistic variable is a fuzzy variable. For linguistic example, the statement “John is tall” implies that the linguistic variable John takes the linguistic value tall. tall 18 In fuzzy expert systems, linguistic variables are used in fuzzy rules. For example: IF wind is strong IF wind THEN sailing is good THEN sailing IF project_duration is long IF project_duration THEN completion_risk is high THEN completion_risk IF speed is slow IF speed THEN stopping_distance is short THEN stopping_distance 19 The range of possible values of a linguistic variable The represents the universe of discourse of that variable. For example, the universe of discourse of the linguistic variable speed might have the range between 0 and 220 km/h and may include such fuzzy subsets as very slow, slow, medium, fast, and very slow medium fast and very fast. very A linguistic variable carries with it the concept linguistic of fuzzy set qualifiers, called hedges. hedges Hedges are terms that modify the shape of fuzzy Hedges sets. They include adverbs such as very, very somewhat, quite, more or less and slightly. somewhat quite slightly
20 Fuzzy sets with the hedge very Fuzzy very
Degree of Membership 1.0 0.8 0.6 0.4 0.2 0.0 150 160 170 180 190 200 210 Height, cm Very Short Very Tall Very Tall Tall Short Average Short Tall For example a man who is 185 cm tall. He is a member of the tall men set with the degree of membership of 0.5.However he is also a member of the set of very tall men with a degree of 0.15, which is fairly reasonable. 21 Representation of hedges in fuzzy logic
Hedge A little Mathematical Expression Graphical Representation [µA ( x )]1.3 Slightly [µA ( x )]1.7 [µA ( x )]2 Very Extremely [µA ( x ) ]3
22 Representation of hedges in fuzzy logic (continued)
Hedge Very very Mathematical Expression Graphical Representation [µA ( x )]4
µA ( x ) More or less Somewhat µA ( x ) 2 [µA ( x )]2 Indeed if 0 ≤µ A ≤ 0.5 µ 1 − 2 [1 − A ( x )]2
if 0.5 < µA ≤ 1
23 Operations of fuzzy sets
The classical set theory developed in the late 19th century by Georg Cantor describes how crisp sets can interact. These interactions are called operations. interact. operations 24 Cantor’s sets
Not A A B A A Complement Containment A B A A B Intersection Union
25 Complement
Crisp Sets: Who does not belong to the set? Who Fuzzy Sets: How much do elements not belong to How the set? The complement of a set is an opposite of this set. For example, if we have the set of tall men, its For tall complement is the set of NOT tall men. When we complement NOT remove the tall men set from the universe of discourse, we obtain the complement. If A is the discourse, is fuzzy set, its complement ¬A can be found as fuzzy can follows: µ¬ ( x) = 1 − µ ( x)
26 Fuzzy Set Operations Complement
– To what degree do elements not belong to this To not set? set? µ ¬A(x) = 1 – µ A(x)
µ(x) µ(x) 1 A x No t A x 0 1 0 µ(x) 1
27 Not A A 1B 0A A 1 Complement 0 Containment Complement µ(x) 1 Contai Containment
Crisp Sets: Which sets belong to which other sets? Which Fuzzy Sets: Which sets belong to other sets? Which Similar to a Chinese box, a set can contain other sets. The smaller set is called the subset. For sets. subset example, the set of tall men contains all tall men; example, contains very tall men is a subset of tall men. However, the very tall tall men set is just a subset of the set of men. In tall men crisp sets, all elements of a subset entirely belong to a larger set. In fuzzy sets, however, each element can belong less to the subset than to the larger set. Elements of the fuzzy subset have smaller memberships in it than in the larger set.
28 Fuzzy Set Operations Containment
– Which sets belong to other sets?
µ(x) µ(x) Each element of the fuzzy subset has smaller membership than in the containing set ot A A B A B A Containment x x 1 0 1 B
A 1 x No t A x 0 1 0 µ(x) 1 A A omplement 0 Containment Complement µ(x) 1 29 Intersection
Crisp Sets: Which element belongs to both sets? Crisp Which Fuzzy Sets: How much of the element is in both sets? How In classical set theory, an intersection between two In sets contains the elements shared by these sets. For example, the intersection of the set of tall men and the set of fat men is the area where these sets overlap. In fuzzy sets, an element may partly belong to both sets with different memberships. A fuzzy intersection is the lower membership in both sets of each element. The fuzzy intersection of two fuzzy sets A and B on universe of discourse X: µ ∩ (x) = min [µ (x), µ (x)] = µ (x) ∩ µ (x), ), )]
A B A B A B
30 Fuzzy Set Operations
µ(x) 1 0 1 0 µ(x) 1 0 1 0 µ(x) Not A B A A Intersection µ A∩B(x) = min[ µ A(x),x µ B(x) ] A A
Complement x No A – To what degree is the element in tboth sets? Complement Containment
µ(x) 1 Contai AB 1 x 0 1 x 0 AB A B A A 0
1 B
∩ AB Intersection Intersection 0 Union AB U 31 Union
Crisp Sets: Which element belongs to either set? Crisp Which Fuzzy Sets: How much of the element is in either set? How The union of two crisp sets consists of every element that falls into either set. For example, the union of tall men and fat men contains all men who are tall tall contains OR fat. In fuzzy sets, the union is the reverse of the OR fat. intersection. That is, the union is the largest membership value of the element in either set. The fuzzy operation for forming the union of two fuzzy sets A and B on universe X can be given as: sets can µ ∪ (x) = max [µ (x), µ (x)] = µ (x) ∪ µ (x), ), )]
32 Fuzzy Set Operations
µ(x) 1 0 1 µ(x) 1 B A
Not A A A Union B A No t A A 0 x A∪ B(x) µ 1 = max[ µ A(xx), µ B(x) ] B – To what degree is the element in either Aor both To 0 x x sets? 0 sets? Complement Containment
µ(x) 1
Containment Complement µ(x) 1 x 0 1 x 0 ∪ AB Union x AB x AB
A A B A B 0 1 ∩ AB
Union Intersection 0 Intersection 33 Operations of fuzzy sets
µ(x) 1 A 0 1 0 Complement µ(x) 1 0 1 0 Intersection ∩ AB x AB x No t A x x 0 1 0 Containment µ(x) 1 0 1 0 ∪ AB Union x
34 µ(x) 1 B A B A x x AB x Fuzzy rules In 1973, Lotfi Zadeh published his second most In published influential paper. This paper outlined a new approach to analysis of complex systems, in which Zadeh suggested capturing human knowledge in fuzzy rules. 35 Fuzzy Rules Fuzzy 1965 paper: “Fuzzy Sets” (Lotfi Zadeh)
– Apply natural language terms to a formal Apply system of mathematical logic
– http://www.cs.berkeley.edu/~zadeh 1973 paper outlined a new approach to 1973 capturing human knowledge and designing expert systems using fuzzy rules fuzzy 36 What is a fuzzy rule?
A fuzzy rule can be defined as a conditional statement in the form: IF x is A IF THEN y is B where x and y are linguistic variables; and A and B where are linguistic values determined by fuzzy sets on the universe of discourses X and Y, respectively. universe 37 What is the difference between classical and fuzzy rules?
A classical IFTHEN rule uses binary logic, for classical example, example,
Rule: 1 IF speed is > 100 IF speed THEN stopping_distance is long stopping_distance Rule: 2 IF speed is < 40 IF THEN stopping_distance is short The variable speed can have any numerical value The can between 0 and 220 km/h, but the linguistic variable stopping_distance can take either value long or short. stopping_distance short In other words, classical rules are expressed in the blackandwhite language of Boolean logic.
38 We can also represent the stopping distance rules in a fuzzy form:
Rule: 1 IF speed is fast THEN stopping_distance is long Rule: 2 IF speed is slow IF speed THEN stopping_distance is short In fuzzy rules, the linguistic variable speed also has In also the range (the universe of discourse) between 0 and 220 km/h, but this range includes fuzzy sets, such as slow, medium and fast. The universe of discourse of fast the linguistic variable stopping_distance can be the can between 0 and 300 m and may include such fuzzy sets as short, medium and long. sets short and long
39 Fuzzy rules relate fuzzy sets. In a fuzzy system, all rules fire to some extent, In or in other words they fire partially. If the antecedent is true to some degree of membership, then the consequent is also true to that same degree. that 40 Fuzzy sets of tall and heavy men Fuzzy men
Degree of Membership 1.0 0.8 0.6 0.4 0.2 0.0 160 180 190 200 Height, cm Tall men Degree of Membership 1.0 Heavy men 0.8
0.6 0.4 0.2 0.0 70 80 100 120 Weight, kg These fuzzy sets provide the basis for a weight estimation model. The model is based on a relationship between a man’s height and his weight: IF height is tall IF tall THEN weight is heavy THEN heavy
41 The value of the output or a truth membership grade of the rule consequent can be estimated directly from a corresponding truth membership grade in the antecedent. This form of fuzzy inference uses a method called monotonic selection. method monotonic
Degree of Membership 1.0 0.8 0.6 0.4 0.2 0.0 160 180 190 200 T a l l me n Degree of Membership 1.0 0.8 0.6 0.4 0.2 0.0 70 80 100 120 Height, cm Weight, kg
42 Heavy men A fuzzy rule can have multiple antecedents, for fuzzy example: IF IF AND AND AND AND THEN THEN IF IF OR OR THEN THEN project_duration is long project_duration project_staffing is large project_staffing project_funding is inadequate project_funding risk is high risk service is excellent service food is delicious food tip is generous tip 43 The consequent of a fuzzy rule can also include The multiple parts, for instance: multiple IF temperature is hot IF temperature THEN hot_water is reduced; THEN hot_water cold_water is increased 44 ...
View
Full Document
 Fall '09
 Ms.NireshFathima
 fuzzy sets

Click to edit the document details