Waqas Haider Bangyal. Course Contents Introduction Crisp / Classical Set Theory Fuzzy Set Theory Crisp Logic Fuzzy Logic Fuzzy Inference System (FIS)

Slides:



Advertisements
Similar presentations
Graphical Technique of Inference
Advertisements

Fuzzy Expert System  An expert might say, “ Though the power transformer is slightly overloaded, I can keep this load for a while”.  Another expert.
Lecture 4 Fuzzy expert systems: Fuzzy logic
Fuzzy Systems and Control Günay Karlı, Ph.D.. Before we begin… some clever people have said in the past…
CS 561, Sessions This time: Fuzzy Logic and Fuzzy Inference Why use fuzzy logic? Tipping example Fuzzy set theory Fuzzy inference.
Soft Computing. Per Printz Madsen Section of Automation and Control
Fuzzy Logic The restriction of classical propositional calculus to a two- valued logic has created many interesting paradoxes over the ages. For example,
CLASSICAL LOGIC and FUZZY LOGIC. CLASSICAL LOGIC In classical logic, a simple proposition P is a linguistic, or declarative, statement contained within.
Fuzzy Expert System Fuzzy Logic
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.
FUZZY SYSTEMS. Fuzzy Systems Fuzzy Sets – To quantify and reason about fuzzy or vague terms of natural language – Example: hot, cold temperature small,
Lecture 07 Fuzzy Reasoning
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.
COMP 578 Fuzzy Sets in Data Mining Keith C.C. Chan Department of Computing The Hong Kong Polytechnic University.
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.
Introduction What is Fuzzy Logic? HOW DOES FL WORK? Differences between Classical set (crisps) and Fuzzy set theory Example 1 Example 2 Classifying Houses.
Propositional Calculus Math Foundations of Computer Science.
Intro to Set Theory. Sets and Their Elements A set A is a collection of elements. If x is an element of A, we write x  A; if not: x  A. Say: “x is a.
Fuzzy Logic BY: ASHLEY REYNOLDS. Where Fuzzy Logic Falls in the Field of Mathematics  Mathematics  Mathematical Logic and Foundations  Fuzzy Logic.
BEE4333 Intelligent Control
Adapted from Discrete Math
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.
Propositions and Truth Tables
2009/9 1 Logic and Proofs §1.1 Introduction §1.2 Propositional Equivalences §1.3 Predicates and Quantifiers §1.4 Nested Quantifiers §1.5~7 Methods of Proofs.
Fuzzy Sets Introduction/Overview Material for these slides obtained from: Modern Information Retrieval by Ricardo Baeza-Yates and Berthier Ribeiro-Neto.
CS 285- Discrete Mathematics Lecture 2. Section 1.1 Propositional Logic Propositions Conditional Statements Truth Tables of Compound Propositions Translating.
Fuzzy Logic. Lecture Outline Fuzzy Systems Fuzzy Sets Membership Functions Fuzzy Operators Fuzzy Set Characteristics Fuzziness and Probability.
Fuzzy Rules 1965 paper: “Fuzzy Sets” (Lotfi Zadeh) Apply natural language terms to a formal system of mathematical logic
10/6/2015 1Intelligent Systems and Soft Computing Lecture 0 What is Soft Computing.
Abstract: This paper describes a real life application of fuzzy logic: A Fuzzy Traffic Light Controller. The controller changes the cycle time of the light.
 Definition Definition  Bit of History Bit of History  Why Fuzzy Logic? Why Fuzzy Logic?  Applications Applications  Fuzzy Logic Operators Fuzzy.
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
So Far……  Clustering basics, necessity for clustering, Usage in various fields : engineering and industrial fields  Properties : hierarchical, flat,
Barnett/Ziegler/Byleen Finite Mathematics 11e1 Chapter 7 Review Important Terms, Symbols, Concepts 7.1. Logic A proposition is a statement (not a question.
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
Logical Systems and Knowledge Representation Fuzzy Logical Systems 1.
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.
Copyright © Cengage Learning. All rights reserved.
“Principles of Soft Computing, 2 nd Edition” by S.N. Sivanandam & SN Deepa Copyright  2011 Wiley India Pvt. Ltd. All rights reserved. CHAPTER 12 FUZZY.
Mathematical Preliminaries
Sets Definition: A set is an unordered collection of objects, called elements or members of the set. A set is said to contain its elements. We write a.
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.
Fuzzy Logic Artificial Intelligence Chapter 9. Outline Crisp Logic Fuzzy Logic Fuzzy Logic Applications Conclusion “traditional logic”: {true,false}
Fuzzy Logic 1. Introduction Form of multivalued logic Deals reasoning that is approximate rather than precise The fuzzy logic variables may have a membership.
Dinner for Two. Fuzzify Inputs Apply Fuzzy Operator.
VIDYA PRATISHTHAN’S COLLEGE OF ENGINEERING, BARAMATI.
Lecture 4 Fuzzy expert systems: Fuzzy logic n Introduction, or what is fuzzy thinking? n Fuzzy sets n Linguistic variables and hedges n Operations of fuzzy.
Chapter 13 (Continued) Fuzzy Expert Systems 1. Fuzzy Rule-based Expert System 2.
Introduction to Fuzzy Logic and Fuzzy Systems
Artificial Intelligence CIS 342
Expert System Structure
SOFT COMPUTING.
Artificial Intelligence
Fuzzy Logic and Fuzzy Sets
Fuzzy logic Introduction 3 Fuzzy Inference Aleksandar Rakić
CLASSICAL LOGIC and FUZZY LOGIC
Dr. Unnikrishnan P.C. Professor, EEE
FUZZIFICATION AND DEFUZZIFICATION
Dr. Unnikrishnan P.C. Professor, EEE
This time: Fuzzy Logic and Fuzzy Inference
© Negnevitsky, Pearson Education, Lecture 4 Fuzzy expert systems: Fuzzy logic Introduction, or what is fuzzy thinking? Introduction, or what is.
Fuzzy Logic KH Wong Fuzzy Logic v.9a.
Presentation transcript:

Waqas Haider Bangyal

Course Contents Introduction Crisp / Classical Set Theory Fuzzy Set Theory Crisp Logic Fuzzy Logic Fuzzy Inference System (FIS) 2

Books to Follow… Text book Neural Networks, Fuzzy Logic, and Genetic Algorithms S. Rajasekaran and G.A. Vijayalakshmi Pai (We have to cover Chapters 6 and 7 in the book.) Reference Books Fuzzy Logic Toolbox for Use with MALAB: User’s Guide Digital Image Processing (3 rd Edition) Gonzalez and Woods 3

4

How Do We Answer These Queries? Is it a dolphin? Yes / No What is the current room-temperature? 20°C, 25°C, 30°C, 35°C, etc What is the running time of each iteration of the loop in the program? 5 ms, 40 ms, 1 s, etc These types of statements are called “crisp”, because they are precise and clear. 5

How Do We Answer These Queries? Is she honest? Extremely Honest, Very Honest, Honest at Times, Very Dishonest, or Extremely Dishonest Is he tall? Very Tall, Slightly Tall, Medium, Slightly Short, Very Short These kinds of statements are called “fuzzy”, because they are vague. 6

Logic Logic is the science of reasoning. Example 1: If the switch B is pressed and the electricity is present, then the bulb will be turned on. Example 2: If the water is hot and the tea-sachet is dipped in it, then the water color will become brown. 1 st example represents classical / crisp logic 2 nd example represents fuzzy logic. 7

Crisp Boundaries in Real Life… Often, it is hard to set crisp or precise boundaries in the real life. For example: A student is good, if he receives marks more than 60%. What if someone gets 59.8%? A person is tall, if his height is more than 6.5 ft.? What if someone is 6.4 ft? A thing is heavy, if its weight is more than 20 kg? What if something weighs 19.8 kg? 8

What is Fuzzy Logic (FL)? It is the logic that deals with the relative importance of precision. How important is it to be exactly right when a rough (vague) answer will do? Fuzzy set theory is an excellent mathematical tool to handle the uncertainty arising due to vagueness. It was originally proposed by Lutfi A. Zadeh in

What is Fuzzy Logic? (contd.) Fuzzy logic is a convenient way to map an input space to an output space. It says… You tell me how good your service was at a restaurant… I’ll tell you what the tip for the waiter should be. You tell me how hot you want the water… I’ll adjust the faucet valve to the right setting. You tell me how far away the subject of your photograph is… I’ll focus the lens for you. You tell me how fast the car is going and how hard the motor is working… I’ll shift the gears for you. 10

Input-Output Mapping What could go in the black box? Fuzzy system, linear system, expert system, neural network, differential equations, interpolated multidimensional lookup tables, or even a spiritual advisor. In almost every case, you can build the same product without fuzzy logic, but fuzzy is faster and cheaper — Lotfi Zadeh 11

Why Fuzzy Logic? It is conceptually easy to understand. The mathematical concepts behind fuzzy reasoning are very simple. It is flexible. With any given system, it’s easy to layer more functionality on top of it without starting again from scratch. It can easily model nonlinear functions. You can create a fuzzy system to match any set of input- output data. This process is made particularly easy by adaptive techniques like ANFIS (Adaptive Neuro-Fuzzy Inference Systems). 12

Where is Fuzzy Logic Used? The past few years have witnessed a rapid growth in the number and variety of applications of fuzzy logic. It is being used in: Consumer products (e.g., cameras, camcorders, washing machines, and microwave ovens), Industrial process control, Medical instrumentation, Automobiles, And so on… 13

Course Progress  Introduction Crisp / Classical Set Theory Fuzzy Set Theory Crisp Relations Fuzzy Relations Crisp Logic Fuzzy Logic Fuzzy Inference System (FIS) 14

15

Classical Set It is a well defined collection of objects (elements). “Well defined” means “the object either belongs to or does not belong to the set” That is why it’s called a “crisp” set. Examples: A = Set of positive integer numbers = {1, 2, 3, …} B = {Peacock, Swan, Dove} C = {x | (x > 0) and (x mod 5 = 0)} = {5, 10, 15, …} 16

Universe of Discourse It is a set which, with reference to a particular context, contains all possible elements having same characteristics and from which other sets can be formed. It’s usually called a “universal set”. Examples: The universal set of all students in a university. The universal set of all integer numbers. 17

Operations on Classical Sets Union Intersection Difference Complement 18

Union 19 The union of two sets A and B is the set of all elements that belong to A or B or both, without replication. Exercise 1: Draw a Venn diagram for A U B… Example If A = {1, 2, 3} and B = {3, 4, 5} Then, A U B = {1, 2, 3, 4, 5}

Intersection 20 The intersection of two sets A and B is a set of the elements which belong to both A and B. Exercise 2: Draw a Venn diagram for A ∩ B… Example If A = {1, 2, 3} and B = {3, 4, 5} Then, A ∩ B = {3} If A ∩ B = Ø, then A and B are called “disjoint sets”. For example, if A = {1, 2} and B = {4, 5}, they are disjoints sets.

Difference 21 The difference of sets A and B is a set A-B, which contains only those elements of A which are not in B. Exercise 3: Draw a Venn diagram of a set A – B… Example If A = {a, e, i, o, u} and B = {a, u} Then, A – B = {e, i, o}

Complement 22 The complement of set A is the set of all elements which are in the universal set E but not in A. Exercise 4: Draw a Venn diagram of a set A c … Example If a universal set E = {1, 2, 3, 4, 5} and A = {1, 3, 5} Then A c = {2, 4}

Course Progress  Introduction  Crisp / Classical Set Theory Fuzzy Set Theory Crisp Logic Fuzzy Logic Fuzzy Inference System (FIS) 23

24

Introduction to Fuzzy Sets In a crisp / classical set, an element from the universal set is either absent or present. There is no in-between situation such as “partially present”. But, in a fuzzy set, every element from the universe of discourse is present with a degree of membership in the range [0.0, 1.0]. The degree of membership is denoted by μ. If μ = 0.0, the element is said to be “absent”. If μ = 1.0, the element is said to be “completely present”. If 0.0 < μ < 1.0, the element is said to be “partially present”. The more the membership value, the more the element belongs to the fuzzy set. 25

Definition of a Fuzzy Set A fuzzy set, A, defined on a universe of discourse, Z, may be written as a collection of ordered pairs: where z is a particular element of Z and μ A (z) is its membership value. Note A crisp set can be considered as a special case of a fuzzy set, in which μ is either 0 or 1. 26

Definition of a Fuzzy Set (contd.) Example Let Z = {g 1, g 2, g 3, g 4, g 5 } be a fuzzy reference set of students (i.e., universe of discourse) It is understood that every element in a universe of discourse has membership value of 1). On the universe of discourse Z, set A is a fuzzy set of “smart” students, as: 27

