Presentation is loading. Please wait.

Presentation is loading. Please wait.

Fuzzy Systems Adriano Cruz NCE e IM/UFRJ

Similar presentations


Presentation on theme: "Fuzzy Systems Adriano Cruz NCE e IM/UFRJ"— Presentation transcript:

1 Fuzzy Systems Adriano Cruz NCE e IM/UFRJ Adriano@nce.ufrj.br

2 @2003 Adriano Cruz NCE e IM - UFRJNo. 2 Summary Introduction Fuzzy Variables Fuzzy Rules Fuzzification Inference Defuzzification

3 @2003 Adriano Cruz NCE e IM - UFRJNo. 3 Fuzzy Systems XY=F(X) Function F(x) is unknown

4 @2003 Adriano Cruz NCE e IM - UFRJNo. 4 Approximation of Functions X Y patches

5 @2003 Adriano Cruz NCE e IM - UFRJNo. 5 Fuzzy Systems Inference Engine Data Management RulesSetsOperators Fuzzyfier Deffuzzifier

6 @2003 Adriano Cruz NCE e IM - UFRJNo. 6 Advantages Use rules that express the imprecision and approximations of the real world. Easy to understand, test and maintain Easy to be prototyped Robust. They operate even when there is lack of rules or wrong rules. Need less rules Parallel evaluation of rules Accumulate evidences in favour and against

7 @2003 Adriano Cruz NCE e IM - UFRJNo. 7 Disadvantages Need more tests and simulation Do not learn easily Difficult to establish correct rules Lack of precise mathematical model

8 @2003 Adriano Cruz NCE e IM - UFRJNo. 8 Steps to a Basic System Define inputs and outputs (fuzzy variables) Build a rule base Simulate Test Validate

9 Fuzzy Variables

10 @2003 Adriano Cruz NCE e IM - UFRJNo. 10 Introduction In order to discuss about a phenomenon from the real world it is necessary to use a number fuzzy sets For example, consider room temperature, one could use low, medium and high temperature Note that these sets may overlap, allowing some temperatures belong partially to more than one set

11 @2003 Adriano Cruz NCE e IM - UFRJNo. 11 Introduction cont. The process includes the definition of the membership functions The Universe of discourse is also an important parameter

12 @2003 Adriano Cruz NCE e IM - UFRJNo. 12 Fuzzy Variable A fuzzy variable is defined by the quadruple V = { x, l, u, m} X is the variable symbolic name: temperature L is the set of labels: low, medium and high universe of discourse U is the universe of discourse M are the semantic rules that define the meaning of each label in L (membership functions).

13 @2003 Adriano Cruz NCE e IM - UFRJNo. 13 Fuzzy Variable Example X = Temperature L = {low, medium, high} U = {x  X | -70 o <= x <= +70 o } M = 1.0 0.0 -70-60-50-40-30-20-10010203040506070 lowmediumhigh

14 @2003 Adriano Cruz NCE e IM - UFRJNo. 14 Membership Functions? Subjective evaluation: The shape of the functions is defined by specialists Ad-hoc: choose a simple function that is suitable to solve the problem Distributions, probabilities: information extracted from measurements Adaptation: testing Automatic: algorithms used to define functions from data

15 @2003 Adriano Cruz NCE e IM - UFRJNo. 15 Variable Terminology Completude: A variable is complete if for any x  X there is a fuzzy set such as  (x)>0 1.0 0.0 -70-60-50-40-30-20-10010203040506070 1.0 0.0 -70-60-50-40-30-20-10010203040506070 Complete Incomplete

16 @2003 Adriano Cruz NCE e IM - UFRJNo. 16 Partition of Unity A fuzzy variable forms a partition of unity if for each input value x where p is the number of sets to which x belongs There is no rule to define the overlapping degree between two neighbouring sets A rule of thumb is to use 25% to 50%

17 @2003 Adriano Cruz NCE e IM - UFRJNo. 17 Partition of Unity 1,0 0,0 -70-60-50-40-30-20-10010203040506070 0,5 1,0 0,0 -70-60-50-40-30-20-10010203040506070 0,5 Partition of Unity No Partition of Unity

