This time: Fuzzy Logic and Fuzzy Inference

Similar documents
This time: Fuzzy Logic and Fuzzy Inference

What Is Fuzzy Logic?

Handling Uncertainty using FUZZY LOGIC

ME 534. Mechanical Engineering University of Gaziantep. Dr. A. Tolga Bozdana Assistant Professor

Lecture 06. (Fuzzy Inference System)

2010/07/12. Content. Fuzzy? Oxford Dictionary: blurred, indistinct, confused, imprecisely defined

Revision: Fuzzy logic

Uncertain System Control: An Engineering Approach

Outline. Introduction, or what is fuzzy thinking? Fuzzy sets Linguistic variables and hedges Operations of fuzzy sets Fuzzy rules Summary.

EEE 8005 Student Directed Learning (SDL) Industrial Automation Fuzzy Logic

CS 354R: Computer Game Technology

Fuzzy Logic. An introduction. Universitat Politécnica de Catalunya. Departament de Teoria del Senyal i Comunicacions.

Fuzzy Sets. Fuzzy Sets and Fuzzy Logic. Fuzzy Properties. Fuzzy Measures: Example. Properties are represented by fuzzy sets. Properties might be like:

Hamidreza Rashidy Kanan. Electrical Engineering Department, Bu-Ali Sina University

OUTLINE. Introduction History and basic concepts. Fuzzy sets and fuzzy logic. Fuzzy clustering. Fuzzy inference. Fuzzy systems. Application examples

Islamic University of Gaza Electrical Engineering Department EELE 6306 Fuzzy Logic Control System Med term Exam October 30, 2011

is implemented by a fuzzy relation R i and is defined as

Fuzzy Expert Systems Lecture 3 (Fuzzy Logic)

Fuzzy Expert Systems Lecture 3 (Fuzzy Logic)

Lecture 1: Introduction & Fuzzy Control I

Fuzzy Logic and Computing with Words. Ning Xiong. School of Innovation, Design, and Engineering Mälardalen University. Motivations

A Powerful way to analyze and control a complex system

Models for Inexact Reasoning. Fuzzy Logic Lesson 8 Fuzzy Controllers. Master in Computational Logic Department of Artificial Intelligence

Financial Informatics XI: Fuzzy Rule-based Systems

Fundamentals. 2.1 Fuzzy logic theory

Applied Logic. Lecture 3 part 1 - Fuzzy logic. Marcin Szczuka. Institute of Informatics, The University of Warsaw

Today s s lecture. Lecture 16: Uncertainty - 6. Dempster-Shafer Theory. Alternative Models of Dealing with Uncertainty Information/Evidence

Fuzzy Control Systems Process of Fuzzy Control

Fuzzy expert systems

4. Lecture Fuzzy Systems

MODELLING THERMAL COMFORT FOR TROPICS USING FUZZY LOGIC

CHAPTER V TYPE 2 FUZZY LOGIC CONTROLLERS

Chapter 11 Fuzzy Logic Control

A Hybrid Approach For Air Conditioning Control System With Fuzzy Logic Controller

Fuzzy control systems. Miklós Gerzson

So, we can say that fuzzy proposition is a statement p which acquires a fuzzy truth value T(p) ranges from(0 to1).

Application of Fuzzy Logic and Uncertainties Measurement in Environmental Information Systems

Handling uncertainty with fuzzy systems

The Problem. Sustainability is an abstract concept that cannot be directly measured.

2018 Predictive Analytics Symposium Session 18: Can You Hear Me Now: Getting Clarity with Fuzzy Logic

Institute for Advanced Management Systems Research Department of Information Technologies Åbo Akademi University. Fuzzy Logic Controllers - Tutorial

Fuzzy Controller. Fuzzy Inference System. Basic Components of Fuzzy Inference System. Rule based system: Contains a set of fuzzy rules

Fuzzy Systems. Introduction

CS344: Introduction to Artificial Intelligence (associated lab: CS386)

FUZZY CONTROL OF CHAOS

FUZZY CONTROL OF CHAOS

What is Fuzzy Logic? Fuzzy logic is a tool for embedding human knowledge (experience, expertise, heuristics) Fuzzy Logic

Intelligent Systems and Control Prof. Laxmidhar Behera Indian Institute of Technology, Kanpur

What is fuzzy? A dictionary definition. And so what is a Fuzzy Set? events. a not clear Set? 1. Of or resembling fuzz.

Computational Intelligence Lecture 13:Fuzzy Logic

