CS344: Introduction to Artificial Intelligence (associated lab: CS386) Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture–2: Fuzzy Logic and Inferencing.

Slides:



Advertisements
Similar presentations
Fuzzy Expert System  An expert might say, “ Though the power transformer is slightly overloaded, I can keep this load for a while”.  Another expert.
Advertisements

Lecture 4 Fuzzy expert systems: Fuzzy logic
CS344 : Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 9,10,11- Logic; Deduction Theorem 23/1/09 to 30/1/09.
CLASSICAL LOGIC and FUZZY LOGIC. CLASSICAL LOGIC In classical logic, a simple proposition P is a linguistic, or declarative, statement contained within.
Fuzzy Sets and Applications Introduction Introduction Fuzzy Sets and Operations Fuzzy Sets and Operations.
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 11– Fuzzy Logic: Inferencing.
CS621: Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture–3: Some proofs in Fuzzy Sets and Fuzzy Logic 27 th July.
CS344 Artificial Intelligence Prof. Pushpak Bhattacharya Class on 6 Mar 2007.
Fuzzy Expert System. Basic Notions 1.Fuzzy Sets 2.Fuzzy representation in computer 3.Linguistic variables and hedges 4.Operations of fuzzy sets 5.Fuzzy.
Fuzzy Expert Systems. Lecture Outline What is fuzzy thinking? What is fuzzy thinking? Fuzzy sets Fuzzy sets Linguistic variables and hedges Linguistic.
CS344: Introduction to Artificial Intelligence (associated lab: CS386) Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture–1: Introduction.
FUZZY SYSTEMS. Fuzzy Systems Fuzzy Sets – To quantify and reason about fuzzy or vague terms of natural language – Example: hot, cold temperature small,
Approximate Reasoning 1 Expert Systems Dr. Samy Abu Nasser.
© C. Kemke Approximate Reasoning 1 COMP 4200: Expert Systems Dr. Christel Kemke Department of Computer Science University of Manitoba.
Fuzzy Expert System.
Chapter 18 Fuzzy Reasoning.
1 Chapter 18 Fuzzy Reasoning. 2 Chapter 18 Contents (1) l Bivalent and Multivalent Logics l Linguistic Variables l Fuzzy Sets l Membership Functions l.
WELCOME TO THE WORLD OF FUZZY SYSTEMS. DEFINITION Fuzzy logic is a superset of conventional (Boolean) logic that has been extended to handle the concept.
CS621: Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture–4: Fuzzy Inferencing 29 th July 2010.
BEE4333 Intelligent Control
Fuzzy Logic Jan Jantzen Logic is based on set theory, and when we switch to fuzzy sets it will have an effect on.
FUZZY LOGIC Babu Appat. OVERVIEW What is Fuzzy Logic? Where did it begin? Fuzzy Logic vs. Neural Networks Fuzzy Logic in Control Systems Fuzzy Logic in.
9/3/2015Intelligent Systems and Soft Computing1 Lecture 4 Fuzzy expert systems: Fuzzy logic Introduction, or what is fuzzy thinking? Introduction, or what.
CS344 : Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 1 - Introduction.
CS621: Introduction to Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture–1: Introduction 22 nd July 2010.
Fuzzy Sets Introduction/Overview Material for these slides obtained from: Modern Information Retrieval by Ricardo Baeza-Yates and Berthier Ribeiro-Neto.
Fuzzy Logic. Lecture Outline Fuzzy Systems Fuzzy Sets Membership Functions Fuzzy Operators Fuzzy Set Characteristics Fuzziness and Probability.
Theory and Applications
Fuzzy Expert Systems. 2 Motivation On vagueness “Everything is vague to a degree you do not realise until you have tried to make it precise.” Bertrand.
Fuzzy Inference (Expert) System
CS344 : Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 29 Introducing Neural Nets.
1 Asst. Prof. Dr. Sukanya Pongsuparb Dr. Srisupa Palakvangsa Na Ayudhya Dr. Benjarath Pupacdi SCCS451 Artificial Intelligence Week 9.
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 28– Interpretation; Herbrand Interpertation 30 th Sept, 2010.
CS621 : Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 1 - Introduction.
CS344: Introduction to Artificial Intelligence (associated lab: CS386) Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture–39: Recap.
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 37–Prolog- cut and backtracking; start of Fuzzy Logic.
CS621 : Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 30 Uncertainty, Fuizziness.
Logical Systems and Knowledge Representation Fuzzy Logical Systems 1.
Lógica difusa  Bayesian updating and certainty theory are techniques for handling the uncertainty that arises, or is assumed to arise, from statistical.
CS344: Introduction to Artificial Intelligence (associated lab: CS386) Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture–4: Fuzzy Control of Inverted.
Fuzzy Sets and Control. Fuzzy Logic The definition of Fuzzy logic is a form of multi-valued logic derived frommulti-valued logic fuzzy setfuzzy set theory.
CS344: Introduction to Artificial Intelligence (associated lab: CS386) Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture–3: Fuzzy Inferencing: Inverted.
Theory and Applications
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 38: Fuzzy Logic.
2.1 Sets 2.2 Set Operations –Set Operations –Venn Diagrams –Set Identities –Union and Intersection of Indexed Collections 2.3 Functions 2.4 Sequences and.
Prof. Pushpak Bhattacharyya, IIT Bombay 1 CS 621 Artificial Intelligence Lecture /08/05 Prof. Pushpak Bhattacharyya Fuzzy Set (contd) Fuzzy.
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture–2: Introduction: Search+Logic.
AI Fuzzy Systems. History, State of the Art, and Future Development Sde Seminal Paper “Fuzzy Logic” by Prof. Lotfi Zadeh, Faculty in Electrical.
Fuzzy Expert System n Introduction n Fuzzy sets n Linguistic variables and hedges n Operations of fuzzy sets n Fuzzy rules n Summary.
Chapter 19. Fuzzy Reasoning
Prof. Pushpak Bhattacharyya, IIT Bombay 1 CS 621 Artificial Intelligence Lecture 5 – 08/08/05 Prof. Pushpak Bhattacharyya FUZZY LOGIC & INFERENCING.
Prof. Pushpak Bhattacharyya, IIT Bombay 1 CS 621 Artificial Intelligence Lecture /08/05 Prof. Pushpak Bhattacharyya Fuzzy Logic Application.
Fuzzy Logic Artificial Intelligence Chapter 9. Outline Crisp Logic Fuzzy Logic Fuzzy Logic Applications Conclusion “traditional logic”: {true,false}
CS621 : Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 32 Fuzzy Expert System.
Prof. Pushpak Bhattacharyya, IIT Bombay1 CS 621 Artificial Intelligence Lecture /08/05 Prof. Pushpak Bhattacharyya Fuzzy Inferencing.
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 10– Uncertainty: Fuzzy Logic.
Introduction to Fuzzy Logic and Fuzzy Systems
Artificial Intelligence CIS 342
CS621: Introduction to Artificial Intelligence
CS344: Introduction to Artificial Intelligence (associated lab: CS386)
CLASSICAL LOGIC and FUZZY LOGIC
Financial Informatics –IX: Fuzzy Sets
CS621: Artificial Intelligence
Fuzzy Inferencing – Inverted Pendulum Problem
CS621: Artificial Intelligence
CS621 : Artificial Intelligence
Introduction to Fuzzy Set Theory
CS621 : Artificial Intelligence
Chapter 19. Fuzzy Reasoning
Presentation transcript:

CS344: Introduction to Artificial Intelligence (associated lab: CS386) Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture–2: Fuzzy Logic and Inferencing

Disciplines which form the core of AI- inner circle Fields which draw from these disciplines- outer circle. Planning Computer Vision NLP Expert Systems Robotics Search, Reasoning, Learning

Allied Disciplines PhilosophyKnowledge Rep., Logic, Foundation of AI (is AI possible?) MathsSearch, Analysis of search algos, logic EconomicsExpert Systems, Decision Theory, Principles of Rational Behavior PsychologyBehavioristic insights into AI programs Brain ScienceLearning, Neural Nets PhysicsLearning, Information Theory & AI, Entropy, Robotics Computer Sc. & Engg.Systems for AI

Fuzzy Logic tries to capture the human ability of reasoning with imprecise information Models Human Reasoning Works with imprecise statements such as: In a process control situation, “If the temperature is moderate and the pressure is high, then turn the knob slightly right” The rules have “Linguistic Variables”, typically adjectives qualified by adverbs (adverbs are hedges).

Underlying Theory: Theory of Fuzzy Sets Intimate connection between logic and set theory. Given any set ‘S’ and an element ‘e’, there is a very natural predicate, μ s (e) called as the belongingness predicate. The predicate is such that, μ s (e) = 1,iff e ∈ S = 0,otherwise For example, S = {1, 2, 3, 4}, μ s (1) = 1 and μ s (5) = 0 A predicate P(x) also defines a set naturally. S = {x | P(x) is true} For example, even(x) defines S = {x | x is even}

