54
06/28/22 1 Introduction to Fuzzy Logic BIOGEOS Feb. 27- March 03, 2015

Fuzzy Logic

Embed Size (px)

DESCRIPTION

Fuzzy Logic

Citation preview

Page 1: Fuzzy Logic

04/21/23 1

Introduction to Fuzzy Logic BIOGEOS

Feb. 27- March 03, 2015

Page 2: Fuzzy Logic

Introduction [1]

It is possible to have a great deal of data (facts collected from observations or measurements) and at the same time lack of information (meaningful interpretation and correlation of data that allows one to make decisions.)

Data Information Value addition

Information

Page 3: Fuzzy Logic

Introduction [2]

Uncertain information: Information for which it is not possible to determine whether it is true or false. Ex: a person is “possibly 30 years old”

Imprecise information: Information which is not available as precise as it should be. Ex: A person is “around 30 years old.”

Vague information: Information which is inherently vague. Ex: A person is “young.”

Inconsistent information: Information which contains two or more assertions that cannot be true at the same time. Ex: Two assertions are given: “Ali is 16” and “Ali is older than 20”

Incomplete information: information for which data is missing or data is partially available. Ex: A person’s age is “not known” or a person is “between 25 and 32 years old”

Combination of the various types of such information may also exist. Ex: “possibly young”, “possibly around 30”, etc.

Information Type

Page 4: Fuzzy Logic

Introduction [3]

Knowledge is information at a higher level of abstraction.

Ex: Ali is 10 years old (fact)

Ali is not old (knowledge)

Knowledge

Database Intelligent information systems Knowledge base & AI

Page 5: Fuzzy Logic

Introduction [4]

•Large amount of information with large amount of uncertainty lead to complexity.

•Awareness of knowledge (what we know and what we do not know) and complexity goes together.

Ex: Driving a car is complex, driving in an iced road is more complex, since more knowledge is needed for driving in an iced road.

Complexity

Page 6: Fuzzy Logic

Introduction [5]

UNCERTAINTY(Uncertainty-based information)

COMPLEXITY(Description-algorithmic infor.)

CREDIBILITY(knowledge)

USEFULNESS

Page 7: Fuzzy Logic

Introduction [6]

Example: When uncertainties like heavy traffic, unfamiliar roads, unstable wheather conditions, etc. increase, the complexity of driving a car increases.

How do we go with the complexity?We try to simplify the complexity by making a

satisfactory trade-off between information available to us and the amount of uncertainty we allow.

We increase the amount of uncertainty by replacing some of the precise information with vague but more useful information.

Dealing with uncertainty

Page 8: Fuzzy Logic

Introduction [7]

Examples: Travel directions: try to do it in mm terms (or turn the wheel % 23

left, etc.), which is very precise and complex but not very useful. So replace mm information with city blocks, which is not as precise but more meaningful (and/or useful) information.

Parking a car: doing it in mm terms, which is very precise and complex but difficult and very costly and not very useful. So replace mm information with approximate terms (between two lines), which is not as precise but more meaningful (or useful) information and can be done in less cost.

Describing wheather of a day: try to do it in % cloud cover, which is very precise and complex but not very useful. So replace % cloud information with vague terms (very cloudy, sunny etc.), which is not as precise but more meaningful (or useful) information.

Ad Hoc Dealing with uncertainty

Page 9: Fuzzy Logic

Introduction [8]

Fuzzy Logic: Concept

• Fuzzy logic provides a systematic basis for representation of uncertainty, imprecision, vagueness, and/or incompleteness.

• Fuzzy logic is based on the idea that all things admit of degrees. Temperature, height, speed, distance, beauty – all come on a sliding scale.

• The concrete material has very high strength• Expressway is very congested

Page 10: Fuzzy Logic

Introduction [9]

First, it aims to alleviate difficulties in developing and analyzing

complex systems encountered by conventional mathematical tools.

This motivation requires fuzzy logic to work in quantitative and

numeric domains.

Second, it is motivated by observing that human reasoning can

utilize concepts and knowledge that do not have well defined, sharp

boundaries (i.e., vague concepts). This motivation enables fuzzy

logic to have a descriptive and qualitative form. This is related to AI.

Fuzzy Logic: Motivation

