Fuzzy ules and Fuzzy easoning (chapter 3) Kai Goebel, Bill Cheetham GE Corporate esearch & Development goebel@cs.rpi.edu cheetham@cs.rpi.edu (adapted from slides by. Jang) Fuzzy easoning: The Big Picture Useful for: utomatic Control Expert Systems Pattern ecognition Time Series Prediction Data Classification There are different schemes to accomplish these goals depending on our understanding and boundary conditions of the world. Extending: crisp domains to fuzzy domains: Extension Principle n-ary fuzzy relations: Fuzzy elations fuzzy domains to fuzzy domains: Fuzzy Inference (fuzzy rules, compositional rules of inference) Page 1 1
Outline Extension principle Fuzzy relations Fuzzy IF-THEN rules Compositional rule of inference Fuzzy reasoning 3 Extension Principle Extends crisp domains of mathematical expressions to fuzzy domains is a fuzzy set on X : = µ ( x ) / x + µ ( x ) / x + + µ ( x ) / x 1 1 n n The image of under f( ) is a fuzzy set B:, i.e., B=f() B = µ ( x ) / y + µ ( x ) / y + + µ ( x ) / y B 1 1 B B n n where yi = f(xi), i = 1 to n. 4 If f( ) is a many-to-one mapping, then µ ( y ) = max µ ( x ) B x f ( y ) = 1 Page
Extension Principle: Example =0.1/-+0.4/-1+0.8/0+0.9/1+0.3/ f(x)=x -3 B=0.1/1+0.4/-+0.8/-3+0.9/-+0.3/1 =0.8/-3+(0.4v0.9)/-+(0.1v0.3)/1 =0.8/-3+0.9/-+0.3/1 5 Extension Principle, continuous vars. µ ( x) = bell( x; 1. 5,, 0. 5) Let and f ( x) = ( x 1) 1 if x 0 x if x < 0 6 Page 3 3
Fuzzy elations fuzzy relation is a D MF: = {(( x, y ), µ ( x, y )) ( x, y ) X Y } Examples: x depends on y (x and y are events) If x is large, then y is small (x is an observed reading and Y is a corresponding action) y is much greater than x (x and y are numbers) y x µ ( x, y) = x + y + if y x 0 if y < x 7 If X={3,4,5} and Y={3,4,5,6,7} Express fuzzy relation as a relation matrix 0 0. 1 1 0. 0 0. 7 0. 3 3 = 0 0 0. 0 9 0. 1 7 0. 3 0 0 0 0. 0 8 0. 1 4 Max-Min Composition The max-min composition of two fuzzy relations 1 (defined on X and Y) and (defined on Y and Z) is µ ( x, z ) = [ µ ( x, y ) µ ( y, z )] 1 y 1 Note: calculation very similar to matrix multiplication Properties: ssociativity: ( S T ) = ( S ) T Distributivity over union: ( S T ) = ( S ) ( T ) Week distributivity over intersection: ( S T ) ( S ) ( T ) Monotonicity: S T ( S ) ( T ) 8 Page 4 4
Max-min Composition: Example Let 1 = x is relevant to y = y is relevant to z where X={ 1 3} Y={α β χ δ} Z={a b} 0. 1 0. 3 0. 5 0. 7 1 = 0. 4 0. 0. 8 0. 9 0. 6 0. 8 0. 3 0. 0. 9 0. 1 0. 0. 3 = 0. 5 0. 6 0. 7 0. 9 Max-min Composition: Example Calculate: is relevant to a X={ 0. 9 0. 1.... 1 0. 0. 3 = = 0. 4 0. 0. 8 0. 9 0. 5 0. 6 0. 6 0. 8 0. 3 0. 3} 0. 7 0. Y={α β χ δ} Z={a b} 1 0 1 0 3 0 5 0 7 10 ( ) µ, a = 1 ( ) = ( ) µ a 1, m ax 0. 4 0. 9, 0. 0., 0. 8 0. 5, 0. 9 0. 7 (max(min(0.4,0.9),min(0.,0.),min(0.5,0.8), min(0.7,0.9)) Page 5 5
Max-Star Composition Max-product composition: µ ( x, z) = [ µ ( x, y) µ 1 In general, we have max-* composition: µ ( x, z ) = [ µ ( x, y ) * µ 1 where * is a T-norm operator. y y 1 1 ( y, z)] ( y, z )] 11 Even more generally, we have (S-norm)-(T-norm) compositions Linguistic Variables (knowledge rep.) Precision vs. significance linguistic value is characterized by the variable name (age), the term set, the universe of discourse, a syntactic rule, and a semantic rule. The variable name is just that: age The term set is the set of its linguistic values: T(age) = {young, not young, very young,... middle aged, not middle aged,... old, not old, very old, more or less old,... not very young and not very old,...} The syntactic rule refers to how the linguistic values are generated. The semantic rule defines the membership value of each linguistic variable. 1 Page 6 6
Operations on Linguistic Values Concentration: Dilation: Contrast Intensification: CON ( ) = DIL ( ) = 0.5, ( x). INT ( ) = 0 µ 05 ( ), 05. µ ( x) 1 13 Linguistic Values (Terms) 14 More or less old: DIL(old) Extremely old: CON(CON(CON(old))) Not young and not old Yout but not too young Page 7 7
Fuzzy IF-THEN ules General format: IF x is THEN y is B if <antecedent> then <consequent> Examples: IF pressure is high THEN volume is small. IF the road is slippery THEN driving is dangerous. IF a tomato is red THEN it is ripe. IF the speed is high THEN apply the brake a little. 15 Fuzzy IF-THEN ules Two ways to interpret IF x is THEN y is B : y coupled with B y entails B B B x x 16 Page 8 8
Fuzzy If-Then ules Two ways to interpret If x is then y is B which describes a relation between two variables x and y. coupled with B: ( and B) = B = B = µ ( x ) ~ µ ( B y ) ( x, y ) entails B: (not or B) - Material implication - Propositional calculus - Extended propositional calculus - Generalization of modus ponens Note: these all reduce to not or B in two-valued logic B ( B ) (, ) su p ( ) ( ) ( B ) B ~ { * 0 1 } µ x y = c µ x c µ y a n d c B 17 Fuzzy IF-THEN ules Fuzzy implication function: µ ( x, y ) = f ( µ ( x), µ ( y)) = f ( a, b) B coupled with B µ ( x, y) = min( µ ( x), µ ( y)) B 18 µ ( x, y) = µ ( x) µ ( y) B ( x, y) = 0 ( ( x) + ( y) 1) µ µ µ B µ ( x y) ( x ) B ( ) ( y) ( ) µ if µ y = 1, = µ B if µ x = 1 0 otherwise Page 9 9
Fuzzy IF-THEN ules coupled with B Let ( ) ( ) µ ( x) = bell x; 4, 3, 10 µ B ( y) = bell y; 4, 3, 10 min algebraic product bounded product drastic product 19 Fuzzy IF-THEN ules entails B (not an exhaustive list) ( 1 1 ( ) ( )) µ ( ( µ ( ) µ ( )) µ ( ) ( x, y) = max min x, B y, 1 x ) µ ( x, y) = min, µ x + µ y B ( 1 ( ) ( )) µ ( x, y) = m ax µ x, µ y B µ ( ) x µ ( x, y) = min 1, µ y B ( ) 0 Page 10 10
Fuzzy IF-THEN ules entails B Let µ ( x) = bell x; 4, 3, 10 ( ) ( ) µ B ( y) = bell y; 4, 3, 10 Zadeh s arithmetic rule Zadeh s max-min rule Boolean Fuzzy Implication Gougen s Fuzzy Impl. 1 Compositional ule of Inference Same idea as max-min composition Derivation of y = b from x = a and y = f(x): y y b b y = f(x) y = f(x) a a and b: points y = f(x) : a curve x a a and b: intervals y = f(x) : an interval-valued function x Page 11 11
Compositional ule of Inference, contd. To find the resulting interval y=b (which corresponds to x=a) construct a cylindrical extension of a find intersection with curve project intersection to y-axis 3 ecall: Cylindrical Extension Base set Cylindrical Ext. of µ ( )( x, y) = µ ( ) x c 4 Page 1 1
ecall: D MF Projection Two-dimensional MF Projection onto X Projection onto Y 5 µ ( x, y) µ ( x) = µ B( y) = max µ ( x, y) max µ ( x, y) y x Compositional ule of Inference a is a fuzzy set and y = f(x) is a fuzzy relation: 6 Page 13 13
Putting it together: Comp. rule of Inf. Cylindrical extension with base µ ( )( x, y) = µ ( ) x c Intersection of c() with F Projection onto y-axis [ ] µ µ µ ( ) ( x, y) = min ( )( x, y), ( x, y) = min µ ( x), µ ( x, y) c F c F [ ( ) ( )] [ µ ( x) µ ( x, y) ] µ ( y) = max min µ x, µ x, y B x F = x F [ F ] epresentation: B = F Note: extension principle is special case of compositional rule of inference 7 Crisp easoning Modus Ponens: Fact: ule: Conclusion: x is IF x is THEN y is B y is B 8 Page 14 14
Fuzzy easoning Single rule with single antecedent Fact: x is ule: if x is then y is B Conclusion: y is B (Generalized Modus Ponens) Graphic epresentation: 9 F - Single ule, Single ntecedent Graphical epresentation: - find degree of match w between µ (x) and µ (x) intuitively: degree of belief for antecedent which gets propagated; result should be not greater than w B w X B Y 30 x is X y is B Y Page 15 15
Fuzzy easoning: Single ntecedent Let,, and B be fuzzy sets of X, X, and Y, respectively. ssumption: the fuzzy implication ->B is expressed as a fuzzy relation on XxY The fuzzy set B induced by fact: x is and premise: IF x is then y is B [ ( ) ' ( )] ( x) ( x y) µ ( y) = max min µ x, µ x, y B ' x [ µ ' µ, ] = x 31 or: B' = ' = ' ( B) Fuzzy easoning Single rule with multiple antecedents Facts: x is and y is B ule: if x is and y is B then z is C Conclusion: z is C [ ( ) ( )] ( ) ( ) ( ) [ µ ( x) µ ( y) µ ( x) µ ( y) ] µ ( z) [ ( ) ( ) ' ] x B ' B [ ] µ ( z) = µ x µ y µ x µ y µ z C ' x, y ' B ' B C = x, y ' B ' B C { } { [ ( ) ( )]} ( ) x µ x µ x µ y µ y µ C z = w1 w 3 C ' = [ ' ( C )] B' ( B C ) [ ] Page 16 16
F - Single ule, Multiple ntecedents Graphical epresentation - w 1 denotes degree of compatibility between and and w between B and B - w 1 w is degree of fulfilment of the rule B B T-norm C v X Y B C w 1 w w Z 33 x is X y is B Y z is C Z Fuzzy easoning Multiple rules with multiple antecedent Fact: x is and y is B ule 1: if x is 1 and y is B1 then z is C1 ule : if x is and y is B then z is C Conclusion: z is C Graphic epresentation: (next slide) 34 Page 17 17
Fuzzy easoning Graphics representation: 1 B1 B C1 X B B Y w1 C Z w 35 X Y T-norm B C x is X y is B Y z is C Z Z last slide 36 Page 18 18