Fuzzy Set Theory (contd.) Fuzzy set theory starts by questioning the fundamental assumptions of set theory viz., the belongingness predicate, μ, value is 0 or 1. Instead in Fuzzy theory it is assumed that, μ s (e) = [0, 1] Fuzzy set theory is a generalization of classical set theory also called Crisp Set Theory. In real life belongingness is a fuzzy concept. Example: Let, T = set of “tall” people μ T (Ram) = 1.0 μ T (Shyam) = 0.2 Shyam belongs to T with degree 0.2.

Linguistic Variables Fuzzy sets are named by Linguistic Variables (typically adjectives). Underlying the LV is a numerical quantity E.g. For ‘tall’ (LV), ‘height’ is numerical quantity. Profile of a LV is the plot shown in the figure shown alongside. μ tall (h) height h

Example Profiles μ rich (w) wealth w μ poor (w) wealth w

Example Profiles μ A (x) x x Profile representing moderate (e.g. moderately rich) Profile representing extreme

Concept of Hedge Hedge is an intensifier Example: LV = tall, LV 1 = very tall, LV 2 = somewhat tall ‘very’ operation: μ very tall (x) = μ 2 tall (x) ‘somewhat’ operation: μ somewhat tall (x) = √(μ tall (x)) 1 0 h μ tall (h) somewhat tall tall very tall

Representing sets 2 ways of representing sets By extension – actual listing of elements A = {2, 4, 6, 8,....} By intension – assertion of properties of elements belonging to the set A = {x|x mod 2 = 0 }

Belongingness Predicate Let U = {1,2,3,4,5,6} Let A = {2,4,6} A = {0.0/1, 1.0/2, 0.0/3, 1.0/4, 0.0/5, 1.0/6} Every subset of U is a point in a 6 dimensional space

Representation of Fuzzy sets Let U = {x 1,x 2,…..,x n } |U| = n The various sets composed of elements from U are presented as points on and inside the n-dimensional hypercube. The crisp sets are the corners of the hypercube. (1,0) (0,0) (0,1) (1,1) x1x1 x2x2 x1x1 x2x2 (x 1,x 2 ) A(0.3,0.4) μ A (x 1 )=0.3 μ A (x 2 )=0.4 Φ U={x 1,x 2 } A fuzzy set A is represented by a point in the n-dimensional space as the point {μ A (x 1 ), μ A (x 2 ),……μ A (x n )}

Degree of fuzziness The centre of the hypercube is the “most fuzzy” set. Fuzziness decreases as one nears the corners Measure of fuzziness Called the entropy of a fuzzy set Entropy Fuzzy setFarthest corner Nearest corner

(1,0) (0,0) (0,1) (1,1) x1x1 x2x2 d(A, nearest) d(A, farthest) (0.5,0.5) A

Definition Distance between two fuzzy sets L 1 - norm Let C = fuzzy set represented by the centre point d(c,nearest) = | | + |0.5 – 0.0| = 1 = d(C,farthest) => E(C) = 1

Definition Cardinality of a fuzzy set [generalization of cardinality of classical sets] Union, Intersection, complementation, subset hood

Note on definition by extension and intension S 1 = {x i |x i mod 2 = 0 } – Intension S 2 = {0,2,4,6,8,10,………..} – extension How to define subset hood? Conceptual problem μ B (x) <= μ A (x) means B ε P(A), i.e., μ P(A) (B)=1; Goes against the grain of fuzzy logic

History of Fuzzy Logic Fuzzy logic was first developed by Lofti Zadeh in 1967 µ took values in [0,1] Subsethood was given as µB(x) <= µA(x) for all x This was questioned in 1970s leading to Lukasiewitz formula

Lukasiewitz formula for Fuzzy Implication t(P) = truth value of a proposition/predicate. In fuzzy logic t(P) = [0,1] t( ) = min[1,1 -t(P)+t(Q)] Lukasiewitz definition of implication

Fuzzy Inferencing Two methods of inferencing in classical logic Modus Ponens Given p and p  q, infer q Modus Tolens Given ~q and p  q, infer ~p How is fuzzy inferencing done?

Classical Modus Ponens in tems of truth values Given t(p)=1 and t(p  q)=1, infer t(q)=1 In fuzzy logic, given t(p)>=a, 0<=a<=1 and t(p  >q)=c, 0<=c<=1 What is t(q) How much of truth is transferred over the channel pq

Use Lukasiewitz definition t(p  q) = min[1,1 -t(p)+t(q)] We have t(p->q)=c, i.e., min[1,1 -t(p)+t(q)]=c Case 1: c=1 gives 1 -t(p)+t(q)>=1, i.e., t(q)>=a Otherwise, 1 -t(p)+t(q)=c, i.e., t(q)>=c+a-1 Combining, t(q)=max(0,a+c-1) This is the amount of truth transferred over the channel p  q

