Fuzzy Reasoning
Total Page:16
File Type:pdf, Size:1020Kb
Fuzzy Reasoning Outline ●Introduction ●Bivalent & Multivalent Logics ●Fundamental fuzzy concepts ●Fuzzification ●Defuzzification ●Fuzzy Expert System ●Neuro-fuzzy System Introduction ●Fuzzy concept first introduced by Lotfi Zadeh in the 1965 ●Form of many-valued logic; it deals with reasoning that is approximate rather than fixed and exact. Compared to traditional binary sets, fuzzy logic variables may have a truth value that ranges in degree between 0 and 1 ●Resembles human reasoning in its use of imprecise information to generate decisions, unlike classical logic which requires a deep understanding of a system, exact equations, and precise numeric values Bivalent Logics ●Classical logic, often described as Aristotelian logic – True or false ●Bayesian Reasoning and probabilistic models – Each fact is either True or false – Often unclear whether a given fact is true or false ●Probability – A particular expression will turn out to be true Multivalent Logics ●Three-valued logic – True , false, and undetermined – 1 represents true, 0 represents false, and real numbers between 0 and 1 represent degree of truth Bivalent Logic vs. Multivalent Logic ●A fact has a probability value of 0.5, means it is as likely to be true as it is to be false, or it will be either true or false – There is Uncertainty , (at the moment we don’t know whether the proposition will be true or false, but it will definitely either be true or false—not both, not neither, and not something in between) ●A proposition has a logical value of 0.5, means it is about the degree to which that statement is true – We are Certain of the truth value of the proposition, it is just vague (it is neither true nor false, or it is both true and false) Linguistic Variables ●Often used to facilitate the expression of rules and facts ●A linguistic variable such as “height” may have a value from a range of fuzzy values including “tall” “short” and “medium.” ●It may be defined over the Universe of discourse from 2 feet up to 8 feet. ●The values “tall”, “short”, and “medium” define subsets of this universe of discourse. Fuzzy Sets vs. Traditional Sets ●Taditional set, Crisp set – Defined by the values that are contained within it. – A value is either within the set, or it is not. e.g a set of natural number ●Fuzzy set – Each value is a member of the set to some degree, or is not a member of the set to some degree. – Example: the tall people. Bill is 7 feet tall, so he is definitely included in the set of tall people, John is 4 feet tall, so most say that he is not included in the set, and Jane is 5 feet tall, some would say she is tall, but others would say she is not Fuzzy Set ●Fuzzy set membership function – Fuzzy set A is defined by membership function MA. – Choose entirely arbitrarily, reflect a subjective view on the part of the author. – A list of pairs for representing fuzzy set in computer like A = {(x1,MA(x1)), . , (xn,MA(xn))} Fuzzy Set operator ●Traditional set theory – Not A the complement of A, Intersection, and Union – Commutative, Associative, Distributive, and DeMorgan's law ●Fuzzy set – Complement of A, M¬A(x) = 1 - MA(x) – Intersection, MA ∩ B (x) = MIN (MA (x),MB (x)) – Union, MA ∪ B (x) = MAX (MA (x),MB (x)) – Containment, B ⊂ A iff ∀x (MB (x) ≤ MA (x)) – Hedges ●Fuzzy set qualifier such as “very”, “quite”, “extremely”, or “somewhat” ●Produce a new set when of them is applied to a fuzzy set ●Raise the set's membership function to an appropriate power. e.g a membership value of “very tall people” is (MA(x))², or a membership value of “quite tall people” is (MA(x))¹·³ Fuzzy Logic ●Form of logic that applies to fuzzy variables ●Each fuzzy variable can take a value from 0 (not at all true) to 1 (entirely true). e.g 0.5 might indicate “somewhat true”, or “about as true as it is false” ●Use Min, Max for calculating the conjunction (˄)and disjunction (˅) of two fuzzy variables ●If A and B are fuzzy logic values, ● A ˅ B ≡ MAX (A,B) ● A ˄ B ≡ MIN (A,B) ¬A = 1- A Classical Logic vs. Fuzzy Logic ●Classical logic – A ∨ ¬A = TRUE – A ∧ ¬A = FALSE ●Fuzzy logic – A ∨ ¬A can be to some extend false – A ∧ ¬A can be to some extend true Fuzzy Logic ●Fuzzy truth table for a finite set of input. Set {0, 0.5, 1} A B A˅B 0 0 0 0 0.5 0.5 0 1 1 0.5 0 0.5 0.5 0.5 0.5 0.5 1 1 1 0 1 1 0.5 1 1 1 1 Fuzzy Logic A ̚A 0 1 0.5 0.5 1 0 ●Fuzzy logic implication, or → A B A->B 0 0 1 0 0.5 1 0 1 1 * 0.5 0 0.5 * 0.5 0.5 0.5 0.5 1 1 1 0 0 1 0.5 0.5 1 1 1 ●One of alternative for fuzzy implication is Godel implication A→B ≡ (A ≤ B) ∨ B A B A->B 0 0 1 0 0.5 1 0 1 1 0.5 0 0 0.5 0.5 1 0.5 1 1 1 0 0 1 0.5 0.5 1 1 1 Fuzzy Logic as Applied to Traditional Logic Paradox ●Rusell's paradox : ● “ A barber, who himself has a beard, shaves all men who do not shave themselves. He does not shave man who shave themselves.” ●Paradox: conclusion contradicts one or more of the premises ●“All Cretan are liar,” said the Cretan. ●The Paradox can be resolved by Fuzzy logical values, instead of the two logical values “true” and “false”, the Cretan's statement is true and false, to some extend, at the same time. ● Rules ●Ordinary rule: IF A THEN B ●Fuzzy rule : IF A=x THEN B=y ●IF A op x THEN B=y ●e.g. IF temperature > 50 then fan speed = fast IF study time = short then grades = poor Fuzzy Inference ●Mamdani implication : an alternative to Godel implication ●It allows a system to take in a set of crisp input values and apply a set of fuzzy rules to those values, in order to derive a single, crisp, output value or action recommendation. Fuzzy Logic System How this form of reasoning work? Example: Braking system for a car to cope when the roads are icy and the wheels lock. Step 1 – Define the Rules ●Rule 1: IF pressure on brake pedal is medium THEN apply the brake ●Rule 2: IF pressure on brake pedal is high AND car speed is fast AND wheel speed is fast THEN apply the brake ●Rule 3: IF pressure on brake pedal is high AND car speed is fast AND wheel speed is low THEN release the brake ●Rule 4: IF pressure on brake pedal is low THEN release the brake Step 2 : Fuzzification ●Define fuzzy set for various linguistic variables ●Pressure from 0 to 100, so brake measure can be defined such as having 3 linguistic values, such as High(H),Medium(M), Low(L). ●H={(50,0),(100,1)} ●M={(30,0),(50,1),(70,0)} ●L={(0,1),(50,0)} ●Suppose pressure value is 60, so fuzzy membership for the 3 sets: MH(60)=0.2 , MM(60)=0.5, ML(60)=0 Step 2 : Fuzzification ●Define wheel speed with having 3 linguistic values: Slow, Medium, Fast ●Membership function: S={(0,1),(60,0)} ●M={(20,0),(50,1),(80,0)} ●F={(40,0),(100,1)} ●If wheel speed is 55 then MS(55)=0.083, MM(55)=0.833, MF(55)=0.25 Step 2 : Fuzzification ●Define car speed with having 3 linguistic values: Slow, Medium, Fast ●Membership function: S={(0,1),(60,0)} ●M={(20,0),(50,1),(80,0)} ●F={(40,0),(100,1)} ●If car speed is 80 then MS(80)=0, MM(80)=0, MF(80)=0.667 Step3: Apply Fuzzy Values To The System's Rules ●Rule 1: MM(60)=0.5 , it shows “Apply the brake” ●Rule 2: MH(60)=0.2, MF(80)=0.667, MF(55)=0.25, So fuzzy value of 0.2 for “Apply the brake” ●Rule 3: MH(60)=0.2, MF(80)=0.667, MS(55)=0.083, So fuzzy value of 0.083 for “Release the brake” ●Rule 4: ML(60)=0, So fuzzy value of 0.083 for “Release the brake” ●How to combine the differing values for each of the two fuzzy variables? Sum the values ●So we have 0.7 for “Apply the brake” and 0.083 for “Release the brake” ●Clip the membership function to the values, the member function of A has been clipped to 0.7 and the member function of R has been clipped to 0.083 Step 4: Defuzzification ●Process of obtaining the crisp value from a set of fuzzy variables ●This can be done by the center of gravity ●C=∑(MA(x)*x)/∑MA(x) , ●=((5*0.083)+(10*0.1)+(15*0.15)+......+(100*1))/(0.083+0.1+0.15+.....+ 1) = 68.13 ●C shows the pressure applied by the brake to the wheel in the car Fuzzy expert system ●Expert system contains a set of rules that are developed in collaboration with an expert ●The fuzzy expert system can be built by choosing a set of linguistic variables appropriate to the problem and defining membership functions for those variables. Rules are then generated based on the expert’s knowledge and using the linguistic variables.