Basic Fuzzy Set Operations The basic fuzzy set operations are: Union Intersection Complement Difference 28

Union of Fuzzy Sets 29 The union of two fuzzy sets A and B on a universe of discourse Z is a new fuzzy set C on Z with a membership function defined as:

Example Z: Universe of discourse Age of people A: Fuzzy set of young people in Z, as: A = {(10, 1), (20, 1), (30, 0.5), (40, 0), (50, 0), (60, 0)}, B: Fuzzy set of middle-aged people in Z, as: B = {(10, 0), (20, 0), (30, 0.5), (40, 1), (50, 0.5), (60, 0)} Then, C = A U B in Z is: C = {(10, 1), (20, 1), (30, 0.5), (40, 1), (50, 0.5), (60, 0)} 30

Intersection of Fuzzy Sets 31 The intersection of two fuzzy sets A and B on a universe of discourse Z is a new fuzzy set C on Z with a membership function defined as:

Example Z: Universe of discourse Age of people A: Fuzzy set of young people in Z, as: A = {(10, 1.0), (20, 1), (30, 0.5), (40, 0), (50, 0), (60, 0)}, B: Fuzzy set of middle-aged people in Z, as: B = {(10, 0), (20, 0), (30, 0.5), (40, 1), (50, 0.5), (60, 0)} Then, C = A ∩ B in Z is: C = {(10, 0), (20, 0), (30, 0.5), (40, 0), (50, 0), (60, 0)} = {(30, 0.5)} (A singleton fuzzy set!) 32

