761 likes | 1.31k Views
Chap 4: Fuzzy Expert Systems Part 2. SCCS451 Artificial Intelligence Week 10. Asst. Prof. Dr. Sukanya Pongsuparb Dr. Srisupa Palakvangsa Na Ayudhya Dr. Benjarath Pupacdi. The formal systematic study of the principles of valid inference and correct reasoning. Unclear. Fuzzy Logic.
E N D
Chap 4: Fuzzy Expert SystemsPart 2 SCCS451 Artificial Intelligence Week 10 Asst. Prof. Dr. SukanyaPongsuparb Dr. SrisupaPalakvangsa Na Ayudhya Dr. BenjarathPupacdi
The formal systematic study of the principles of valid inference and correct reasoning Unclear Fuzzy Logic a form of multi-valued logic derived from fuzzy set theory to deal with reasoning that is approximate rather than precise. (Wikipedia) a theoretical system used in mathematics, computing and philosophy to deal with statements which are neither true nor false (dictionary.cambridge.org)
Classical (Crisp) Set • fA(x) called the characteristic function of A • Principle of Dichotomy: a classic set theory imposes a sharp boundary fA(x): X {0, 1}, where
Fuzzy Set A(x): X [0, 1] where A(x) = 1 if x is totally in A; A(x) = 0 if x is not in A; 0 < A(x) < 1 if x is partly in A. A(x) : membership function of set A membership value (0<= degree <=1): shows the degree of membership Basic idea: an element belongs to a fuzzy set with a certain degree of membership fuzzy set is a set with fuzzy boundaries
Linguistic Variables <antecedent> THEN <consequent> IF object object value value Linguistic value Linguistic variable • Examples: • IF wind is strong THEN sailing is good • IF speed is slow THENstopping_distance is short • IFproject_duration is long • THENcompletion_risk is high * linguistic variable == fuzzy variable
Hedges hedges Andy quite likes Thai food Mary looks very much like her mother Jim has been to several attractions in Thailand Hedges: terms that modify the shape of fuzzy sets e.g. very, somewhat, quite, more or less, and slightly
Representation of hedges in fuzzy logic Concentration dilation dilation intensification
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: - Complement - Containment - Intersection - Union
Set Properties • The properties of set used in crisp sets can also be used in fuzzy sets • Frequently used properties:- • Commutativity • Associatively • Distributivity • Idempotency • Identity • Involution • Transitivity • De Morgan’s Laws
Fuzzy Rules Classical IF-THEN rule Rule 1: IF speed is > 100 THEN stopping distance is long Rule 2: IF speed is < 70 THEN stopping distance is short • Fuzzy IF-THEN rule Rule 1: IF speed is fast THEN stopping distance is long Rule 2: IF speed is slow THEN stopping distance is short Fuzzy Rules: If the antecedent is true to some degree of membership, then the consequent is also true to that same degree.
How to reason? 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 THEN weight is heavy
How to reason? (cont.) • 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.
Multiple Antecedents • Examples IF project_duration is long AND project_staffing is large AND project_funding is inadequate THEN risk is high IF service is excellent OR food is delicious THEN tip is generous
Multiple Consequences • Example IF temperature is hot THEN hot_water is reduced; cold_water is increased
Fuzzy Inference • Fuzzy inference: a process of mapping from a given input to an output, using the theory of fuzzy sets • Examples of inference techniques • Mamdani-Style Inference • Sugeno-Style Inference
Mamdani-Style Inference • Linguistic variables and linguistic values must be identified Rule 1: IFproject_funding is adequate ORproject_staffing is small THEN risk is low Rule 2: IFproject_funding is marginal ANDproject_staffing is large THEN risk is normal Rule 3: IFproject_funding is inadequate THEN risk is high Rule 1: IF x is A3 OR y is B1 THEN z is C1 Rule 2: IF x is A2 AND y is B2 THEN z is C2 Rule 3: IF x is A1 THEN z is C3
Mamdani-Style Inference (cont.) • There are four steps • Fuzzification • Rule Evaluation • Aggregation of the Rule Outputs • Defuzzification
Mamdani-Style Inference (cont.) • Fuzzification • Take crisp inputs • Determine the degree of inputs
Mamdani-Style Inference (cont.) 2) Rule Evaluation • Take fuzzified inputs • Apply them to the antecedents of the fuzzy rules AB(x) = min [A(x), B(x)], where xX • AB(x) = max [A(x), B(x)] , where xX Rule 1: IF x is A3 (0.0) OR y is B1 (0.1) THEN z is C1 C1(z) = max [A3(x), B1(y)] = max[0.0, 0.1] = 0.1 Rule 2: IF x is A2 (0.2) AND y is B2 (0.7) THEN z is C2 C2(z) = min[A2(x), B2(y)] = min[0.2, 0.7] = 0.2
Mamdani-Style Inference (cont.) • The result of the antecedent evaluation can be applied to the membership function of the consequent. – functions can be clipped or scaled
Mamdani-Style Inference (cont.) • Correlation Minimum (clipping): cut the consequent membership function at the level of the antecedent truth • Correlation Product (scaling): multiplying all membership degrees of the rule consequent by the rule antecedent
Mamdani-Style Inference (cont.) 3) Aggregation of the rule outputs • Combine all outputs into a single fuzzy set
Mamdani-Style Inference (cont.) 4) Defuzzification • Centroid technique (or centre of gravity – COG): find the point where a vertical line would slice the aggregate set into two equal masses
Mamdani-Style Inference (cont.) 4) Defuzzification (cont.) • A reasonable estimate can be obtained by calculating it over a sample of points.
Fuzzy Inference • Examples of inference techniques • Mamdani-Style Inference • Sugeno-Style Inference
Sugeno-Style Inference • uses a single spike (singleton) as the member function of the rule consequent • Singleton: a fuzzy set with a membership function that is unity at a single particular point on the universe of discourse and zero everywhere else • Format of rules:- IFx is A ANDy is B THENz is f(x,y) where x, y and z are linguistic variables; A and B fuzzy sets on universe of discourses X and Y respectively; f(x,y) a mathematical function
Sugeno-Style Inference (cont.) • Four steps of Sugeno • Fuzzification -> similar to Mamdani Style • Rule Evaluation IFx is A ANDy is B THENz is k the output is constant which makes all outputs to be spikes • Aggregation of the Rule Outputs -> similar to Mamdani Style
Sugeno-Style Inference (cont.) 4. Defuzzification: use weighted average (WA)
Mamdani VS Sugeno Mamdani • Capture expert knowledge • Express knowledge in more human-like manner • Not computationally efficient • Sugeno • Computationally effective • Work well with optimisation and adaptive techniques • Suitable for control problems and dynamic nonlinear systems
Building Fuzzy Expert Systems 1. Specify the problem and define linguistic variables. 2. Determine fuzzy sets. 3. Elicit and construct fuzzy rules. 4. Encode the fuzzy sets, fuzzy rules and procedures to perform fuzzy inference into the expert system. 5. Evaluate and tune the system.
Building Fuzzy Expert Systems (cont.) • Case study • A service centre keeps spare parts and repairs failed ones. • A customer brings a failed item and receives a spare of the same type • Failed parts are repaired, placed on the shelf, and thus become spares. • The objective here is to advise a manager of the service centre on certain decision policies to keep the customers satisfied
Building Fuzzy Expert Systems (cont.) • Specify the problem and define linguistic variables • average waiting time (mean delay) m • repair utilisation factor of the service centre • number of servers s • initial number of spare parts n
Building Fuzzy Expert Systems (cont.) 2) Determine Fuzzy Sets • fuzzy sets can have a variety of shapes • a triangle or a trapezoid are widely used due to the simplification of the computational process • Key point – to maintain sufficient overlap in adjacent fuzzy sets for the fuzzy system to respond smoothly
Building Fuzzy Expert Systems (cont.) 3) Elicit and construct fuzzy rules • Knowledge acquisition such as • Ask experts • Books • Flow diagrams • Observation • Rule construction
Building Fuzzy Expert Systems (cont.) 4) Encode the fuzzy sets, fuzzy rules and procedures to perform fuzzy inference into the expert system. • Possible methods • DIY by using programming languages e.g. C, C++ • fuzzy logic development tool such as MATLAB Fuzzy Logic Toolbox or Fuzzy Knowledge Builder
Building Fuzzy Expert Systems (cont.) 5) Evaluate and tune the system • To check if the system meets the requirements • Use tools to analyse the system performance
Building Fuzzy Expert Systems (cont.) • Tuning systems • Review model input and output variables e.g. redefine their ranges • Review the fuzzy sets e.g. define additional sets on the universe of discourse • Provide sufficient overlap between neighbouring sets • Review the existing rules e.g. modify rules, rewrite hedge rules • Adjust the rule execution weights • Revise shapes of the fuzzy sets.
Applications of Fuzzy Logic • Air Conditioning • Digital Image Processing e.g. edge detection • Automobile and other vehicle subsystems, such as automatic transmissions, ABS and cruise control (e.g. Tokyo monorail) • Home appliances e.g. rice cookers, washing machines, dish washers