Fuzzy Rules and Fuzzy Reasoning (chapter 3)

Fuzzy Systems. Introduction

Fuzzy logic : principles and applications

Classical Set Theory. Outline. Classical Set Theory. 4. Linguistic model, approximate reasoning. 1. Fuzzy sets and set-theoretic operations.

Fuzzy Logic Notes. Course: Khurshid Ahmad 2010 Typset: Cathal Ormond

Chapter 13 Uncertainty

Phil Introductory Formal Logic

Neural Networks & Fuzzy Logic. Introduction

RamchandraBhosale, Bindu R (Electrical Department, Fr.CRIT,Navi Mumbai,India)

Fuzzy Logic. By Clifton F. Cobb

Reasoning in Uncertain Situations

Symbolic Logic Outline

Seminar Introduction to Fuzzy Logic I

Financial Informatics IX: Fuzzy Sets

Neural Networks & Fuzzy Logic

- 1.2 Implication P. Danziger. Implication

Fuzzy and Rough Sets Part I

EFFECT OF VARYING CONTROLLER PARAMETERS ON THE PERFORMANCE OF A FUZZY LOGIC CONTROL SYSTEM

APPLICATION OF AIR HEATER AND COOLER USING FUZZY LOGIC CONTROL SYSTEM

Interval Type-2 Fuzzy Logic Systems Made Simple by Using Type-1 Mathematics

Motivation. From Propositions To Fuzzy Logic and Rules. Propositional Logic What is a proposition anyway? Outline

Introduction to fuzzy sets

Failure Mode Screening Using Fuzzy Set Theory

Fuzzy Expert Systems Lecture 6 (Fuzzy Logic )

3. DIFFERENT MODEL TYPES

Rule-Based Fuzzy Model

CHAPTER 5 FUZZY LOGIC FOR ATTITUDE CONTROL

ABSTRACT I. INTRODUCTION II. FUZZY MODEL SRUCTURE

Review: Potential stumbling blocks

A Study on the Fuzzy Modeling of Nonlinear Systems Using Kernel Machines

Linguistic Hedges: a Quantier Based Approach

Fuzzy Logic. Chapter Introduction. 2.2 Industrial Applications

1. Brief History of Intelligent Control Systems Design Technology

Instructor: Shihua Li School of Automation Southeast university

Fuzzy Logic Controller Based on Association Rules

Algorithms for Increasing of the Effectiveness of the Making Decisions by Intelligent Fuzzy Systems

An Integrated Approach for Process Control Valves Diagnosis Using Fuzzy Logic

Wind Turbine Power Generation: Response Prediction

DESIGN OF A FUZZY EXPERT SYSTEM FOR MAGNETIC FILTER PERFORMANCE ACCORDING TO MAGNETIC FIELD

Adaptive Non-singleton Type-2 Fuzzy Logic Systems: A Way Forward for Handling Numerical Uncertainties in Real World Applications

Prediction of Ultimate Shear Capacity of Reinforced Normal and High Strength Concrete Beams Without Stirrups Using Fuzzy Logic

Fuzzy Sets and Fuzzy Logic

Probabilistic clustering

SOFT COMPUTING (PECS 3401)-FUZZY LOGIC

Analysis of Defuzzification Method for Rainfall Event

OPTIMAL CAPACITOR PLACEMENT USING FUZZY LOGIC

9. Fuzzy Control Systems

Predictions of Indoor Thermal Comfort Level using Fuzzy Logic

Section 1.2: Conditional Statements

Reasoning Systems Chapter 4. Dr Ahmed Rafea

Transcription:

This time: Fuzzy Logic and Fuzzy Inference Why use fuzzy logic? Tipping example Fuzzy set theory Fuzzy inference CS 460, Sessions 22-23 1

What is fuzzy logic? A super set of Boolean logic Builds upon fuzzy set theory Graded truth. Truth values between True and False. Not everything is either/or, true/false, black/white, on/off etc. Grades of membership. Class of tall men, class of far cities, class of expensive things, etc. Lotfi Zadeh, UC/Berkely 1965. Introduced FL to model uncertainty in natural language. Tall, far, nice, large, hot, Reasoning using linguistic terms. Natural to express expert knowledge. If the weather is cold then wear warm clothing CS 460, Sessions 22-23 2

Why use fuzzy logic? Pros: Conceptually easy to understand w/ natural maths Tolerant of imprecise data Universal approximation: can model arbitrary nonlinear functions Intuitive Based on linguistic terms Convenient way to express expert and common sense knowledge Cons: Not a cure-all Crisp/precise models can be more efficient and even convenient Other approaches might be formally verified to work CS 460, Sessions 22-23 3

