Top Banner
1 Chapter 18 Fuzzy Reasoning
30

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.

Dec 21, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 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.

1

Chapter 18

Fuzzy Reasoning

Page 2: 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.

2

Chapter 18 Contents (1)

Bivalent and Multivalent Logics Linguistic Variables Fuzzy Sets Membership Functions Fuzzy Set Operators Hedges

Page 3: 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.

3

Chapter 18 Contents (2)

Fuzzy Logic Fuzzy Rules Fuzzy Inference Fuzzy Expert Systems Neuro-Fuzzy Systems

Page 4: 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.

4

Bivalent and Multivalent Logics

Bivalent (Aristotelian) logic uses two logical values – true and false.

Multivalent logics use many logical values – often in a range of real numbers from 0 to 1.

Important to note the difference between multivalent logic and probability – P(A) = 0.5 means that A may be true or may be false – a logical value of 0.5 means both true and false at the same time.

Page 5: 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.

5

Linguistic Variables

Variables used in fuzzy systems to express qualities such as height, which can take values such as “tall”, “short” or “very tall”.

These values define subsets of the universe of discourse.

Page 6: 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.

6

Fuzzy Sets

A crisp set is a set for which each value either is or is not contained in the set.

For a fuzzy set, every value has a membership value, and so is a member to some extent.

The membership value defines the extent to which a variable is a member of a fuzzy set.

The membership value is from 0 (not at all a member of the set) to 1.

Page 7: 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.

7

Membership function for the Fuzzy Set of Tall People

1

8 ft

Page 8: 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.

8

Membership Functions

The following function defines the extent to which a value x is a member of fuzzy set B:

This function would be stored in the computer as:B = {(0, 1), (2, 0)}

This function could represent, for example, the extent to which a person can be considered a baby, based on their age.

Page 9: 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.

9

Fuzzy Set Membership Functions If we use Mb(x) and Mc(x) to represent

the membership functions for baby and child respectively, we can write :

1 – x/2 for x <= 2 Mb(x) = 0 for x >2 (x-1)/6 for x <= 7 Mc(x) = 1 for x > 7 and x <= 8 (14 – x)/6 for x >8

Page 10: 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.

10

How to represent a fuzzy set in computers?

We use a list of pairs and each pair represent a value and the fuzzy membership value for that value.

For example:

A = { (x1, MA(x1),…, (xn, MA(xn)} The fuzzy set of babies then can be: B = {(0,1), (2, 0)}

Page 11: 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.

11

Crisp Set Operators

Not A – the complement of A, which contains the elements which are not contained in A.

A B – the intersection of A and B, which contains those elements which are contained in both A and B.

A B – the union of A and B which contains all the elements of A and all the elements of B.

Fuzzy sets use the same operators, but the operators have different meanings.

Page 12: 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.

12

Fuzzy Set Operators

Fuzzy set operators can be defined by their membership functions M¬A(x) = 1 - MA(x) MA B (x) = MIN (MA (x), MB (x)) MA B (x) = MAX (MA (x), MB (x))

We can also define containment (subset operator): B A iff x (MB (x) MA (x))

Page 13: 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.

13

Hedges

A hedge is a qualifier such as “very”, “quite”, “somewhat” or “extremely”.

When a hedge is applied to a fuzzy set it creates a new fuzzy set.

Mathematic functions are usually used to define the effect of a hedge.

For example, “Very” might be defined as: MVA (x) = (MA (x))2

Page 14: 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.

14

Fuzzy Logic

It is a form of logic that applies to fuzzy variables.

It is non-monotonic, meaning: If a new fuzzy fact is added to a

database, this fact may contradict conclusions that previously derived from the database.

Page 15: 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.

15

Fuzzy Logic

Each fuzzy variable can take a value from 0 (not at all true) to 1 (entirely true)

The values can be any real value between 0 and 1.

Page 16: 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.

16

Fuzzy Logic

A non-monotonic logical system that applies to fuzzy variables.

We use connectives defined as: A V B MAX (A, B) A Λ B MIN (A, B) ¬A 1 – A

We can also define truth tables:

Page 17: 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.

17

Fuzzy Inference

Inference is harder to manage. Since:

A B ¬A V B Hence, we might define fuzzy

inference as:A B MAX ((1 – A), B)

This gives the unintuitive truth table shown on the right.

This gives us 0.5 0 = 0.5, where we would expect 0.5 0 = 0

Page 18: 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.

18

Fuzzy Inference

An alternative is Gödel implication, which is defined as:

A B (A ≤ B) V B This gives a more intuitive

truth table.

Page 19: 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.

19

i.e. for some d M, R∈ (a, d) → A(d) = 0. It follows R(a, d) > 0 and A(d)

= 0 (Godel implication!). Then R(a, d) ¬A∧ (d) = R(a, d)∧1 = R(a, d) >

0, thus (R(a, d) ¬A∧ (d) = 0 and (¬ R.¬C∃ )(a) = 0, thus our concept

has value 0, a contradiction.

Page 20: 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.

20

Fuzzy Rules

Fuzzy rule has the form of:

If A = x then B =y or more general,

If A op x then B = y Here, op is some mathematical

operator, such as =, >, < , …,

Page 21: 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.

21

Page 22: 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.

22

Fuzzy Inference (3)

Mamdani inference derives a single crisp value by applying fuzzy rules to a set of crisp input values.

Step 1: Fuzzify the inputs.

Step 2: Apply the inputs to the antecedents of the fuzzy rules to obtain a set of fuzzy outputs.

Step 3: Convert the fuzzy outputs to a single crisp value using defuzzification.

Page 23: 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.

23

Fuzzy Rules

A fuzzy rule takes the following form:

IF A op x then B = y op is an operator such as >, < or =. For example:

IF temperature > 50 then fan speed = fast

IF height = tall then trouser length = long

IF study time = short then grades = poor

Page 24: 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.

24

Fuzzy Expert Systems

A fuzzy expert system is built by creating a set of fuzzy rules, and applying fuzzy inference.

In many ways this is more appropriate than standard expert systems since expert knowledge is not usually black and white but has elements of grey.

The first stage in building a fuzzy expert system is choosing suitable linguistic variables.

Rules are then generated based on the expert’s knowledge, using the linguistic variables.

Page 25: 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.

25

Neuro-Fuzzy Systems

A fuzzy neural network is usually a feed-forward network with five layers:

1. Input layer – receives crisp inputs

2. Fuzzy input membership functions

3. Fuzzy rules

4. Fuzzy output membership functions

5. Output layer – outputs crisp values

Page 26: 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.

26

Applications of Fuzzy Logic Examples where fuzzy logic is used Automobile subsystems, such as ABS and cruise

control Air conditioners The MASSIVE engine used in the Lord of the

Rings films, which helped show huge scale armies create random, yet orderly movements

Cameras Digital image processing Dishwashers Elevators Washing machines and other home appliances. Video game artificial intelligence

Page 27: 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.

27

Some Misconceptions on Fuzzy Logic

Fuzzy logic has suffered many misconceptions, partly due to its name. "Fuzzy" often has negative connotations, either suggesting something cute or something imprecise; the latter sometimes causes people to equate "fuzzy logic" with "imprecise logic".

Page 28: 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.

28

However, fuzzy logic is not any less precise than any other form of logic: it is an organized and mathematical method of handling inherently imprecise concepts.

The concept of "coldness" cannot be expressed in an equation, because although temperature is a quantity, "coldness" is not.

However, people have an idea of what "cold" is, and agree that something cannot be "cold" at N degrees but "not cold" at N+1 degrees — a concept classical logic cannot easily handle due to the principle of bivalence.

Page 29: 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.

29

Another common misconception is that fuzzy logic is a new way of expressing probability.

However, Bart Kosko has shown that probability is a subtheory of fuzzy logic, as probability only handles one kind of uncertainty.

He also proved a theorem demonstrating that Bayes' theorem can be derived from the concept of fuzzy subsethood.

This should not by any means suggest that all those who study probability accept or even understand fuzzy logic, however: to many, fuzzy logic is still a curiosity.

Page 30: 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.

30

Fuzzy logic is also sometimes said to be used only in AI, control systems, and/or expert systems (note that these fields can have significant overlap).

These are by far the most common applications, but by no means the only possible: fuzzy logic can be applied in any situation requiring the handling of uncertainty.