Eg: If pressure is high then Volume is low Pressure/ Volume High Pressure ANDING of Clauses on the LHS of implication Low Volume

Fuzzy Inferencing Core The Lukasiewitz rule t( ) = min[1,1 + t(P) – t(Q)] An example Controlling an inverted pendulum θ = angular velocity Motor i=current

The goal: To keep the pendulum in vertical position (θ=0) in dynamic equilibrium. Whenever the pendulum departs from vertical, a torque is produced by sending a current ‘i’ Controlling factors for appropriate current Angle θ, Angular velocity θ. Some intuitive rules If θ is +ve small and θ. is –ve small then current is zero If θ is +ve small and θ. is +ve small then current is –ve medium

-ve med -ve small Zero +ve small +ve med -ve med -ve small Zero +ve small +ve med +ve small -ve small -ve med -ve small +ve small Zero Region of interest Control Matrix θ.θ. θ

Each cell is a rule of the form If θ is <> and θ. is <> then i is <> 4 “Centre rules” 1.if θ = = Zero and θ. = = Zero then i = Zero 2.if θ is +ve small and θ. = = Zero then i is –ve small 3.if θ is –ve small and θ. = = Zero then i is +ve small 4.if θ = = Zero and θ. is +ve small then i is –ve small 5. if θ = = Zero and θ. is –ve small then i is +ve small

Linguistic variables 1.Zero 2.+ve small 3.-ve small Profiles -ε-ε+ε+ε ε2 ε2 -ε2-ε2 -ε3-ε3 ε3ε3 +ve small -ve small 1 Quantity (θ, θ., i) zero

Inference procedure 1. Read actual numerical values of θ and θ. 2. Get the corresponding μ values μ Zero, μ (+ve small), μ (-ve small). This is called FUZZIFICATION 3. For different rules, get the fuzzy I-values from the R.H.S of the rules. 4. “ Collate ” by some method and get ONE current value. This is called DEFUZZIFICATION 5. Result is one numerical value of ‘ i ’.

if θ is Zero and dθ/dt is Zero then i is Zero if θ is Zero and dθ/dt is +ve small then i is –ve small if θ is +ve small and dθ/dt is Zero then i is –ve small if θ +ve small and dθ/dt is +ve small then i is -ve medium -ε-ε+ε+ε ε2 ε2 -ε2-ε2 -ε3-ε3 ε3ε3 +ve small -ve small 1 Quantity (θ, θ., i) zero Rules Involved

Suppose θ is 1 radian and dθ/dt is 1 rad/sec μ zero (θ =1)=0.8 (say) Μ +ve-small (θ =1)=0.4 (say) μ zero (dθ/dt =1)=0.3 (say) μ +ve-small (dθ/dt =1)=0.7 (say) -ε-ε+ε+ε ε2 ε2 -ε2-ε2 -ε3-ε3 ε3ε3 +ve small -ve small 1 Quantity (θ, θ., i) zero Fuzzification 1rad 1 rad/sec

Suppose θ is 1 radian and dθ/dt is 1 rad/sec μ zero (θ =1)=0.8 (say) μ +ve-small (θ =1)=0.4 (say) μ zero (dθ/dt =1)=0.3 (say) μ +ve-small (dθ/dt =1)=0.7 (say) Fuzzification if θ is Zero and dθ/dt is Zero then i is Zero min(0.8, 0.3)=0.3 hence μ zero (i)=0.3 if θ is Zero and dθ/dt is +ve small then i is –ve small min(0.8, 0.7)=0.7 hence μ -ve-small (i)=0.7 if θ is +ve small and dθ/dt is Zero then i is –ve small min(0.4, 0.3)=0.3 hence μ-ve-small(i)=0.3 if θ +ve small and dθ/dt is +ve small then i is -ve medium min(0.4, 0.7)=0.4 hence μ -ve-medium (i)=0.4

-ε-ε+ε+ε -ε2-ε2 -ε3-ε3 -ve small 1 zero Finding i Possible candidates: i=0.5 and -0.5 from the “zero” profile and μ=0.3 i=-0.1 and -2.5 from the “-ve-small” profile and μ=0.3 i=-1.7 and -4.1 from the “-ve-small” profile and μ= ve small -ve medium 0.7

-ε-ε+ε+ε -ve small zero Defuzzification: Finding i by the centroid method Possible candidates: i is the x-coord of the centroid of the areas given by the blue trapezium, the green trapeziums and the black trapezium ve medium Required i value Centroid of three trapezoids