Tipping example The Basic Tipping Problem: Given a number between 0 and 10 that represents the quality of service at a restaurant what should the tip be? Cultural footnote: An average tip for a meal in the U.S. is 15%, which may vary depending on the quality of the service provided. CS 460, Sessions 22-23 4

Tipping example: The non-fuzzy approach Tip = 15% of total bill What about quality of service? CS 460, Sessions 22-23 5

Tipping example: The non-fuzzy approach Tip = linearly proportional to service from 5% to 25% tip = 0.20/10*service+0.05 What about quality of the food? CS 460, Sessions 22-23 6

Tipping example: Extended The Extended Tipping Problem: Given a number between 0 and 10 that represents the quality of service and the quality of the food, at a restaurant, what should the tip be? How will this affect our tipping formula? CS 460, Sessions 22-23 7

Tipping example: The non-fuzzy approach Tip = 0.20/20*(service+food)+0.05 We want service to be more important than food quality. E.g., 80% for service and 20% for food. CS 460, Sessions 22-23 8

Tipping example: The non-fuzzy approach Tip = servratio*(.2/10*(service)+.05) + servratio = 80% (1-servRatio)*(.2/10*(food)+0.05); Seems too linear. Want 15% tip in general and deviation only for exceptionally good or bad service. CS 460, Sessions 22-23 9

Tipping example: The non-fuzzy approach if service < 3, tip(f+1,s+1) = servratio*(.1/3*(s)+.05) +... (1-servRatio)*(.2/10*(f)+0.05); elseif s < 7, tip(f+1,s+1) = servratio*(.15) +... (1-servRatio)*(.2/10*(f)+0.05); else, tip(f+1,s+1) = servratio*(.1/3*(s-7)+.15) +... (1-servRatio)*(.2/10*(f)+0.05); end; CS 460, Sessions 22-23 10

Tipping example: The non-fuzzy approach Nice plot but Complicated function Not easy to modify Not intuitive Many hard-coded parameters Not easy to understand CS 460, Sessions 22-23 11

Tipping problem: the fuzzy approach What we want to express is: 1. If service is poor then tip is cheap 2. If service is good the tip is average 3. If service is excellent then tip is generous 4. If food is rancid then tip is cheap 5. If food is delicious then tip is generous or 1. If service is poor or the food is rancid then tip is cheap 2. If service is good then tip is average 3. If service is excellent or food is delicious then tip is generous We have just defined the rules for a fuzzy logic system. CS 460, Sessions 22-23 12

Tipping problem: fuzzy solution Decision function generated using the 3 rules. CS 460, Sessions 22-23 13

Tipping problem: fuzzy solution Before we have a fuzzy solution we need to find out a) how to define terms such as poor, delicious, cheap, generous etc. b) how to combine terms using AND, OR and other connectives c) how to combine all the rules into one final output CS 460, Sessions 22-23 14

