29
Fuzzy Logic Artificial Intelligence and Adaptive Systems

Fuzzy Logic - University of Western Australiateaching.csse.uwa.edu.au/units/CITS4404/seminars/seminars17/A1 Fuz.… · References Scientific American. (2017). What is ‘fuzzy logic’?

  • Upload
    lamnga

  • View
    216

  • Download
    0

Embed Size (px)

Citation preview

Fuzzy LogicArtificial Intelligence and Adaptive Systems

Overview

● Technique for representing and manipulating uncertain information

● Does not restrict the number of truth values to only two (0 or 1). Instead, they allow for a larger set W of truth degrees.

● 0 and 1 are extreme cases of truth0.8

tallness0.6 tallness0.4

tallness

Image retrieved from http://www.steadyhealth.com/articles/tallness-too-short-for-my-age

Comparison

Fuzzy Logic and Probabilistic Theory

Similarities Differences

Both attach numeric values between 0 and 1

● Probabilistic theory measures how likely the proposition is to be correct.

● Fuzzy logic measures the degree to which the proposition is correct.

Fuzzy Logic and Traditional Logic and Set Theory

Similarities Differences

Use of three logic operations: AND, OR and NOT

● Traditional set theory assigns either membership or non-membership in a class or group (0 or 1).

● In fuzzy logic, the operations return a degree of membership between 0 and 1

How It Works

Crisp inputs Fuzzifier

Inference

Rules

Defuzzifier

Fuzzy input set

Fuzzy output set

Crisp outputs

Linguistic Variables and Rule SetExample: Tipping Problem (How much to tip?)

Linguistic Variables

● Service: {poor, good, excellent} ● Food: {rancid, delicious}● Tip: {cheap, average, generous}

Rules

● IF service is poor OR food is rancid, THEN tip is cheap● IF service is good, THEN tip is average● IF service is excellent OR food is delicious, THEN tip

is generous

Membership Functions

Image credit: McNeill, F., & Thro, E. (1994)Image retrieved from http://cs.bilkent.edu.tr/~zeynep/files/short_fuzzy_logic_tutorial.pdf

Fuzzification

Crisp Input Fuzzy Input

Image retrieved from http://au.mathworks.com/help/fuzzy/fuzzy-inference-process.htmlImage credit: Siler, W., & Buckley, J. (2004)

Inference

OR

Image retrieved from http://www.cs.princeton.edu/courses/archive/fall07/cos436/HIDDEN/Knapp/fuzzy004.htmImage retrieved from http://au.mathworks.com/help/fuzzy/fuzzy-inference-process.html

AND

Inference

Image retrieved from http://au.mathworks.com/help/fuzzy/fuzzy-inference-process.html

Image retrieved from http://au.mathworks.com/help/fuzzy/fuzzy-inference-process.html

Inference

Defuzzification

● Is the process of producing a result in the Crisp Logic Domain

● Can be thought of as turning fuzzy sets membership functions into a real value or specific decision

(Common) Methods for Defuzzification

● Highest Membership Method (Simple, but loses information)

● Centre of Area (Useful, but computationally inefficient)

● Weighted Average Method (Useful, but requires symmetry)

HighestMembership

Method

Defuzzification

Image retrieved from http://au.mathworks.com/help/fuzzy/fuzzy-inference-process.html

1. Cheap

2. Average

3. Generous

HighestMembership

Method

Defuzzification

15%

50%

35%

Image retrieved from http://au.mathworks.com/help/fuzzy/fuzzy-inference-process.html

1. Cheap

2. Average

3. Generous

HighestMembership

Method

Defuzzification

Image retrieved from http://au.mathworks.com/help/fuzzy/fuzzy-inference-process.html

1. Cheap

2. Average

3. Generous

15%

50%

35%

Centre of Area

● Calculate the area• Under the scaled membership function• Within the range of the output variable (x)

● Find Centre of Area

● Widely used

● Computationally inefficient with complex membership functions

CentreOfArea

● Centroid Principle● Centre of Gravity

Defuzzification

Image retrieved from http://zone.ni.com/reference/en-XX/help/370401G-01/lvpid/defuzzification_methods/

Centre of Area

● Calculate the area• Under the scaled membership function• Within the range of the output variable (x)

● Find Centre of Area