Complement of a Fuzzy Set The complement of a fuzzy set A, denoted by Ā or A c, on a universe of discourse Z is a set, of which membership function is μ Ā (z) = 1 - μ A (z) for all z belonging to Z. Example: Z: Universe of discourse Age of people A: Fuzzy set of young people in Z, as: A = {(10, 1), (20, 1), (30, 0.5), (40, 0), (50, 0), (60, 0)}, Then, Ā is the fuzzy set of not-young people in Z, as: Ā = {(10, 0), (20, 0), (30, 0.5), (40, 1), (50, 1), (60, 1)} 33

Difference of Fuzzy Sets The difference of two fuzzy sets A and B on a universe of discourse Z is a new fuzzy set C, defined as: C = A – B = A ∩ B c Example Let A = {(z1,0.2), (z2, 0.5), (z3, 0.6)} B = {(z1,0.1), (z2, 0.4), (z3, 0.5)} Then, B c = {(z1,0.9), (z2, 0.6), (z3, 0.5)}, and C = A – B = A ∩ B c = {(z1,0.2), (z2, 0.5), (z3, 0.5)} 34

Solution to Exercise 10 We have: A = {(z 1, 0.4), (z 2, 0.8), (z 3, 0.6)}, B = {(z 1, 0.2), (z 2, 0.6), (z 3, 0.9)} Then, A c = {(z 1, 0.6), (z 2, 0.2), (z 3, 0.4)} B c = {(z 1, 0.8), (z 2, 0.4), (z 3, 0.1)} A c ∩ B = {(z 1, 0.2), (z 2, 0.2), (z 3, 0.4)} A ∩ B c = {(z 1, 0.4), (z 2, 0.4), (z 3, 0.1)} Therefore, the disjunctive sum of A and B is C, as: C = (A c ∩ B) U (A ∩ B c ) = {(z 1, 0.4), (z 2, 0.4), (z 3, 0.4)} 35