Page 11: Fuzzy Logic

Introduction [10]

Fuzzy Logic (FL) is a multivalued logic, that allows intermediate values to be defined between conventional evaluations like true/false, yes/no, high/low, etc.

(a) Boolean Logic. (b) Multi-valued Logic.0 1 10 0.2 0.4 0.6 0.8 100 1 10

Fuzzy Logic: Definition

Page 12: Fuzzy Logic

Introduction [11]

Fuzzy logic has been used for two different senses: In a narrow sense: refers to logical system generalizing

crisp logic for reasoning uncertainty. In a broad sense: refers to all of the theories and

technologies that employ fuzzy sets, which are classes with imprecise boundaries.

The broad sense of fuzzy logic includes the narrow sense of fuzzy logic as a branch.

Other areas include fuzzy control, fuzzy pattern recongnition, fuzzy arithmetic, fuzzy probability theory, fuzzy decision analysis, fuzzy databases, fuzzy expert systems, fuzzy computer SW and HW, etc.

Fuzzy Logic: Usage

Page 13: Fuzzy Logic

Introduction [11]

Ease of describing human knowledge involving vague concepts

Enhanced ability to develop a cost-effective solution to real-world

In another word, fuzzy logic not only provides a cost effective way to model complex systems involving numeric variables but also offers a quantitative description of the system that is easy to comprehend.

Fuzzy Logic: Utility

Page 14: Fuzzy Logic

Introduction [12]

Fuzziness is deterministic uncertainty – probability is nondeterministic.

Probabilistic uncertainty dissipates with increasing number of occurrences fuzziness does not.

Fuzziness describes event ambiguity – probability describes event occurrence. Whether an event occurs is random. The degree to which it occurs is fuzzy.

Fuzzy Logic Vs Probability

Page 15: Fuzzy Logic

Introduction [13]

• Fuzzy Sets

• Fuzzy Operators

• Fuzzy Rules

• Fuzzy Controller

Page 16: Fuzzy Logic

Fuzzy Applications [1]Advertisement: …• Extraklasse Washing Machine - 1200 rpm. The Extraklasse machine has

a number of features which will make life easier for you.• Fuzzy Logic detects the type and amount of laundry in the drum and

allows only as much water to enter the machine as is really needed for the loaded amount. And less water will heat up quicker - which means less energy consumption.

• Foam detectionToo much foam is compensated by an additional rinse cycle: If Fuzzy Logic detects the formation of too much foam in the rinsing spin cycle, it simply activates an additional rinse cycle. Fantastic!

• Imbalance compensation In the event of imbalance, Fuzzy Logic immediately calculates the maximum possible speed, sets this speed and starts spinning. This provides optimum utilization of the spinning time at full speed […]

• Washing without wasting - with automatic water level adjustment• Fuzzy automatic water level adjustment adapts water and energy

consumption to the individual requirements of each wash programme, depending on the amount of laundry and type of fabric […]

Page 17: Fuzzy Logic

Fuzzy Applications [2]

• Other Application areas– Fuzzy Control

• Metro trains

• Intelligent Transportation System Applications

• Cement kilns

• Fridges

Page 18: Fuzzy Logic

Crisp Set

• A set X of all real numbers between 0 and 10 which we call the universe of discourse.

• Define a subset A of X of all real-numbers in the range between 5 and 8.

A = [5,8], A is a crisp set and 1A is the characteristic function

Page 19: Fuzzy Logic

Fuzzy Set [1]

•B = {set of young people}

•B = [0,20] crisp interval

Well, s/he belongs a little bit more to the set of young people or NO, s/he belongs nearly not to the set of young people.

Page 20: Fuzzy Logic

Fuzzy Set [2]

•B = {set of young people}•B = [0,20] crisp interval = [0,1]

Page 21: Fuzzy Logic

Fuzzy Set [3]

•B = {set of young people}•B = [0,20] crisp interval = [0,1]

Page 22: Fuzzy Logic

Fuzzy Set [4]•B = {set of young people}•B = [0,20] crisp interval = [0,1] Degree of Membership

Fuzzy

Sam

Arun

Raja

Ajey

Kanu

1

1

1

0

0

1.00

1.00

0.98

0.82

0.78

Rohit

Suresh