18 @2003 Adriano Cruz NCE e IM - UFRJNo. 18 Partition of Unity cont Any complete fuzzy variable may be transformed into a partition of unity using the equation

19 Fuzzy Rules

20 @2003 Adriano Cruz NCE e IM - UFRJNo. 20 Fuzzy Rules Unconditionals –x is A i –Save Energy Conditionals –If x is A i then y is C k –If x is A i and y is B k then z is C m –If x is A i or y is B k then z is C m if x is A i then z is C mif x is A i then z is C m if y is B k then z is C mif y is B k then z is C m

21 @2003 Adriano Cruz NCE e IM - UFRJNo. 21 Fuzzy Rule Base If x is A 1 and y is B 1 then z is C u : R 11 If x is A 1 and y is B 1 then z is C u : R 11 If x is A 1 and y is B 2 then z is C v : R 12 If x is A 1 and y is B 2 then z is C v : R 12...... If x is A 1 and y is B n then z is C x : R 1n If x is A 1 and y is B n then z is C x : R 1n If x is A 2 and y is B 1 then z is C x : R 21 If x is A 2 and y is B 1 then z is C x : R 21 If x is A 2 and y is B 2 then z is C y : R 22 If x is A 2 and y is B 2 then z is C y : R 22...... If x is A 2 and y is B n then z is C 1 : R 1n If x is A 2 and y is B n then z is C 1 : R 1n If x is A m and y is B 1 then z is C x : R m1 If x is A m and y is B 1 then z is C x : R m1......

22 @2003 Adriano Cruz NCE e IM - UFRJNo. 22 Completude A fuzzy rule base is complete if for any value from the input set there exists a value that is between 0 and 1. –If the sets used in the rule base have non compact support then the rule base is complete –If all fuzzy variables are complete then rule base is complete

23 @2003 Adriano Cruz NCE e IM - UFRJNo. 23 Consistency A fuzzy rule set is inconsistent if two rules having the same antecedents map to different fuzzy sets If x is A 1 and y is B 1 then z is C r : R 11 If x is A 1 and y is B 1 then z is C r : R 11 If x is A 1 and y is B 1 then z is C v : R 12 If x is A 1 and y is B 1 then z is C v : R 12

24 @2003 Adriano Cruz NCE e IM - UFRJNo. 24 The Rule Explosion (1) The number of rules grows exponentially with the number of input variables The number of combinations of the input sets is Where the ith variable is composed of p i fuzzy sets

25 @2003 Adriano Cruz NCE e IM - UFRJNo. 25 The Rule Explosion (2)

26 @2003 Adriano Cruz NCE e IM - UFRJNo. 26 Example System Consider a system to control a sprinkler Input variables: –air temperature: freeze, cold, normal, warm, hot –soil humidity: dry, normal, humid Output Variable: –time: short, medium, long

27 @2003 Adriano Cruz NCE e IM - UFRJNo. 27 Input variables

28 @2003 Adriano Cruz NCE e IM - UFRJNo. 28 Output Variable

29 @2003 Adriano Cruz NCE e IM - UFRJNo. 29 Fuzzyfing

30 @2003 Adriano Cruz NCE e IM - UFRJNo. 30 Rule Base

31 @2003 Adriano Cruz NCE e IM - UFRJNo. 31 Antecedent Evaluation (1) If temp is hot (0.25) and humidity is humid (0.32) then time is medium : R 1 If temp is hot (0.25) and humidity is humid (0.32) then time is medium : R 1 If temp is hot (0.25) and humidity is normal (0.68) then time is long : R 2 If temp is hot (0.25) and humidity is normal (0.68) then time is long : R 2 Use a t-norm operator (e. g. and) to evaluate the antecedents Use a t-norm operator (e. g. and) to evaluate the antecedents So in R1: 0.25 and 0.32 results 0.25 So in R1: 0.25 and 0.32 results 0.25 So in R2: 0.25 and 0.68 results 0.25 So in R2: 0.25 and 0.68 results 0.25