● Widely used/Most prevalent

● Computationally inefficient with complex membership functions

Weighted Average Method

● Multiply each membership function weight by it’s corresponding membership value and sum these elements.

● Divide this sum by the sum of all maximum membership values to gain our result.

● Very simple, very effective.

● Computationally efficient, but requires membership function symmetry (usually).

WeightedAverageMethod

Defuzzification

Image retrieved from https://pdfs.semanticscholar.org/dee4/62415b2b940de9cb162e7b7b77264bebc1ed.pdf

WeightedAverageMethod

Defuzzification

Image retrieved from https://pdfs.semanticscholar.org/dee4/62415b2b940de9cb162e7b7b77264bebc1ed.pdf

Defuzzification

● Necessary to defuzzify results to obtain a usable output

● Techniques vary greatly depending on what is required (20+ methods)• Maxima methods -> Fuzzy reasoning systems• Distribution and Area methods -> Fuzzy Controllers

● The result of defuzzification is a usable specific decision or real value.

Advantages

● Easy to translate expert

knowledge into software○ Linguistic rules can be developed by

expert

○ Translated into fuzzy rules

● Smooths out behaviour of system○ This helps in learning systems where

predictability needs to be managed

Image credit: Mukaidono, M. (2001).

Advantages

● Suited for vagueness○ Measurements taken may contain error, noise, etc

○ Membership sets models can overlap at edges

○ Output accommodates for imprecision in inputs

● Easy to modify○ Rules are non-sequential

○ Easy to remove or modify rules compared to if-then-else nested block

○ Neural networks, evolutionary algorithms, etc can be used to modify

weightings on the fly

Disadvantages

● Computationally heavy○ Each input requires three computations

(Fuzzification, membership and IF-THEN inference, Defuzzification)

○ Must check each rule against each input at each computation cycle

● Risks combinatorial explosion!○ N inputs with S membership sets

requires S^N IF-THEN rules to cover every possible case

○ The system can be approximated to avoid this, but may yield unwanted values

Image retrieved from https://www.math.cornell.edu/~numb3rs/kostyuk/num218.htm

Disadvantages

● Not suited for precision○ Crisp values are lost in fuzzification process

○ Outputs are based on inference, not calculations

● May require expert knowledge to implement○ Setting ranges may require justification

○ Defuzzification methods depend on given problem

Image credit: Mukaidono, M. (2001).

Conclusion

Fuzzy Logic allows for a linguistic approach to programming.

While computationally heavy, it offers an intuitive and flexible approach to a variety of applications where precision is not a priority.

There are a multitude of fuzzification and defuzzification methods, and the “best” method must be judged on a case-by-case basis.

ReferencesScientific American. (2017). What is ‘fuzzy logic’? Are there computers that inherently fuzzy and do not apply the usual binary logic?. Retrieved from https://www.scientificamerican.com/article/what-is-fuzzy-logic-are-t/

Bilkent University. (2010). A Short Fuzzy Logic Tutorial. Retrieved from http://cs.bilkent.edu.tr/~zeynep/files/short_fuzzy_logic_tutorial.pdf

Jantzen, J. (2013). Fuzzy Reasoning (2nd ed.). Chichester, UK: John Wiley & Sons.

MathWorks. (2017). Fuzzy Inference Process. Retrieved from http://au.mathworks.com/help/fuzzy/fuzzy-inference-process.html

McNeill, F., & Thro, E. (1994). Fuzzy Logic : A Practical Approach. Cambridge, MA: Elsevier Science.

Mukaidono, M. (2001). Fuzzy Logic For Beginners. Singapore: World Scientific.

Pirovano, M. (2012). The use of Fuzzy Logic for Artificial Intelligence in Games. Milano, Italy: University of Milano.

Princeton University. (2007). Fuzzy Inference Systems. Retrieved from http://www.cs.princeton.edu/courses/archive/fall07/cos436/HIDDEN/Knapp/fuzzy004.htm

Ross, T. J. (2004). Fuzzy Logic with Engineering Applications (2nd ed.). West Sussex, England: John Wiley & Sons.

Siler, W., & Buckley, J. (2004). Fuzzy Expert Systems and Fuzzy Reasoning. Hoboken, NJ: John Wiley & Sons.

Questions?