Fuzzy sets Boolean/Crisp set A is a mapping for the elements of S to the set {0, 1}, i.e., A: S {0, 1} Characteristic function: µ A (x) = { 1 if x is an element of set A 0 if x is not an element of set A Fuzzy set F is a mapping for the elements of S to the interval [0, 1], i.e., F: S [0, 1] Characteristic function: 0 µ F (x) 1 1 means full membership, 0 means no membership and anything in between, e.g., 0.5 is called graded membership CS 460, Sessions 22-23 15

Example: Crisp set Tall Fuzzy sets and concepts are commonly used in natural language John is tall Dan is smart Alex is happy The class is hot E.g., the crisp set Tall can be defined as {x height x > 1.8 meters} But what about a person with a height = 1.79 meters? What about 1.78 meters? What about 1.52 meters? CS 460, Sessions 22-23 16

Example: Fuzzy set Tall In a fuzzy set a person with a height of 1.8 meters would be considered tall to a high degree A person with a height of 1.7 meters would be considered tall to a lesser degree etc. The function can change for basketball players, Danes, women, children etc. CS 460, Sessions 22-23 17

Membership functions: S-function The S-function can be used to define fuzzy sets S(x, a, b, c) = 0 for x a 2(x-a/c-a) 2 for a x b 1 2(x-c/c-a) 2 for b x c 1 for x c a b c CS 460, Sessions 22-23 18

Membership functions: Π Function Π(x, a, b) = S(x, b-a, b-a/2, b) for x b 1 S(x, b, b+a/2, a+b) for x b E.g., close (to a) a b-a b-a/2 a b+a/2 b+a CS 460, Sessions 22-23 19

Simple membership functions Piecewise linear: triangular etc. Easier to represent and calculate saves computation CS 460, Sessions 22-23 20

Fuzzy Sets 1 Membership Grade µ Cold Mild Warm 0 30 60 F CS 460, Sessions 22-23 21

Observation 0.85 1 µ Cold An observed temperature of 38 is cold with a belief of 0.14, Mild with a belief of 0.85 and warm with a belief of 0 Mild Warm 0.14 0 30 60 38 F CS 460, Sessions 22-23 22

Other representations of fuzzy sets A finite set of elements: F = µ 1 /x 1 + µ 2 /x 2 + µ n /x n + means (Boolean) set union For example: TALL = {0/1.0, 0/1.2, 0/1.4, 0.2/1.6, 0.8/1.7, 1.0/1.8} CS 460, Sessions 22-23 23

Fuzzy set operators Equality A = B µ A (x) = µ B (x) for all x X Complement A µ A (x) = 1 - µ A (x) for all x X Containment A B µ A (x) µ B (x) for all x X Union A B µ A B (x) = max(µ A (x), µ B (x)) for all x X Intersection A B µ A B (x) = min(µ A (x), µ B (x)) for all x X CS 460, Sessions 22-23 24

Example fuzzy set operations A A A B A B A B CS 460, Sessions 22-23 25

Linguistic Hedges Modifying the meaning of a fuzzy set using hedges such as very, more or less, slightly, etc. Very F = F 2 tall More or less F = F 1/2 etc. More or less tall Very tall CS 460, Sessions 22-23 26

Fuzzy relations A fuzzy relation for N sets is defined as an extension of the crisp relation to include the membership grade. R = {µ R (x 1, x 2, x N )/(x 1, x 2, x N ) x i X, i=1, N} which associates the membership grade, µ R, of each tuple. E.g. Friend = {0.9/(Manos, Nacho), 0.1/(Manos, Dan), 0.8/(Alex, Mike), 0.3/(Alex, John)} CS 460, Sessions 22-23 27

Fuzzy inference Fuzzy logical operations Fuzzy rules Fuzzification Implication Aggregation Defuzzification CS 460, Sessions 22-23 28

Fuzzy logical operations AND, OR, NOT, etc. NOT A = A = 1 - µ A (x) A AND B = A B = min(µ A (x), µ B (x)) A OR B = A B = max(µ A (x), µ B (x)) From the following truth tables it is seen that fuzzy logic is a superset of Boolean logic. min(a,b) max(a,b) 1-A A B A and B A B A or B A not A 0 0 0 0 1 0 1 0 0 1 1 1 0 0 0 0 1 1 1 0 1 1 1 1 0 1 1 0 CS 460, Sessions 22-23 29

If-Then Rules Use fuzzy sets and fuzzy operators as the subjects and verbs of fuzzy logic to form rules. if x is A then y is B where A and B are linguistic terms defined by fuzzy sets on the sets X and Y respectively. This reads if x == A then y = B CS 460, Sessions 22-23 30

Evaluation of fuzzy rules In Boolean logic: p q if p is true then q is true In fuzzy logic: p q if p is true to some degree then q is true to some degree. 0.5p => 0.5q (partial premise implies partially) How? CS 460, Sessions 22-23 31

Fuzzy Rules Example: If our distance to the car in front is small, and the distance is decreasing slowly, then decelerate quite hard Fuzzy variables in blue Fuzzy sets in red QUESTION: Given the distance and the change in the distance, what acceleration should we select? CS 460, Sessions 22-23 32

Fuzzification: Set Definitions v. small small perfect big v. big brake slow present fast fastest distance acceleration << < = > >> Delta (distance change) CS 460, Sessions 22-23 33

Fuzzification: Instance observation v. small small perfect big v. big brake slow present fast fastest distance???? acceleration << < = > >> delta Distance could be considered small or perfect Delta could be stable or growing What acceleration? observation CS 460, Sessions 22-23 34

Fuzzification: Instance o.55 v. small small perfect big v. big distance IF distance is Small THEN Slow Down CS 460, Sessions 22-23 35

Rule Evaluation o.55 small brake slow presentfast fastest distance acceleration Distance is small, then you slow down. Question: What is the weight to slow down? CS 460, Sessions 22-23 36

Rule Evaluation small slow o.55 distance acceleration Clipping approach (others are possible): Clip the fuzzy set for slow (the consequent) at the height given by our belief in the premises (0.55) We will then consider the clipped AREA (orange) when making our final decision Rationale: if belief in premises is low, clipped area will be very small But if belief is high it will be close to the whole unclipped area CS 460, Sessions 22-23 37

Fuzzification: Instance << < = > >> 0.75 delta IF change in distance is = THEN Keep the speed CS 460, Sessions 22-23 38

Rule Evaluation = 0.75 brake slow presentfast fastest delta acceleration Distance is not growing, then keep present acceleration CS 460, Sessions 22-23 39

Rule Evaluation = 0.75 present delta acceleration Distance is not growing, then keep present acceleration CS 460, Sessions 22-23 40

Rule Aggregation How do we make a final decision? From each rule we have Obtained a clipped area. But in the end we want a single Number output: our desired acceleration slow present From distance From delta (distance change) acceleration CS 460, Sessions 22-23 41

Rule Aggregation slow present acceleration In the rule aggregation step, we merge all clipped areas into One (taking the union). Intuition: rules for which we had a strong belief that their premises were satisfied Will tend to pull that merged area towards their own central value, since their Clipped areas will be large CS 460, Sessions 22-23 42

Defuzzification slow present -2.3m/s^2 acceleration In the last step, defuzzification, we return as our acceleration Value the x coordinate of the center of mass of the merged area CS 460, Sessions 22-23 43

Rule Aggregation: Another case Convert our belief into action For each rule, clip action fuzzy set by belief in rule present slow acceleration fast acceleration acceleration CS 460, Sessions 22-23 44

Rule Aggregation: Another case Convert our belief into action For each rule, clip action fuzzy set by belief in rule slow present fast acceleration CS 460, Sessions 22-23 45

Matching for Example Relevant rules are: If distance is small and delta is growing, maintain speed If distance is small and delta is stable, slow down If distance is perfect and delta is growing, speed up If distance is perfect and delta is stable, maintain speed CS 460, Sessions 22-23 46

Matching for Example For first rule, distance is small has 0.75 truth, and delta is growing has 0.3 truth So the truth of the and is 0.3 Other rule strengths are 0.6, 0.1 and 0.1 CS 460, Sessions 22-23 47

AND/OR Example IF Distance Small AND change in distance negative THEN high deceleration o.55 v. small small perfect big v. big distance 0.0 << < = > >> delta CS 460, Sessions 22-23 48

AND/OR Example IF Distance Small AND change in distance = THEN slow deceleration o.55 v. small small perfect big v. big 0.75 << distance < = > >> 0.55 delta CS 460, Sessions 22-23 49

AND/OR Example IF Distance Small AND change in distance = THEN slow deceleration small brake slow presentfast fastest o.55 distance acceleration CS 460, Sessions 22-23 50

Scaling vs. Clipping Instead of clipping, another approach is to scale the fuzzy set By the belief in the premises present slow Clipping: present acceleration slow acceleration Scaling: CS 460, Sessions 22-23 51 acceleration acceleration

Summary: If-Then rules 1. Fuzzify inputs: Determine the degree of membership for all terms in the premise. If there is one term then this is the degree of support for the consequence. 2. Apply fuzzy operator: If there are multiple parts, apply logical operators to determine the degree of support for the rule. CS 460, Sessions 22-23 52

Summary: If-Then rules 3. Apply implication method: Use degree of support for rule to shape output fuzzy set of the consequence. How do we then combine several rules? CS 460, Sessions 22-23 53

Multiple rules We aggregate the outputs into a single fuzzy set which combines their decisions. The input to aggregation is the list of truncated fuzzy sets and the output is a single fuzzy set for each variable. Aggregation rules: max, sum, etc. As long as it is commutative then the order of rule exec is irrelevant. CS 460, Sessions 22-23 54

Defuzzify the output Take a fuzzy set and produce a single crisp number that represents the set. Practical when making a decision, taking an action etc. Center of gravity CS 460, Sessions 22-23 55

Fuzzy inference overview Tip = 16.7 % Result of defuzzification CS 460, (centroid) Sessions 22-23 56

Limitations of fuzzy logic How to determine the membership functions? Usually requires finetuning of parameters Defuzzification can produce undesired results CS 460, Sessions 22-23 57

Fuzzy tools and shells Matlab s Fuzzy Toolbox FuzzyClips Etc. CS 460, Sessions 22-23 58