32 @2003 Adriano Cruz NCE e IM - UFRJNo. 32 Antecedent Evaluation (2) It is possible that more than one rule point to the same consequent set with different values These values are sometimes described as rule strength It is possible to use an T-conorm like or (max) to obtain a single result This operation is called aggregation. Some systems use addition as aggregation operator.

33 @2003 Adriano Cruz NCE e IM - UFRJNo. 33 Methods for Inference

34 Defuzzification

35 @2003 Adriano Cruz NCE e IM - UFRJNo. 35 Defuzzification Inference means to obtain through some method output fuzzy regions for each output variable Each output region must be dufuzzified to produce crisp values Using a crisp value to represent a fuzzy region may signify losing information

36 @2003 Adriano Cruz NCE e IM - UFRJNo. 36 Defuzzification Methods A In general there are five methods for defuzzifying a fuzzy set A. A A represents an aggregate of sets obtained during the inference process In the next examples we will consider that the clipping method of inference was used

37 @2003 Adriano Cruz NCE e IM - UFRJNo. 37 Inference Result

38 @2003 Adriano Cruz NCE e IM - UFRJNo. 38 Centroid Area (1) (COA) The point used to represent the output area is the centroid of the area represented by

39 @2003 Adriano Cruz NCE e IM - UFRJNo. 39 Centroid Area (2) The results tend to move smoothly between two consecutive calculations It is relatively simple It can easily be applied to discreet functions

40 @2003 Adriano Cruz NCE e IM - UFRJNo. 40 Centroid Area (3)

41 @2003 Adriano Cruz NCE e IM - UFRJNo. 41 Bisector of Area (BOA) The vertical line at z partitions A (the output fuzzy set) into two regions with the same area The coordinate of the vertical line z is defined by Where  =min{x | x  A} and  =min{x | x  A}

42 @2003 Adriano Cruz NCE e IM - UFRJNo. 42 Mean of Maximum (MOM) The point z is the average of the maximizing z points at which the function reach a maximum  * The coordinate of the vertical line z is defined by A’={ z |  A (z) =  *}

43 Other Strategies

44 @2003 Adriano Cruz NCE e IM - UFRJNo. 44 Other strategies Smallest of maximum (SOM) is the minimum (in terms of magnitude) of the maximizing z Largest of maximum (LOM) is the maximum (in terms of magnitude) of the maximizing z These are not used as often as the other due to their bias

45 @2003 Adriano Cruz NCE e IM - UFRJNo. 45 Fuzzy Rule-Based Models Non Additive Rule Models Additive Rule Models Mamdani Model TSK Model SAM Model

46 @2003 Adriano Cruz NCE e IM - UFRJNo. 46 Fuzzy Inference Systems Rule 1 x is A1y is B1 w1 Rule 2 x is A2y is B2 w2 Rule m x is Amy is Bm wm x Aggregator Deffuz y

47 @2003 Adriano Cruz NCE e IM - UFRJNo. 47 Mamdani Model Fuzzify inputs Evaluate the strength of each rule (use min as T-norm) If more than one rule fires the same consequent use the sup of all strengths Use the max as the aggregation operator

48 Standard Additive Model

49 @2003 Adriano Cruz NCE e IM - UFRJNo. 49 Standard Additive Model Introduced by Bart Kosko in 1996 The structure is similar to Mamdani model The main advantage is the efficiency of its computation

50 @2003 Adriano Cruz NCE e IM - UFRJNo. 50 SAM x Mamdani SAM assumes the inputs are crisp and Mamdani handles crisp and fuzzy SAM uses product as the inference operator (scaling method) SAM uses addition as the aggregator SAM uses centroid while Mamdani does not insist on a specific method

51 @2003 Adriano Cruz NCE e IM - UFRJNo. 51 SAM Model The additive structure comes from the set B, sum of the fired then-part sets:

52 @2003 Adriano Cruz NCE e IM - UFRJNo. 52 Centroid The output of the system F(x) is the centroid of the set B

