Lotfi Zadeh (professor at UC Berkeley) wrote his original paper on fuzzy set theory. In various occasions, this is what he said

Similar documents
Chapter 7 Fuzzy Logic Controller

Fuzzy Reasoning. Outline

FUZZY LOGIC TECHNIQUES. on random processes. In such situations, fuzzy logic exhibits immense potential for

Chapter 4 Fuzzy Logic

FUZZY INFERENCE SYSTEMS

Why Fuzzy Fuzzy Logic and Sets Fuzzy Reasoning. DKS - Module 7. Why fuzzy thinking?

ARTIFICIAL INTELLIGENCE. Uncertainty: fuzzy systems

7. Decision Making

FUZZY INFERENCE. Siti Zaiton Mohd Hashim, PhD

Dinner for Two, Reprise

Introduction to Fuzzy Logic and Fuzzy Systems Adel Nadjaran Toosi

CHAPTER 5 FUZZY LOGIC CONTROL

Background Fuzzy control enables noncontrol-specialists. A fuzzy controller works with verbal rules rather than mathematical relationships.

Fuzzy Logic. Sourabh Kothari. Asst. Prof. Department of Electrical Engg. Presentation By

Lecture notes. Com Page 1

CHAPTER 4 FREQUENCY STABILIZATION USING FUZZY LOGIC CONTROLLER

Why Fuzzy? Definitions Bit of History Component of a fuzzy system Fuzzy Applications Fuzzy Sets Fuzzy Boundaries Fuzzy Representation

Introduction to Fuzzy Logic. IJCAI2018 Tutorial

Neural Networks Lesson 9 - Fuzzy Logic

CS 354R: Computer Game Technology

Introduction 3 Fuzzy Inference. Aleksandar Rakić Contents

Dra. Ma. del Pilar Gómez Gil Primavera 2014

Fuzzy Sets and Fuzzy Logic

Lecture 5 Fuzzy expert systems: Fuzzy inference Mamdani fuzzy inference Sugeno fuzzy inference Case study Summary

What is all the Fuzz about?

Fuzzy Reasoning. Linguistic Variables

CPS331 Lecture: Fuzzy Logic last revised October 11, Objectives: 1. To introduce fuzzy logic as a way of handling imprecise information

Fuzzy if-then rules fuzzy database modeling

MODELING FOR RESIDUAL STRESS, SURFACE ROUGHNESS AND TOOL WEAR USING AN ADAPTIVE NEURO FUZZY INFERENCE SYSTEM

Fuzzy Sets and Fuzzy Logic. KR Chowdhary, Professor, Department of Computer Science & Engineering, MBM Engineering College, JNV University, Jodhpur,

Advanced Inference in Fuzzy Systems by Rule Base Compression

Figure-12 Membership Grades of x o in the Sets A and B: μ A (x o ) =0.75 and μb(xo) =0.25

Introduction. Aleksandar Rakić Contents

CHAPTER 3 ADAPTIVE NEURO-FUZZY INFERENCE SYSTEM

ARTIFICIAL INTELLIGENCE - FUZZY LOGIC SYSTEMS

ANFIS: ADAPTIVE-NETWORK-BASED FUZZY INFERENCE SYSTEMS (J.S.R. Jang 1993,1995) bell x; a, b, c = 1 a

Unit V. Neural Fuzzy System

What is all the Fuzz about?

Fuzzy Systems (1/2) Francesco Masulli

Introduction 2 Fuzzy Sets & Fuzzy Rules. Aleksandar Rakić Contents

COSC 6397 Big Data Analytics. Fuzzy Clustering. Some slides based on a lecture by Prof. Shishir Shah. Edgar Gabriel Spring 2015.

* The terms used for grading are: - bad - good

Finite State Machines

Projecting Safety Measures in Fireworks Factories in Sivakasi using Fuzzy based Approach

Fuzzy rule-based decision making model for classification of aquaculture farms

Exploring Gaussian and Triangular Primary Membership Functions in Non-Stationary Fuzzy Sets

Using a fuzzy inference system for the map overlay problem

Fuzzy Set, Fuzzy Logic, and its Applications

