640 likes | 1.56k Views
Fuzzification. Conversion of real input to fuzzy set values e.g. Medium ( x ) = { 0 if x >= 1.90 or x < 1.70, (1.90 - x)/0.1 if x >= 1.80 and x < 1.90, (x- 1.70)/0.1 if x >= 1.70 and x < 1.80 }. Inference Engine. Fuzzy rules based on fuzzy premises and fuzzy consequences e.g.
E N D
Fuzzification • Conversion of real input to fuzzy set values • e.g. Medium ( x ) = { • 0 if x >= 1.90 or x < 1.70, • (1.90 - x)/0.1 if x >= 1.80 and x < 1.90, • (x- 1.70)/0.1 if x >= 1.70 and x < 1.80 }
Inference Engine • Fuzzy rules • based on fuzzy premises and fuzzy consequences • e.g. • If height is Short and weight is Light then feet are Small • Short( height) AND Light(weight) => Small(feet)
Rules are usually expressed in the form: IF variable IS property THEN action For example, an extremely simple temperature regulator that uses a fan might look like this: IF temperature IS very cold THEN stop fanIF temperature IS cold THEN turn down fanIF temperature IS normal THEN maintain levelIF temperature IS hot THEN speed up fan Notice there is no "ELSE".
What is a Fuzzy Expert System? • A fuzzy expert system is an expert system that uses fuzzy logic instead of Boolean logic. • A fuzzy expert system is a collection of membership functions and rules that are used to reason about data. • oriented toward numerical processing instead of symbolic reasoning engines.
Example Fuzzification & Inference • If height is 1.7m and weight is 55kg • what is the value of Size(feet)
Inference Process: • Fuzzification • Inference • Composition • Defuzzification
Example variables x, y, z є [ 0, 10 ] Functions: low(t) = 1 - t / 10 high(t) = t / 10 Rules: rule 1: if x is low and y is low then z is high rule 2: if x is low and y is high then z is low rule 3: if x is high and y is low then z is low rule 4: if x is high and y is high then z is high
Fuzzification • The membership functions defined on the input variables are applied to their actual values, • to determine the degree of truth for each rule premise. • The degree of truth for a rule's premise is sometimes referred to as its “alpha”. • If a rule's premise has a nonzero degree of truth (if the rule applies at all...) then the rule is said to “fire”.
Example x y low(x) high(x) low(y) high(y) alpha1 alpha2 alpha3 alpha4 ----------------------------------------------------------------------------------------- 0.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0 0.0 0.0 0.0 3.2 1.0 0.0 0.68 0.32 0.68 0.32 0.0 0.0 0.0 6.1 1.0 0.0 0.39 0.61 0.39 0.61 0.0 0.0 0.0 10.0 1.0 0.0 0.0 1.0 0.0 1.0 0.0 0.0 3.2 0.0 0.68 0.32 1.0 0.0 0.68 0.0 0.32 0.0 6.1 0.0 0.39 0.61 1.0 0.0 0.39 0.0 0.61 0.01 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 1.0 0.0 3.2 3.1 0.68 0.32 0.69 0.31 0.68 0.31 0.32 0.32 3.2 3.3 0.68 0.32 0.67 0.33 0.67 0.33 0.32 0.32 10.0 10.0 0.0 1.0 0.0 1.0 0.0 0.0 0.0 1.0
Inference • Truth value for the premise of each rule is computed, and applied to the conclusion part of each rule. This results in one fuzzy subset to be assigned to each output variable for each rule. • 2 inference methods/inference rules: MIN and PRODUCT.
Inference • MIN output membership function is clipped off at a height corresponding to the rule premise's computed degree of truth. This corresponds to the traditional interpretation of the fuzzy logic AND operation.
Inference • PRODUCT output membership function is scaled by the rule premise's computed degree of truth.
Example • Rule 1 for x = 0.0 and y = 3.2 premise degree of truth = 0.68 • MIN rule1(z) = { z / 10, if z <= 6.8 0.68, if z >= 6.8 } • PRODUCT rule1(z) = 0.68 * high(z) = 0.068 * z
Composition • All of the fuzzy subsets assigned to each output variable are combined together to form a single fuzzy subset for each output variable. • 2 composition rules: MAX composition and SUM composition.
Composition • MAX composition Combined output fuzzy subset is constructed by taking the pointwise maximum over all of the fuzzy subsets assigned to the output variable by the inference rule.
Composition • SUM composition Combined output fuzzy subset is constructed by taking the pointwise sum over all of the fuzzy subsets assigned to the output variable by the inference rule. -- truth values may greater than 1, so only used when followed by a defuzzification method
Example • For x = 0.0 and y = 3.2. • MIN rule1(z) = { z / 10, if z <= 6.8 0.68, if z >= 6.8 } rule2(z) = { 0.32, if z <= 6.8 1 - z / 10, if z >= 6.8 } rule3(z) = 0.0 rule4(z) = 0.0
Example • MAX composition fuzzy(z) ={ 0.32, if z <= 3.2 z / 10, if 3.2 <= z <= 6.8 0.68, if z >= 6.8 }
Example • PRODUCT rule1(z) = 0.068 * z rule2(z) = 0.32 - 0.032 * z rule3(z) = 0.0 rule4(z) = 0.0 • SUM composition fuzzy(z) = 0.32 + 0.036 * z
Defuzzification • Defuzzification subprocess converts fuzzy value to a single number - a crisp value. • 2 common defuzzification techniques are the CENTROID and MAXIMUM methods.
Defuzzification • CENTROID The crisp value of the output variable is computed by finding the variable value of the center of gravity of the membership function for the fuzzy value.
Defuzzification • MAXIMUM one of the variable values at which the fuzzy subset has its maximum truth value is chosen as the crisp value for the output variable. • Many variations of the MAXIMUM e.g AVERAGE-OF-MAXIMA method, returns the average of the variable values at which the maximum truth value occurs.
Example • For above example • Using MAX-MIN inferencing and AVERAGE-OF-MAXIMA defuzzification results in a crisp value of 8.4 for z. • Using PRODUCT-SUM inferencing and CENTROID defuzzification results in a crisp value of 6.7 for z.