Course Progress  Introduction  Crisp / Classical Set Theory  Fuzzy Set Theory Crisp Logic Fuzzy Logic Fuzzy Inference System (FIS) 36

37

Definitions 38

Connectives (contd.) Unary Connective It requires only one proposition (i.e., input). NOT is unary connective. Binary Connective It requires two propositions (i.e., inputs). AND, OR, IMPLIES, and EQUAL are binary operators. Conjunction Operation AND operation is also called a conjunction operation. Disjunction Operation OR operation is also called a disjunction operation.

Connectives They are operators that link propositions to represent complex phenomena in the real world.

Connectives (contd.) Antecedent and Consequent The proposition occurring before IMPLIES (=>)connective is called “antecedent”. The proposition occurring after IMPLIES (=>) connective is called “consequent”.

The Negation Operator The unary negation operator “¬” (NOT) transforms a proposition into its logical negation. E.g. If p = “I have brown hair.” then ¬p = “I do not have brown hair.” Truth table for NOT: 42

The Conjunction Operator The binary conjunction operator “  ” (AND) combines two propositions to form their logical conjunction. E.g. If p=“I will have salad for lunch.” and q=“I will have steak for dinner.”, then p  q=“I will have salad for lunch and I will have steak for dinner.” 43

Conjunction Truth Table Note that a conjunction p 1  p 2  …  p n of n propositions will have 2 n rows in its truth table. ¬ and  operations together are universal, i.e., sufficient to express any truth table! 44