ONLINE CONFERENCE. DESIGN.BUILD.DELIVE R with WINDOWS PHONE THURSDAY 24 MARCH 2011

CHAPTER 3 FUZZY INFERENCE SYSTEM

CHAPTER 3 FUZZY RULE BASED MODEL FOR FAULT DIAGNOSIS

Fuzzy Systems Handbook

CHAPTER 4 FUZZY LOGIC, K-MEANS, FUZZY C-MEANS AND BAYESIAN METHODS

Fuzzy Based Decision System for Gate Limiter of Hydro Power Plant

FUZZY SYSTEMS: Basics using MATLAB Fuzzy Toolbox. Heikki N. Koivo

Fuzzy Sets and Systems. Lecture 1 (Introduction) Bu- Ali Sina University Computer Engineering Dep. Spring 2010

fuzzylite a fuzzy logic control library in C++

Application of fuzzy set theory in image analysis. Nataša Sladoje Centre for Image Analysis

A Brief Idea on Fuzzy and Crisp Sets

Position Tracking Using Fuzzy Logic

Fuzzy Networks for Complex Systems. Alexander Gegov University of Portsmouth, UK

CHAPTER 6 SOLUTION TO NETWORK TRAFFIC PROBLEM IN MIGRATING PARALLEL CRAWLERS USING FUZZY LOGIC

Fuzzy Expert Systems Lecture 8 (Fuzzy Systems)

Fuzzy Logic Controller

Intuitionistic fuzzification functions

INTERNATIONAL JOURNAL OF COMPUTER ENGINEERING & TECHNOLOGY (IJCET)

Intelligent Control. 4^ Springer. A Hybrid Approach Based on Fuzzy Logic, Neural Networks and Genetic Algorithms. Nazmul Siddique.

Fuzzy If-Then Rules. Fuzzy If-Then Rules. Adnan Yazıcı

Fuzzy logic. 1. Introduction. 2. Fuzzy sets. Radosªaw Warzocha. Wrocªaw, February 4, Denition Set operations

FUZZY SYSTEM FOR PLC

A FUZZY LOGIC APPROACH IN ROBOTIC MOTION CONTROL

A New Fuzzy Neural System with Applications

Programming Game Al by Example

SOLUTION: 1. First define the temperature range, e.g. [0 0,40 0 ].

Data Fusion for Magnetic Sensor Based on Fuzzy Logic Theory

Assessment of Human Skills Using Trapezoidal Fuzzy Numbers

COSC 6339 Big Data Analytics. Fuzzy Clustering. Some slides based on a lecture by Prof. Shishir Shah. Edgar Gabriel Spring 2017.

Formal Methods of Software Design, Eric Hehner, segment 1 page 1 out of 5

Development of a Generic and Configurable Fuzzy Logic Systems Library for Real-Time Control Applications using an Object-oriented Approach

Fuzzy system theory originates from fuzzy sets, which were proposed by Professor L.A.

Machine Learning & Statistical Models

CHAPTER 3 ADAPTIVE DECISION BASED MEDIAN FILTER WITH FUZZY LOGIC

Implementation Of Fuzzy Controller For Image Edge Detection

CHAPTER 3 MAINTENANCE STRATEGY SELECTION USING AHP AND FAHP

Fuzzy Logic Approach towards Complex Solutions: A Review

