580 likes | 596 Views
Fuzzy Expert Systems. Motivation On vagueness “Everything is vague to a degree you do not realise until you have tried to make it precise.” Bertrand Russell. The world is imprecise. Mathematical and Statistical techniques often unsatisfactory.
E N D
Motivation On vagueness “Everything is vague to a degree you do not realise until you have tried to make it precise.” Bertrand Russell
The world is imprecise. • Mathematical and Statistical techniques often unsatisfactory. • Experts make decisions with imprecise data in an uncertain world. • They work with knowledge that is rarely defined mathematically or algorithmically but uses vague terminology with words. • Fuzzy logic is able to use vagueness to achieve a precise answer. By considering shades of grey and all factors simultaneously, you get a better answer, one that is more suited to the situation.
Outline “ So far as the laws of mathematics refer to reality, they are not certain. And so far as they are certain, they do not refer to reality." - Albert Einstein • Introduction (Fuzzy Logic) • Fuzzy Sets & Rules • Fuzzy Expert Systems
Introduction - Fuzzy Logic • Fuzzy logic is a superset of boolean logic • It was created by Dr. Lotfi Zadeh in 1960s for the purpose of modeling the uncertainty inherent in natural language • In fuzzy logic, it is possible to have partial truth values
Fuzzy Logic • Unlike two-valued Boolean logic, fuzzy logic is multivalued. • It deals with degrees of membership and degrees of truth.
Fuzzy Logic – cont’d • Fuzzy logic is based on the idea that all things admit of degrees • Temperature – “It is very cold” • Height – “He is very tall guy” • Speed – ... • Beauty – ...
Fuzzy Sets & Rules • A fuzzy set is a set with fuzzy boundaries. • In classical set theory; fA(x):X {0,1}, wherefA(x) = • In fuzzy sets; A(x):X {0,1}, whereA(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 1, if xA 0, if xA
Fuzzy Sets & Rules – cont’d • A(x) is the “membership function”. • Value of this function is between 0 and 1. • This value represents the “degree of membership” (membership value) of element x in set A.
Fuzzy Sets & Rules – cont’d • Classical tall men example.
Fuzzy Sets & Rules – cont’d • Crisp and fuzzy sets of tall men
Fuzzy Sets Membership functions representing three fuzzy sets for the variable "height".
Fuzzy Sets... Representing crisp and fuzzy sets as subsets of a domain (universe) U".
Fuzzy Sets... Support of a fuzzy set A
Fuzzy Sets... I-cut of a fuzzy set
Notation For the member, x, of a discrete set with membership µ we use the notation µ/x . In other words, x is a member of the set to degree µ. Discrete sets are written as: A = µ1/x1 + µ2/x2 + .......... + µn/xn Or where x1, x2....xn are members of the set A and µ1, µ2, ...., µn are their degrees of membership. A continuous fuzzy set A is written as:
Fuzzy Sets - Example “numbers close to 1”
Fuzzy Sets • The members of a fuzzy set are members to some degree, known as a membership grade or degree of membership. • The membership grade is the degree of belonging to the fuzzy set. The larger the number (in [0,1]) the more the degree of belonging. (N.B. This is not a probability) • The translation from x to µA(x) is known as fuzzification. • A fuzzy set is either continuous or discrete. • Graphical representation of membership functions is very useful.
Fuzzy Sets - Example Again, notice the overlapping of the sets reflecting the real world more accurately than if we were using a traditional approach.
Imprecision Words are used to capture imprecise notions, loose concepts or perceptions.
Operations with fuzzy sets Five operations with two fuzzy sets A and B approximately represented in a graphical form
Operations with fuzzy sets... Showing graphically one way to measuring similarity and distance between fuzzy sets A and B. The black area represents quantitatively the measure.
Union & Intersection of Fuzzy Sets: T-norms and T-conorms Introduced to enable generalisation from boolean to multi-valued logic • Building blocks of fuzzy systems • Only a few used in real applications t-norms define a general class of intersection operators for fuzzy sets t-conorms define a general class of aggregation operators for union of fuzzy sets • How do we use them? • Most commonly used t-norm for fuzzy intersection is to take the minimum • Most commonly used t-conorm for fuzzy union is to take the maximum.
Fuzziness versus probability • Probability density function for throwing a dice and the membership functions of the concepts "Small" number, "Medium", "Big".
Developing a FS • Determining the Membership Function • ‘heuristic’ approach where the developer sits down with an expert • Statistical techniques • Neural networks and genetic algorithms have also been used • Determining the Rules • type of rules that should be used • content of the rules • Composition operators (i.e. combining rules) • Defuzzification (i.e. getting a crisp output).
Example - Dinner for two Dinner for two: this is a 2 input, 1 output, 3 rule system Rule 1 If service is poor or food is rancid, then tip is cheap Input 1 Service (0-10) Output Tip (5-25%) Rule 2 If service is good, then tip is average Input 2 Food (0-10) Rule 3 If service is excellent or food is delicious, then tip is generous The result is a crisp (non-fuzzy) number The inputs are crisp (non-fuzzy) numbers limited to a specific range All rules are evaluated in parallel using fuzzy reasoning The results of the rules are combined and distilled (de-fuzzyfied)
Dinner for two • Fuzzify the input: • Apply Fuzzy operator
Dinner for two 3. Apply implication method
Dinner for two 4. Aggregate all outputs
Dinner for two • 5. defuzzify Various approaches e.g. centre of area mean of max
Mamdani Procedure(overview) For given values of x and y (using min for AND and max or OR): Or max for an ‘or’ i.e. aggregate all the truncated sets
Standard membership functions: single-valued, or singleton triangular trapezoidal S-function (sigmoid function): S(u) = 0, u<=a S(u) = 2((u-a)/(c-a))2 , a <u <= b S(u) = 1 - 2((u-a)/(c -a))2 , b <u <= c S(u) = 1, u > c. Conceptualising in fuzzy terms
more standard membership functions... Z function: Z(u)= 1 - S(u) Pi - function: P(u)=S(u), u<=b; P(u)=Z(u), u>b. Two parameters must be defined for the quantization procedure: the number of the fuzzy labels; the form of the membership functions for each of the fuzzy labels. Conceptualising in fuzzy terms...
Conceptualising in fuzzy terms... • Standard types of membership functions: Z function; n function; S function; trapezoidal function; triangular function; singleton.
Conceptualising in fuzzy terms... • One representation for the fuzzy number "about 600".
Conceptualising in fuzzy terms... Representing truthfulness (certainty) of events as fuzzy sets over the [0,1] domain.
Fuzzy relations and fuzzy implications... (a) Membership functions for fuzzy sets for the Smoker and the Risk of Cancer case example. (b) The Rc implication relation: "heavy smoker > high risk of cancer" in a matrix form.
Fuzzy Sets & Rules – cont’d • Fuzzy rules. • A fuzzy rule can be defined as a conditional statement as below. IF x is A THEN y is B
Fuzzy Sets & Rules – cont’d • Differences between classical and fuzzy rules. IF height is > 1.80 THEN select_for_team • In fuzzy rules; IF height is tall THEN select_for_team
Fuzzy Sets & Rules – cont’d • A fuzzy rule can have multiple antecedents. IF height is tall AND age is small THEN select_for_team • Or, another example IF service is excellent OR food is delicious THEN tip is generous
Fuzzy systems • A Fuzzy system consists of: • Fuzzy input and output variables • Fuzzy rules • Fuzzy inference
Rule 1: IF (CScore is high) and (CRatio is good) and (CCredit is good) then (Decision is approve) Rule 2: IF (CScore is low) and (CRatio is bad) or (CCredit is bad) then (Decision is disapprove) Fuzzy rules
Fuzzy inference methods • Inputs to a fuzzy system can be: • fuzzy, e.g. (Score = Moderate), defined by membership functions; • exact, e.g.: (Score = 190); (Theta = 35), defined by crisp values • Outputs from a fuzzy system can be: • - fuzzy, i.e. a whole membership function. • - exact, i.e. a single value is produced .
Fuzzy Expert Systems • A “fuzzy expert system” is an expert system that uses a collection of fuzzy membership functions and rules, to reason about data. • Fuzzy logic is primarily used as the underlying logic of Fuzzy Expert systems
Fuzzy Expert Systems – cont’d • Fuzzy logic is used to define rules of inference, and membership functions that allow a expert system to draw conclusions • The rules in a fuzzy expert system are usually of a form similar to the following: if x is low and y is high then z = medium
Fuzzy Expert Systems – cont’d • How is Fuzzy Logic used? • Define the control objectives and criteria • Determine the input and output relationships • Use the rule-based structure of FL, break the control problem down into a series of IF X AND Y THEN Z rules
Fuzzy Expert Systems – cont’d • How is Fuzzy Logic used? • Create FL membership functions that define the meaning (values) of Input/Output terms used in the rules. • Create the necessary rules. • Test the system, evaluate the results, tune the rules and membership functions, and retest until satisfactory results are obtained.
Fuzzy Expert Systems – cont’d • Experts rely on common sense when they solve problems. • Fuzzy logic reflects how people think. It attempts to model our decision making, and our common sense. • Leads to new, more human, intelligent systems.
Fuzzy Expert Systems – cont’d • Fuzzy rules of inference are used to form what is commonly referred to as a “knowledge base” which acts as a repository of information from which an expert system can make decisions.