The Disjunction Operator The binary disjunction operator “  ” (OR) combines two propositions to form their logical disjunction. p=“That car has a bad engine.” q=“That car has a bad carburetor.” p  q=“Either that car has a bad engine, or that car has a bad carburetor.” 45

Disjunction Truth Table Note that p  q means that p is true, or q is true, or both are true! So this operation is also called inclusive or, because it includes the possibility that both p and q are true. “¬” and “  ” together are also universal. 46

Disjunction Truth Table Note that p  q means that p is true, or q is true, or both are true! So this operation is also called inclusive or, because it includes the possibility that both p and q are true. “¬” and “  ” together are also universal. 47

The Implication Operator The implication p  q states that p implies q. It is FALSE only in the case that p is TRUE but q is FALSE. E.g., p=“I am elected.” q=“I will lower taxes.” p  q = “If I am elected, then I will lower taxes” (else it could go either way) 48

Implication Truth Table p  q is false only when p is true but q is not true. p  q does not imply that p causes q! p  q does not imply that p or q are ever true! E.g. “(1=0)  pigs can fly” is TRUE! 49

Tautology and Contradiction

Fuzzy Logic

Fuzzy Connectives

Example

Fuzzy IF‐THEN Rule

Fuzzy IF-THEN RULES

Exercise

Solution

FUZZY INFERENCE SYSTEM

INTRODUCTION TO FIS

Main Steps of FIS

FIS to Determine the Tip for a Waiter

Step 1: Fuzzify

Step 2: Apply Fuzzy Operator

Step 3:Apply Implication Operator

Step 4: Aggregate All Outputs

Step 5: Defuzzify

Centroid Example

THANKS