Final Exam. Controller, F. Expert Sys.., Solving F. Ineq.} {Hopefield, SVM, Comptetive Learning,

A Triangular Fuzzy Model for Assessing Problem Solving Skills

Outlines. Fuzzy Membership Function Design Using Information Theory Measures and Genetic Algorithms. Outlines

A framework for fuzzy models of multiple-criteria evaluation

Application Of Fuzzy - Logic Controller In Gas Turbine Control On Transient Performance With Object Orientation Simulation

Decision Making: Fuzzy Logic

Speed regulation in fan rotation using fuzzy inference system

In the Name of God. Lecture 17: ANFIS Adaptive Network-Based Fuzzy Inference System

This lesson combines vertical translations and dilations in several quadratic and inverse variation modeling applications.

Types of Expert System: Comparative Study

Fuzzy logic controllers

Simple Linear Interpolation Explains All Usual Choices in Fuzzy Techniques: Membership Functions, t-norms, t-conorms, and Defuzzification

Fuzzy Classification of Facial Component Parameters

Similarity Measures of Pentagonal Fuzzy Numbers

A Fuzzy Intelligent System for End-of-Line Test

Transcription:

FUZZY LOGIC

Fuzzy Logic Lotfi Zadeh (professor at UC Berkeley) wrote his original paper on fuzzy set theory. In various occasions, this is what he said Fuzzy logic is a means of presenting problems to computers in a way akin to the way humans solve them The essence of fuzzy logic is that everything is a matter of degree What do these statements really mean?

Fuzzy Logic Very often, we humans analyze situations and solve problems in a rather imprecise manner Do not have all the facts Facts might be uncertain Maybe we only generalize facts without having the precise data or measurements Real-life example: Playing a game of basketball

Everything is a matter of degree? Is your basketball opponent tall, or average or short? (use of linguistic terms to measure degree) Is 7 feet tall? Is 6 feet 10 inches tall? Are they both considered tall? (overlapping degrees) Problem with traditional Boolean logic You are forced to define a point above which we will consider the guy to be tall or just average, e.g. > 7 ft Fuzzy Logic allows gray areas or degrees of being considered tall

The degree of truth So you can think of fuzzy logic as classifying something as being TRUE, but to varying degrees Real-life control applications (air-conditioning, household appliances): Traditional Boolean logic will result in abrupt switching of response functions Fuzzy logic alleviates this problem Responses will vary smoothly given the degree of truth or strength of the input conditions

Fuzzy logic for games A previous game AI example An AI character makes his decision to chase (using FSM or DT) based on traditional Boolean logic, e.g. distance of player < 20 units, and player health < 50% In fuzzy logic, we can represent these input conditions using a few membership degrees of measure Distance: ( Far, Average, Near ) Health: ( Good, Normal, Poor ) The output actions can also be represented with different membership degrees ( Chase Fast, Chase Slow )

How to use Fuzzy Logic in Games? 3 possible ways how fuzzy logic can be used in games Control Modulating steering forces, travelling/moving towards target Threat Assessment Assessing player s strengths/weaknesses for deploying units and making moves Classification Identifying the combat prowess of characters in the game based on a variety of factors in order to choose opponent There are many other possibilities

Fuzzy Logic Basics Fuzzy control or fuzzy inference process 3 basic steps

Step 1: Fuzzification Fuzzification: Process of mapping/converting crisp data (real numbers) to fuzzy data Find degree of membership of the crisp input in predefined fuzzy sets E.g. given a character s health, determine the degree to which it is Good, Fair or Poor. Mapping is achieved using membership functions

Membership Functions Membership Functions Map input variables to a degree of membership, in a fuzzy set, between 0 and 1. Degree 1 absolutely true, degree 0 absolutely false, any degree in between true or false to a certain extent Boolean logic membership function

Membership Functions Fuzzy Membership Functions Enables us to transition gradually from false to true Grade membership function

Membership Functions Triangular m/f Reverse grade m/f Equations are just the inverse of the grade m/f

Membership Functions Trapezoid m/f Other nonlinear m/f Gaussian or Sigmoid S -shaped curves

Membership Functions Typically, we are interested in the degree of which an input variable falls within a number of qualitative sets

Membership Functions Setting up collections of fuzzy sets for an input variable is a matter of judgment and trial-and-error not uncommon to tune the sets While tuning, one can try different membership functions, increase or decrease number of sets Some fuzzy practitioners recommend 7 fuzzy sets to fully define a practical working range (?!?!?)

Membership Functions One rule of thumb for ensuring smooth transitions (in later steps) is to enforce overlapping between neighboring sets

Hedge Functions Hedge functions are sometimes used to modify the degree of membership Provide additional linguistic constructs that you can use in conjunction with other logical operations. Two common hedges: VERY(Truth(A)) = Truth(A) 2 NOT_VERY(Truth(A)) = Truth(A) 0.5 (Truth(A) is the degree of membership of A in some fuzzy set)

Step 2: Fuzzy Rules Next, construct a set of rules, combining the input in some logical manner, to yield some output If-then style rules (if A then B) A being the antecedent/premise and B being the consequent/conclusion Fuzzy input variables are combined logically to form premise Conclusion will be the degree of membership of some output fuzzy set

Fuzzy Axioms Since we are writing logical rules with fuzzy input, we need a way to apply logical operators to fuzzy input (just like with Boolean input) Logical OR (disjunction) Truth(A OR B) = MAX(Truth(A), Truth(B)) Logical AND (conjunction) Truth(A AND B) = MIN(Truth(A), Truth(B)) Logical NOT (negation) Truth(NOT A) = 1 Truth(A)

Fuzzy Axioms Example, given a person is overweight to the degree of 0.7 and tall to the degree of 0.3: Overweight AND tall = MIN(0.7, 0.3) = 0.3 Overweight OR tall = MAX(0.7, 0.3) = 0.7 NOT overweight = 1 0.7 = 0.3 NOT tall = 1 0.3 = 0.7 NOT(overweight AND tall) = 1 MIN(0.7, 0.3) = 0.7 There are other definitions for these logical operators

Rule Evaluation Unlike traditional Boolean logic, Rules in fuzzy logic can evaluate into any number between 0 and 1 (not just 0 or 1) All rules are evaluated in parallel (not in series that the first one that is true gets fired). Each rule always fires, to various degrees The strength of each rule represents the degree of membership in the output fuzzy set

Rule Evaluation Example: Evaluating whether an AI should attack player Rules can be written like: If (in melee range AND uninjured) AND NOT hard then attack Set up as many rules to handle all possibilities in the game

Rule Evaluation Given specific degrees for the input variables, you might get outputs (conclusions of the rules) that look something like this: Attack to degree: 0.2 Do nothing to degree: 0.4 Flee to degree: 0.7 The most straightforward way to interpret these outputs is to take the action associated with the highest degree (in this case, the action will be flee)

Step 3: Defuzzification In some cases, you might want to use the fuzzy output degree to determine a crisp value (real number), which can be useful for further calculations Defuzzification: Process of converting the results from the fuzzy rules to get a crisp number as an output Opposite of fuzzification (you can say that, although the purpose and methods are different!)

Step 3: Defuzzification Previous example: Instead of determining some finite action (do nothing, flee, attack), we also want to use the output to determine the speed to take the action To get a crisp number, aggregate the output strengths on the predefined output membership functions

Step 3: Defuzzification With the numerical output from the earlier example (0.2 degree attack, 0.4 degree do nothing, 0.7 degree flee), we have the composite membership function below

Defuzzifying composite m/f Truncate each output set to the output degree of membership for that set. Then combine all output sets by disjunction A crisp number can be arrived from such an output fuzzy set in many ways Geometric centroid of the area under the output fuzzy set, taking its horizontal axis coordinate as the crisp output

Using predefuzzified output A less computationally expensive method is the use of singleton output membership function or a predefuzzified output function Instead of doing lots of calculation, assign speeds to each output action (-10 for flee, 1 for do nothing, 10 for attack). E.g. The resulting speed for flee is simply the preset value of -10 times the degree to which the output action flee is true (-10 x 0.7 = -7)

Using predefuzzified output Aggregate of all outputs with a simple weighted average In our example, we might have: Output = [(0.7)(-10) + (0.4)(1) + (0.3)(10)] / = -2.5 (0.7+0.4+0.3) This output would result in the creature fleeing, but not earnestly in full extent Naturally, we can obtain various output (crisp) values depending on the different input conditions

Further Examples There are 2 good examples in the textbook, showing the full process of using fuzzy logic to model game AI characters

Using Fuzzy Logic in FSMs? If we want to add some fuzzy logic into FSMs, how can that be accomplish? Is it possible? Remember: Each state defines a behavior or action, and each state is reached by transition from another state on the basis of fulfilling some input conditions Conditions for transition are normally in Boolean logic, how do we accommodate fuzzy logic?

Fuzzy State Machines Different AI developers regard Fuzzy State Machines differently State machine with fuzzy states State transitions that use fuzzy logic to trigger Both Find out more about how these different variations can be worked out and implemented (refer to Millington book)