Rajesh

Phani

Ram

Crisp

1

0

0

0

0

0.24

0.15

0.06

0.01

0.00

Name Height, cm

205

198

181

167

155

152

158

172

179

208

Page 23: Fuzzy Logic

Fuzzy Set [5]

150 210170 180 190 200160

Height, cmDegree ofMembership

Tall Men

150 210180 190 200

1.0

0.0

0.2

0.4

0.6

0.8

160

Degree ofMembership

170

1.0

0.0

0.2

0.4

0.6

0.8

Height, cm

Fuzzy Sets

Crisp SetsThe x-axis represents the universe of discourse – the range of all possible values applicable to a chosen variable. In our case, the variable is the man height. According to this representation, the universe of men’s heights consists of all tall men.

The y-axis represents the membership value of the fuzzy set. In our case, the fuzzy set of “tall men” maps height values into corresponding membership values.

Page 24: Fuzzy Logic

Fuzzy Set [6]

• First, we determine the membership functions. In our “tall men” example, we can obtain fuzzy sets of tall, short and average men.

• The universe of discourse – the men’s heights – consists of three sets: short, average and tall men. As you will see, a man who is 184 cm tall is a member of the average men set with a degree of membership of 0.1, and at the same time, he is also a member of the tall men set with a degree of 0.4.

Page 25: Fuzzy Logic

Fuzzy Set [7]

150 210170 180 190 200160

Height, cmDegree ofMembership

Tall Men

150 210180 190 200

1.0

0.0

0.2

0.4

0.6

0.8

160

Degree ofMembership

Short Average ShortTall

170

1.0

0.0

0.2

0.4

0.6

0.8

Fuzzy Sets

Crisp Sets

Short Average

Tall

Tall

Page 26: Fuzzy Logic

Fuzzy Set [8]

• Typical functions that can be used to represent a fuzzy set are sigmoid, gaussian and pi. However, these functions increase the time of computation. Therefore, in practice, most applications use linear fit functions.

Fuzzy Subset A

Fuzziness

1

0Crisp Subset A Fuzziness x

X

(x)

Page 27: Fuzzy Logic

Linguistic Variables and Hedges [1]

• The range of possible values of a linguistic variable represents the universe of discourse of that variable. For example, the universe of discourse of the linguistic variable speed might have the range between 0 and 220 km/h and may include such fuzzy subsets as very slow, slow, medium, fast, and very fast.

• A linguistic variable carries with it the concept of fuzzy set qualifiers, called hedges.

• Hedges are terms that modify the shape of fuzzy sets. They include adverbs such as very, somewhat, quite, more or less and slightly.

Page 28: Fuzzy Logic

Linguistic Variables and Hedges [2]

Short

Very Tall

Short Tall

Degree ofMembership

150 210180 190 200

1.0

0.0

0.2

0.4

0.6

0.8

160 170

Height, cm

Average

TallVery Short Very Tall

Page 29: Fuzzy Logic

Linguistic Variables and Hedges [3]

Hedge MathematicalExpression

A little

Slightly

Very

Extremely

Hedge MathematicalExpression Graphical Representation

[A ( x )]1.3

[A ( x )]1.7

[A ( x )]2

[A ( x )]3

Page 30: Fuzzy Logic

Linguistic Variables and Hedges [4]

Hedge MathematicalExpressionHedge MathematicalExpression Graphical Representation

Very very

More or less

Indeed

Somewhat

2 [A ( x )]2

A ( x )

A ( x )

if 0 A 0.5

if 0.5 < A 1

1 2 [1 A ( x )]2

[A ( x )]4

Page 31: Fuzzy Logic

Operations on Fuzzy Sets [1]

Interactions between fuzzy sets are called operations

• Complement• Containment• Union• Intersection

Page 32: Fuzzy Logic

Operations on Fuzzy Sets [2]

Intersection Union

Complement

Not A

A

Containment

AA

B

BA BAA B

Page 33: Fuzzy Logic

Operations on Fuzzy Sets [3]

Membership Functions

• For the sake of convenience, usually a fuzzy set is denoted as:

A = A(xi)/xi + …………. + A(xn)/xn

where A(xi)/xi (a singleton) is a pair “grade of membership” element, that belongs to a finite universe of discourse:

A = {x1, x2, .., xn}

Page 34: Fuzzy Logic

Operations on Fuzzy Sets [4]

• Crisp Sets: Who does not belong to the set?• Fuzzy Sets: How much do elements not belong to the set?

• The complement of a set is an opposite of this set. For example, if we have the set of tall men, its complement is the set of NOT tall men. When we remove the tall men set from the universe of discourse, we obtain the complement.

• If A is the fuzzy set, its complement A can be found as follows:

A(x) = 1 A(x)

Fuzzy Sets: Complement

Page 35: Fuzzy Logic

Operations on Fuzzy Sets [5]

• Crisp Sets: Which sets belong to which other sets?• Fuzzy Sets: Which sets belong to other sets?

• For example, the set of tall men contains all tall men; very tall men is a subset of tall men. However, the tall men set is just a subset of the set of men.

• In crisp sets, all elements of a subset entirely belong to a larger set. In fuzzy sets, however, each element can belong less to the subset than to the larger set. Elements of the fuzzy subset have smaller memberships in it than in the larger set.

Fuzzy Set: Containment

Page 36: Fuzzy Logic

Operations on Fuzzy Sets [6]

• Crisp Sets: Which element belongs to both sets?• Fuzzy Sets: How much of the element is in both sets?• In classical set theory, an intersection between two sets contains the

elements shared by these sets. For example, the intersection of the set of tall men and the set of fat men is the area where these sets overlap. In fuzzy sets, an element may partly belong to both sets with different memberships.

• A fuzzy intersection is the lower membership in both sets of each element. The fuzzy intersection of two fuzzy sets A and B on universe of discourse X:

AB(x) = min [A(x), B(x)] = A(x) B(x),

where xX

Fuzzy Sets: Intersection

Page 37: Fuzzy Logic

Operations on Fuzzy Sets [7]

• Crisp Sets: Which element belongs to either set?

• Fuzzy Sets: How much of the element is in either set?

• The union of two crisp sets consists of every element that falls into either set. For example, the union of tall men and fat men contains all men who are tall OR fat.

• In fuzzy sets, the union is the reverse of the intersection. That is, the union is the largest membership value of the element in either set. The fuzzy operation for forming the union of two fuzzy sets A and B on universe X can be given as:

AB(x) = max [A(x), B(x)] = A(x) B(x),

where xX

Fuzzy Sets: Union

Page 38: Fuzzy Logic

Operations of Fuzzy Sets [8]

Complement

0x

1

( x )

0x

1

Containment

0x

1

0x

1

A B

Not A

A

Intersection

0x

1

0x

A B

Union0

1

A BA B

0x

1

0x

1

B

A

B

A

( x )

( x )

( x )

Page 39: Fuzzy Logic

Properties of Fuzzy Sets [1]

• Equality of two fuzzy sets

• Inclusion of one set into another fuzzy set

• Cardinality of a fuzzy set

• An empty fuzzy set -cuts (alpha-cuts)

Page 40: Fuzzy Logic

Properties of Fuzzy Sets: Equality

• Fuzzy set A is considered equal to a fuzzy set B, IF AND ONLY IF (iff):

A(x) = B(x), xX

A = 0.3/1 + 0.5/2 + 1/3

B = 0.3/1 + 0.5/2 + 1/3

therefore A = B

Page 41: Fuzzy Logic

Properties of Fuzzy Sets: Inclusion

• Inclusion of one fuzzy set into another fuzzy set. Fuzzy set A X is included in (is a subset of) another fuzzy set, B X:

A(x) B(x), xX

Consider X = {1, 2, 3} and sets A and B

A = 0.3/1 + 0.5/2 + 1/3;

B = 0.5/1 + 0.55/2 + 1/3

then A is a subset of B, or A B

Page 42: Fuzzy Logic

Properties of Fuzzy Sets: Cardinality

• Cardinality of a non-fuzzy set, Z, is the number of elements in Z. BUT the cardinality of a fuzzy set A, the so-called SIGMA COUNT, is expressed as a SUM of the values of the membership function of A, A(x):

cardA = A(x1) + A(x2) + … A(xn) = ΣA(xi), for i=1..n

Consider X = {1, 2, 3} and sets A and B