53 @2003 Adriano Cruz NCE e IM - UFRJNo. 53 Centroid V j is the area (volume) and c j is the centroid of the then-part set B j w j can scale each term in the sum to reflect the credibility of the rule, in practice most of the time w j =1

54 @2003 Adriano Cruz NCE e IM - UFRJNo. 54 SAM advantages V j and c j can be computed in advance and only change when the system learns or tunes its rules. B j usually are simple functions, such as triangles, trapezoids or bell curves and therefore have simple areas and centroids. For each input x it is only necessary to compute just the m values  j (x)

55 @2003 Adriano Cruz NCE e IM - UFRJNo. 55 Fuzzy Approximation Theorem An additive fuzzy system F:X  Y uniformly approximates f: X  Y if X is compact and f is continuous. An additive fuzzy system F:X  Y uniformly approximates f: X  Y if X is compact and f is continuous. A set S is compact if, from any sequence of elements X 1, X 2,... of S, a subsequence can always be extracted which tends to some limit element X of S. Compact sets are closed and bounded, and these conditions characterize them in finite-dimensional space. Kosko 1992

56 @2003 Adriano Cruz NCE e IM - UFRJNo. 56 Importance It shows that the set of fuzzy systems are universal approximators. These theorems justify the use of fuzzy logic to almost any modelling problem.

57 @2003 Adriano Cruz NCE e IM - UFRJNo. 57 Other Theorems Wang 1996 – for a special class of fuzzy systems Buckley for Sugeno type Castro & Delgado for fuzzy rule systems

58 TSK-Model

59 @2003 Adriano Cruz NCE e IM - UFRJNo. 59 TSK Model Takagi-Sugeno-Kang model introduced in 1984 by Takagi and Sugeno Later Sugeno and Kang also worked on the model The main goal is to reduce the number of rules of the Mamdani model TSK replaces the consequent by an equation of the inputs

60 @2003 Adriano Cruz NCE e IM - UFRJNo. 60 TSK rule Typical fuzzy TSK rule has the form if x is A and y is B then z=f(x,y) f(x,y) can be any function that can be appropriately describe the fuzzy region defined by the antecedent When f(x,y) is a linear equation the system is a first-order TSK model

61 @2003 Adriano Cruz NCE e IM - UFRJNo. 61 TSK reasoning Consider a TSK system with two rules: if x is A 1 and y is B 1 then z=p 1 x+q 1 y+r 1 if x is A 2 and y is B 2 then z=p 2 x+q 2 y+r 2

62 @2003 Adriano Cruz NCE e IM - UFRJNo. 62 TSK reasoning x u A1A1 x u A2A2 y u B1B1 y u B2B2 z 1 =p 1 x+q 1 y+r 1 z 2 =p 2 x+q 2 y+r 2 Entrada x Entrada y

63 @2003 Adriano Cruz NCE e IM - UFRJNo. 63 TSK reasoning x u A1A1 x u A2A2 y u B1B1 y u B2B2 Min or prod w1w1 w2w2 z 1 =p 1 x+q 1 y+r 1 z 2 =p 2 x+q 2 y+r 2 Entrada x Entrada y

64 @2003 Adriano Cruz NCE e IM - UFRJNo. 64 TSK reasoning x u A1A1 x u A2A2 y u B1B1 y u B2B2 Min or prod w1w1 w2w2 z 1 =p 1 x+q 1 y+r 1 z 2 =p 2 x+q 2 y+r 2 Entrada x Entrada y

65 @2003 Adriano Cruz NCE e IM - UFRJNo. 65 TSK example* Consider the the single-input first-order TSK model

66 @2003 Adriano Cruz NCE e IM - UFRJNo. 66 TSK example cont

67 @2003 Adriano Cruz NCE e IM - UFRJNo. 67 TSK example 2 Consider the the two-input first-order TSK model

68 @2003 Adriano Cruz NCE e IM - UFRJNo. 68 TSK Sugeno Example 2

69 @2003 Adriano Cruz NCE e IM - UFRJNo. 69 TSK Sugeno Example 2


Download ppt "Fuzzy Systems Adriano Cruz NCE e IM/UFRJ"

Similar presentations


Ads by Google