1 / 38

Fuzzy Logic

Fuzzy Logic. Ranga Rodrigo March 30 , 2014 Most of the sides are from the Matlab tutorial. Introduction. Fuzzy logi c is due to the 1965 paper by Prof. Lofti A. Zadeh . Fuzzy logic is a form of many-valued logic; it deals with reasoning that is approximate rather than fixed and exact.

sal
Télécharger la présentation

Fuzzy Logic

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Fuzzy Logic Ranga Rodrigo March 30, 2014 Most of the sides are from the Matlab tutorial.

  2. Introduction • Fuzzy logic is due to the 1965 paper by Prof. Lofti A. Zadeh. • Fuzzy logic is a form of many-valued logic; it deals with reasoning that is approximate rather than fixed and exact. • Compared to traditional binary sets (true or false values) fuzzy logic variables may have a truth value that ranges in degree between 0 and 1 (no and yes). http://www.ieeeghn.org/wiki/index.php/Lotfi_A._Zadeh

  3. Human Reasoning • Fuzzy systems attempts to mimic human reasoning. • It can capture the degree of belongingness. E.g., • Is a student short, or tall? • In classical logic: h > 6 feet is tall and h6 is short. • How about 5 feet 11 inches? Some may call this tall, and some may call it short. • This information is captured as a matter of degree • This “degree” is called a truth value.

  4. Overview of a Fuzzy Inference System • The point of fuzzy logic is to map an input space to an output space. • The input space consists of a vector of truth values. • The primary mechanism for doing this is a list of if-then statements called rules.

  5. Process Defuzzyfication Fuzzification Crisp input  Fuzzy input  Crisp output Apply Fuzzy Operators and Implication  Fuzzy set

  6. A Fuzzy Inference System (FIS) A General Case A Specific Example Input Output Service Tip If service is good then tip is cheap If service is good then tip is average If service is excellent then tip is generous Rules Service is interpreted as {poor, good, excellent} Tip is assigned to be {cheap, average, generous} Input terms (interpret) Output terms (assign) A FIS interprets the values in the input vector and, based on some set of rules, assigns values to the output vector.

  7. Fuzzy Sets • Fuzzy logic starts with the concept of a fuzzy set. • A fuzzy set is a set without a crisp, clearly defined boundary. • It can contain elements with only a partial degree of membership.

  8. Fuzzy Sets Example A classical set: The set of days of the week unquestionably includes Monday, Thursday, and Saturday. It just as unquestionably excludes butter, liberty, and dorsal fins, and so on. A fuzzy set: Most would agree that Saturday and Sunday belong, but what about Friday? It feels like a part of the weekend, but somehow it seems like it should be technically excluded. Of any subject, one thing must be either asserted or denied In fuzzy logic, the truth of any statement becomes a matter of degree.

  9. Fuzzy Sets Example Contd. • Reasoning in fuzzy logic is a matter of generalizing the familiar yes-no (Boolean) logic. • If true = 1 and false = 0, fuzzy logic also permits in-between values like 0.2 and 0.7453. • Q: Is Saturday a weekend day? • A: 1 (yes, or true) • Q: Is Tuesday a weekend day? • A: 0 (no, or false) • Q: Is Friday a weekend day? • A: 0.8 (for the most part yes, but not completely) • Q: Is Sunday a weekend day? • A: 0.95 (yes, but not quite as much as Saturday).

  10. Truth values for weekend-ness if forced to respond with an absolute yes or no response Truth value for weekend-ness if allowed to respond with fuzzy in-between values Continuous-scale Time Plot of Weekend-ness for Two-valued And Multi-Valued Membership

  11. Example of Applying Truth Values • A temperature measurement for anti-lock brakes • Each function maps the same temperature value to a truth value in the 0 to 1 range. • These truth values can then be used to determine how the brakes should be controlled. Truth values of each of the three functions at a particular temperature http://en.wikipedia.org/wiki/Fuzzy_logic

  12. Membership Functions • A membership function (MF) is a curve that defines how each point in the input space is mapped to a membership value (or degree of membership) between 0 and 1. • The input space is sometimes referred to as the universe of discourse.

  13. Membership Functions Contd. • A smoothly varying curve that passes from not-tall to tall is the right way to represent. • The output-axis is a number known as the membership value between 0 and 1. • The curve is known as a membership function and is often given the designation of µ.

  14. Membership Func. in Fuzzy Logic Toolbox Triangular Membership Function Trapezoidal Membership Function Gaussian Membership Function Sigmoid Membership Function

  15. Logical Operations • Fuzzy logical reasoning is the fact that it is a superset of standard Boolean logic. Standard Truth Table Fuzzy Truth Table AND: min(A,B) OR: max(A,B) NOT: 1-A

  16. Application of Logical Operators

  17. If-Then Rules • Fuzzy sets and fuzzy operators are the subjects and verbs of fuzzy logic. These if-then rule statements are used to formulate the conditional statements that comprise fuzzy logic. • A single fuzzy if-then rule assumes the form • An example of such a rule might be if x is A then y is B If service is good then tip is average The if-part of the rule "x is A" is called the antecedent or premise. While the then-part of the rule "y is B" is called the consequent or conclusion.

  18. If-The Rules Contd. • In general, the input to an if-then rule is the current value for the input variable (in this case, service) • The output is an entire fuzzy set (in this case, average). • This set will later be defuzzified, assigning one value to the output.

  19. Process Defuzzyfication Fuzzification Crisp input  Fuzzy input  Crisp output Apply Fuzzy Operators and Implication  Fuzzy set

  20. Logical Operation of Then • The implication function then modifies that fuzzy set to the degree specified by the antecedent. • The most common ways to modify the output fuzzy set are • truncation using the min function • scaling using the prodfunction

  21. Summary of If-Then Rules • Interpreting if-then rules is a three-part process. • Fuzzify inputs: Resolve all fuzzy statements in the antecedent to a degree of membership between 0 and 1. If there is only one part to the antecedent, then this is the degree of support for the rule. • Apply fuzzy operator to multiple part antecedents: If there are multiple parts to the antecedent, apply fuzzy logic operators and resolve the antecedent to a single number between 0 and 1. This is the degree of support for the rule. • Apply implication method: Use the degree of support for the entire rule to shape the output fuzzy set. The consequent of a fuzzy rule assigns an entire fuzzy set to the output. This fuzzy set is represented by a membership function that is chosen to indicate the qualities of the consequent. If the antecedent is only partially true, (i.e., is assigned a value less than 1), then the output fuzzy set is truncated according to the implication method.

  22. Summary of If-Then Rules Contd. • In general, one rule alone is not effective. • Two or more rules that can play off one another are needed. • The output of each rule is a fuzzy set. • The output fuzzy sets for each rule are then aggregated into a single output fuzzy set. • Finally the resulting set is defuzzified, or resolved to a single number.

  23. Fuzzy Inference Systems

  24. What Are Fuzzy Inference Systems? • Fuzzy inference is the process of formulating the mapping from a given input to an output using fuzzy logic. • The mapping then provides a basis from which decisions can be made, or patterns discerned. • The process of fuzzy inference involves all of the pieces: • Membership Functions • Logical Operations • If-Then Rules. • We concentrate on the Mamdani-type FIS (EbrahimMamdani in 1975).

  25. Applications of FIS • Automatic control • Data classification • Decision analysis • Expert systems • Computer vision http://www.lg.com/au/washing-machines/lg-WT-H650-top-loader-washing-machine

  26. Overview of Fuzzy Inference Process

  27. Step 1. FuzzifyInputs • The first step is to take the inputs and determine the degree to which they belong to each of the appropriate fuzzy sets via membership functions.

  28. Step 2. Apply Fuzzy Operator • After fuzzification, the degree to which each part of the antecedent is satisfied for each rule is known. If the antecedent of a given rule has more than one part, the fuzzy operator is applied to obtain one number that represents the result of the antecedent for that rule.

  29. Step 3. Apply Implication Method • After applying a weight to each rule, the implication method is implemented. A consequent is a fuzzy set represented by a membership function, which weights appropriately the linguistic characteristics that are attributed to it. The consequent is reshaped using a function associated with the antecedent (a single number).

  30. Step 4. Aggregate All Outputs • Because decisions are based on the testing of all of the rules in a FIS, the rules must be combined in some manner in order to make a decision. Aggregation is the process by which the fuzzy sets that represent the outputs of each rule are combined into a single fuzzy set. • Methods: • max (maximum) • probor (probabilistic OR) • sum (simply the sum of each rule's output set)

  31. fuzzy tipper

  32. Step 5. Defuzzify • The input for the defuzzification process is a fuzzy set (the aggregate output fuzzy set) and the output is a single number. As much as fuzziness helps the rule evaluation during the intermediate steps, the final desired output for each variable is generally a single number. However, the aggregate of a fuzzy set encompasses a range of output values, and so must be defuzzified in order to resolve a single output value from the set. • Methods: centroid, bisector, middle of max, largest of max, smallest of max.

  33. Summary

More Related