A = 0.3/1 + 0.5/2 + 1/3;

B = 0.5/1 + 0.55/2 + 1/3

cardA = 1.8

cardB = 2.05

Page 43: Fuzzy Logic

Properties of Fuzzy Sets :Empty Fuzzy Set

• A fuzzy set A is empty, IF AND ONLY IF:

A(x) = 0, xX

Consider X = {1, 2, 3} and set A

A = 0/1 + 0/2 + 0/3

then A is empty

Page 44: Fuzzy Logic

Properties of Fuzzy Set: Alpha-cut

• An -cut or -level set of a fuzzy set A X is an ORDINARY SET A X, such that:

A={A(x), xX}.

Consider X = {1, 2, 3} and set A

A = 0.3/1 + 0.5/2 + 1/3

then A0.5 = {2, 3},

A0.1 = {1, 2, 3},

A1 = {3}

Page 45: Fuzzy Logic

Properties of Fuzzy Sets: Fuzzy Set Normality

• A fuzzy subset of X is called normal if there exists at least one element xX such that A(x) = 1.

• A fuzzy subset that is not normal is called subnormal.• All crisp subsets except for the null set are normal. In

fuzzy set theory, the concept of nullness essentially generalises to subnormality.

• The height of a fuzzy subset A is the large membership grade of an element in A

height(A) = maxx(A(x))

Page 46: Fuzzy Logic

Properties of Fuzzy Sets: Fuzzy Sets Core and Support

• Assume A is a fuzzy subset of X:

• the support of A is the crisp subset of X consisting of all elements with membership grade:

supp(A) = {x A(x) 0 and x X}

• the core of A is the crisp subset of X consisting of all elements with membership grade:

core(A) = {x A(x) = 1 and x X}

Page 47: Fuzzy Logic

Fuzzy Rules

• A fuzzy rule can be defined as a conditional statement in the form:

IF x is A

THEN y is B

• where x and y are linguistic variables; and A and B are linguistic values determined by fuzzy sets on the universe of discourses X and Y, respectively.

Page 48: Fuzzy Logic

Classical Vs Fuzzy Rules

• A classical IF-THEN rule uses binary logic, for example,

• The variable speed can have any numerical value between 0 and 220 km/h, but the linguistic variable stopping distance can take either value long or short. In other words, classical rules are expressed in the black-and-white language of Boolean logic

Classical Rule

Page 49: Fuzzy Logic

Classical Vs Fuzzy Rules

Fuzzy Rule

In fuzzy rules, the linguistic variable speed also has the range (the universe of discourse) between 0 and 220 km/h, but this range includes fuzzy sets, such as slow, medium and fast. The universe of discourse of the linguistic variable stopping distance can be between 0 and 300 m and may include such fuzzy sets as short, medium and long.

Page 50: Fuzzy Logic

Firing Fuzzy Rules [1]

• These fuzzy sets provide the basis for a weight estimation model. The model is based on a relationship between a man’s height and his weight:

IF height is tall

THEN weight is heavy

Tall men Heavy men

180

Degree ofMembership1.0

0.0

0.2

0.4

0.6

0.8

Height, cm

190 200 70 80 100160

Weight, kg

120

Degree ofMembership1.0

0.0

0.2

0.4

0.6

0.8

Page 51: Fuzzy Logic

Firing Fuzzy Rules [2]

• The value of the output or a truth membership grade of the rule consequent can be estimated directly from a corresponding truth membership grade in the antecedent. This form of fuzzy inference uses a method called monotonic selection.

Tall menHeavy men

180

Degree ofMembership1.0

0.0

0.2

0.4

0.6

0.8

Height, cm

190 200 70 80 100160

Weight, kg

120

Degree ofMembership1.0

0.0

0.2

0.4

0.6

0.8

Page 52: Fuzzy Logic

Fuzzy Controller [1]

• Fuzzy logic control or simply "fuzzy control" belongs to the class of "intelligent control," "knowledge-based control," or "expert control." Fuzzy control uses knowledge-based decision-making employing techniques of fuzzy logic in determining the control actions.

Page 53: Fuzzy Logic

Fuzzy Controller [2]

Page 54: Fuzzy Logic

Fuzzy Controller [3]

Fuzzy Controller Architecture