fuzzy vs. crisp - hesitant fuzzy set theory| fuzzy ... · fuzzy vs. crisp crisp system fuzzy logic...

11
1 Fundamentals of Fuzzy logic Fuzzy vs. crisp Crisp system Fuzzy system - Crisp, exact - based on models (i.e. differential equations) - Requires complete set of data - Typically linear - Fuzzy, qualitative, vague - Uses knowledge (i.e. rules) - Requires fuzzy data - Nonlinear method Fuzzy vs. crisp Crisp system Fuzzy logic system -Complex systems hard to model -incomplete information leads to inaccuracy -numerical -No traditional modeling, inferences based on knowledge - can handle incomplete information to some degree -linguistic Introduction and background Fuzzy logic provides means to represent approximate knowledge Developed by Lotfi Zadeh in the mid 1960s Applications in: – Industrial processes, consumer appliances, ground transportation etc. Introduction and background • Motivation A human expert in a process generally improves performance, detect faults expensive, experts rare slow response Fuzzy system in a process cheaper than an expert faster response knowledge may be acquired from – reports – diaries – experience Fuzzy systems Knowledge base Inference engine • Database Know- ledge Data- base Inference

Upload: hoangdung

Post on 18-Nov-2018

291 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Fuzzy vs. crisp - Hesitant Fuzzy Set Theory| Fuzzy ... · Fuzzy vs. crisp Crisp system Fuzzy logic system-Complex systems hard to model-incomplete information leads to inaccuracy-numerical-No

1

Fundamentals of Fuzzy logic

Fuzzy vs. crisp

Crisp system Fuzzy system

- Crisp, exact

- based on models (i.e.

differential equations)

- Requires complete

set of data

- Typically linear

- Fuzzy, qualitative, vague

- Uses knowledge (i.e.

rules)

- Requires fuzzy data

- Nonlinear method

Fuzzy vs. crisp

Crisp system Fuzzy logic system

-Complex systems hard to model

-incomplete information leads to inaccuracy

-numerical

-No traditional modeling, inferences based on

knowledge

- can handle incomplete

information to some degree

-linguistic

Introduction and background

• Fuzzy logic provides means to represent approximate knowledge

• Developed by Lotfi Zadeh in the mid 1960s

• Applications in:– Industrial processes, consumer appliances,

ground transportation etc.

Introduction and background

• Motivation– A human expert in a process

• generally improves performance, detect faults• expensive, experts rare• slow response

– Fuzzy system in a process• cheaper than an expert• faster response• knowledge may be acquired from

– reports– diaries– experience

Fuzzy systems

• Knowledge base• Inference engine

• Database

Know-ledge

Data-base

Inference

Page 2: Fuzzy vs. crisp - Hesitant Fuzzy Set Theory| Fuzzy ... · Fuzzy vs. crisp Crisp system Fuzzy logic system-Complex systems hard to model-incomplete information leads to inaccuracy-numerical-No

2

Fuzzy systems

• Mimics human ’soft’ behavior– Flexible– Fuzzy knowledge

• Knowledge– Coded as linguistic rules– Originates from experts– Inferences formed using CRI, Compositional

Rule of Inference

Fuzzy sets

• “A fuzzy set is a soft-bordered space to which all elements with a certain quality belong, up to a certain extent”

• For example:– “The set of narrow streets in Helsinki– Temperature: freezing, cold, cool, tepid,

warm, hot

Fuzzy sets – Membership function

• A fuzzy set X can be described by a membership function µX(x)

• A membership function defines to what extent a certain element (e.g. x ) belongs to a (fuzzy) set (e.g. X)

• Membership functions only get values between 0 and 1

• For example:

µX(x) = 1 - x2, when -1 ≤ x ≤ 1µX(x) = 0, elsewhere

-2 -1.5 -1 -0.5 0 0.5 1 1.5 20

0.5

1

1.5

x

µ x(x)

Fuzzy sets – Membership function

• Consider the example with temperature: freezing, cold, cool, tepid, warm, hot

-20 -10 0 10 20 300

0.5

1

1.5

freezingcold

cool

tepid

warmhot

Fuzzy sets - notation• Let A be a fuzzy set in a universe X• is the membership function

for (how much the elements of X belong to) A–

• Can also be given in discrete form–

( ) [ ]10,X:xµA →

( )( ) ( ) [ ]{ }10,xµX,x;xµx,A AA ∈∈=

( ) ( ) ( ) nnA22A11A xxµxxµxxµA +++= K

• Fuzzy statement:p=”x∈A”=“x belongs to A”=”χ IS A” where x is a numerical value and χ a linguistic value of a variable X

• “Truth value” θ(p)=µA(x)

Fuzzy logic operations

• Fuzzy logic=logic considering fuzzy statements• Based on operations familiar from conventional

logics– Complement (negation, NOT)– Union (disjunction, OR)– Intersection (conjugation, AND)

• Basic laws of standard logics apply (commutativity, associativity, etc...)

• Fuzziness of sets allow broader interpretations (e.g. law of excluded middle)

Page 3: Fuzzy vs. crisp - Hesitant Fuzzy Set Theory| Fuzzy ... · Fuzzy vs. crisp Crisp system Fuzzy logic system-Complex systems hard to model-incomplete information leads to inaccuracy-numerical-No

3

Fuzzy logic operations - NOT

• Creates the complement set of the set operated upon– symbol A’– ( ) ( ) Xx,xµ1xµ AA ∈∀−=′

Fuzzy logic operations - OR• Creates the union of the (two) sets operated

upon– Symbol

– ∪ is an s-norm

BA ∪

( ) ( ) ( )[ ] Xx,xµ,xµmaxxµ BABA ∈∀=∪

Fuzzy logic operations - AND

• Creates the intersection of the sets operated

upon – Symbol

– ∩ Is a t-norm

BA ∩( ) ( ) ( )[ ] Xx,xµ,xµminxµ BABA ∈∀=∩

Fuzzy logic

• A difference between crisp logic and fuzzy logic: law of excluded middle

• Standard logic: = universe (X)

• Fuzzy logic: universe (X)• For example:

– ”All my statements are false”– Also the figure on the right

illustrates the law

AA ′∪⊂′∪ AA

Implication

• In standard logic the implication IF A THEN B (A → B) has the same truth table as NOT A OR B

• In a Fuzzy context implication may be defined in several ways

• For example (Mamdani):

• Lets study the Mamdani implication with an example

( ) ( ) ( )[ ] YyX,xyµxµminyx,µ BABA ∈∀∈∀=→ ,

Membership function µA(x)

0 1 2 3 4 5 6 7 80

0.2

0.4

0.6

0.8

1

x

µ A(x

)

Page 4: Fuzzy vs. crisp - Hesitant Fuzzy Set Theory| Fuzzy ... · Fuzzy vs. crisp Crisp system Fuzzy logic system-Complex systems hard to model-incomplete information leads to inaccuracy-numerical-No

4

Membership function µB(y)

0 2 4 6 8 10 120

0.2

0.4

0.6

0.8

1

y

µ B(y

)

µA→B(x,y) with Mamdani implication

02

46

810

12

0

2

4

6

80

0.2

0.4

0.6

0.8

1

1.2

y

µ A--

>B(x

,y)

x

Implication

• There are several other implication variants in fuzzy logic but the Mamdani approach is the most common

• E.g. Larsen implication:

( ) ( ) ( ) YyX,x,yµxµyx,µ BABA ∈∀∈∀=→

Larsen implication

x0

24

68

1012

0

2

4

6

80

0.2

0.4

0.6

0.8

1

1.2

y

µ A--

>B(x

,y)

Illustration of different implication formulas (triangular membership functions)

Composition and inference

• Fuzzy if-then rules can be aggregated into a single membership function= fuzzy set of input-output-pairs= fuzzy relation

• Application of a fuzzy input to a fuzzy relation is the basis ofdecision-making in fuzzy knowledge-based systems

• Decision making using fuzzy logic is known as fuzzy inference

• The compositional rule of inference (CRI) is used for this

purpose

• Composition plays a crucial role in fuzzy inference and fuzzy knowledge-based systems

Page 5: Fuzzy vs. crisp - Hesitant Fuzzy Set Theory| Fuzzy ... · Fuzzy vs. crisp Crisp system Fuzzy logic system-Complex systems hard to model-incomplete information leads to inaccuracy-numerical-No

5

Compositional rule of inference

• In knowledge-based systems, knowledge is often expressed as rules of the form:”IF condition Y1 is y1 AND IF condition Y2 is y2THEN state C is c”

• Example: If the temperature is high and the level of vibrations is high then the bearing is faulty

• In fuzzy knowledge-based systems, rules of this type are linguistic statements of expert knowledge in which y1, y2 and c are fuzzy quantities

• These rules are fuzzy relations that employ the fuzzy implication (IF-THEN)

• The collective set of fuzzy relations forms the knowledge base of the fuzzy system

• Denote the fuzzy relation formed by a collection of rules as the fuzzy set K

• This relation is an aggregation of the individual rules and may be represented by a multivariable membership function

• Matching and inference-making is done using the composition operation

• The application of composition to make inferences in this manner is known as the compositional rule of inference (CRI)

• Suppose that the available data are denoted by a fuzzy relation D and the inference is denoted by a fuzzy relation I

• The compositional rule of inference states that: I = D ◦ K

• We can determine the membership function of the inference I → µI = sup min [µD, µK]– this inference is the output of the knowledge-

based decision-making system

• The knowledge-base K consists of rules containing AND connectives and fuzzy implication (IF-THEN), both of which can be represented by min operations

• The membership function of each rule can be formed by the membership functions of the constituent variables by applying min

• Since the individual rules are connected by an OR operation, the overall membership function of K may be determined by applying max to the membership functions of the individual rules

Composition through matrix multiplication

• When a membership function is discrete, it can be represented as a vector of membership values

• In the case of discrete membership functions, the membership function of each rule and hence the overall membership function of the rule base can be represented as a matrix

• In this case it is convenient to consider the composition operation as a generalized matrix multiplication of the membership function vector of data and the membership function matrix of the rule base

Page 6: Fuzzy vs. crisp - Hesitant Fuzzy Set Theory| Fuzzy ... · Fuzzy vs. crisp Crisp system Fuzzy logic system-Complex systems hard to model-incomplete information leads to inaccuracy-numerical-No

6

Considerations of fuzzy decision-making

• A fuzzy knowledge base can represent a complex system not as a set of complex, nonlinear differential equations but as a simple set of input-output relations

• Rules contain fuzzy terms such as small, fast, high and very, which are common linguistic expressions of knowledge about a practical situation

• Inferences can be made by matching a set of available information with the rule base of the system (done by applying the CRI)

• The antecedent (If) part of a rule corresponds to the input variables of the fuzzy decision-making system

• Several input variables may be connected by AND connectives

• Different rules in the rule base will involve different fuzzy states of the antecedent variables

Rule example: IF x is Ai and IF y is Bi THEN z is Ci

Extensions to fuzzy decision-making

• We have considered fuzzy rules of the form:IF x is Ai and IF y is Bi THEN z is Ci

• Ai, Bi, and Ci are fuzzy states governing the i-thrule of the rule base (Mamdani approach)

• The knowledge base is represented as fuzzy protocols of the form above and represented by membership functions for Ai, Bi, and Ci

• The inference is obtained by applying the compositional rule of inference

• The result is a fuzzy membership function, which typically has to be defuzzified for use in practical tasks

• Several variations to this conventional method are available

• One such version is the Sugeno model• The knowledge base has fuzzy rules with

crisp functions as the consequent, of the formIF x is Ai and IF y is Bi THEN ci = ƒi(x,y)for rule i, where ƒi is a crisp function of the condition variables x and y

• The output part is a crisp function of the condition variables while the condition part of this rule is the same as for the Mamdanimodel

• The inference ĉ(x,y) of the fuzzy knowledge-based system is obtained directly as a crisp function of the condition variables x and y

• The Sugeno model is particularly useful when the actions are described analytically through crisp functions

• The Sugeno model approach is commonly used in applications of direct control and in simplified fuzzy models

• The Mamdani approach, even though popular in low-level direct control, is particularly appropriate for knowledge representation and processing in expert systems and in high-level control systems

Page 7: Fuzzy vs. crisp - Hesitant Fuzzy Set Theory| Fuzzy ... · Fuzzy vs. crisp Crisp system Fuzzy logic system-Complex systems hard to model-incomplete information leads to inaccuracy-numerical-No

7

Basics of fuzzy logic

• Knowledge base

• CRI (Compositional Rule of Inference)– Create a control action (inference) out of

measurement and knowledge base

Rule

base

Membership function

[ ]=C' A' B' Ra,b

µ (c) sup min µ (a),µ (b),µ (a,b,c)

Basics of fuzzy logic

• CRI assumes that data is fuzzy– measurements are crisp → fuzzification

– output signal should be crisp →defuzzification

Steps in fuzzy logic

• Knowledge base development1. Develop a set of Linguistic rules

2. Obtain a set of membership functions3. Obtain multivariable rule base function Ri

4. Combine relations Ri to obtain the overall fuzzy rule base R

Steps in fuzzy logic (2)

• System use1. Fuzzify the measured variables

2. Match the measurements with rule base using CRI

3. Defuzzify the obtained inference

Composition using individual rules

• CRI assumes that measurements are fuzzified

• Crisp measurements can be used directly in fuzzy logic if we take another simpler approach

• It’s called: Inference based on individual rules

Illustration

High high high

High low medium high

low high medium low

low low low

Page 8: Fuzzy vs. crisp - Hesitant Fuzzy Set Theory| Fuzzy ... · Fuzzy vs. crisp Crisp system Fuzzy logic system-Complex systems hard to model-incomplete information leads to inaccuracy-numerical-No

8

Defuzzification

• Centroid (center of gravity) method• Mean of maxima method

• Threshold methods

Centroid method (1)

• Uses entire membership function of a inference

• Value depends of size and shape of control inference

• Not sensitive to small variations→ robust response→ generates less oscillation→ slow

Centroid method (2) Fuzzy inference surface

• A method which speeds up the calculation process considerably

• Produces crisp control values directly• Cannot be modified on-line• Cannot improve through learning

Fuzzy inference surface Extensions of Mamdani fuzzy systems

• Sugeno model– fuzzy rules with crisp functions as the

inferences:

– inference is obtained using the weighting parameter with inferences:

Page 9: Fuzzy vs. crisp - Hesitant Fuzzy Set Theory| Fuzzy ... · Fuzzy vs. crisp Crisp system Fuzzy logic system-Complex systems hard to model-incomplete information leads to inaccuracy-numerical-No

9

Fuzzy logic in monitoring

• The most common application of fuzzy logic in monitoring is to have the fuzzy system act as an expert which can classify the system as healthy or not based on measurements and the coded expert knowledge

• It can also be used for residual evaluation

Fuzzy Logic

• Let’s take a look at the fuzzy controltoolbox in Matlab

• Command: fuzzy

Summary• Fuzzy logic was first developed by Zadeh

in the mid-1960’s• Fuzzy logic was developed for

representing some types of ”approximate”knowledge that cannot be represented by crisp methods

• Fuzzy logic is an extension of crisp two-state logic in the sense that it provides a platform for handling approximate knowledge

• Fuzzy logic is based on fuzzy set theory in a similar manner to how crisp two-state logic is based on crisp set theory

• A fuzzy set is represented by a membership function

• A particular ”element” value in the range of definition of the fuzzy set will have a grade of membership

• It gives the degree to which the particular element belongs to the set

• It is possible for an element to belong to the set at some degree and simultaneously not belong to the set at a complementary degree, thereby allowing a non-crisp membership

• The compositional rule of inference is what is applied in decision-making with fuzzy logic

• Differences between crisp and fuzzy logic– fuzzy uses linguistic rules, crisp numerical– crisp logic is faster– crisp logic needs modeling, but fuzzy logic

expert information– fuzzy logic is more robust, more ”intelligent”– fuzzy uses more human-like approach

• Information needs preprocessing– measurement fuzzification– control signal defuzzification

Neuro-fuzzy systems

Page 10: Fuzzy vs. crisp - Hesitant Fuzzy Set Theory| Fuzzy ... · Fuzzy vs. crisp Crisp system Fuzzy logic system-Complex systems hard to model-incomplete information leads to inaccuracy-numerical-No

10

Introduction

• Combined neural networks and fuzzy logic systems

• Problems with both linguistic and numeric knowledge

• Neuro-fuzzy can provide a solution

Features of fuzzy logic and neural networks-based systems

Excellent tools for learning

ExistentLearning

Knowledge distributed within computational units, implicit and difficult to interpret

Linguistic description of knowledge

Knowledgerepresentation

Neural networks

Fuzzy logic

Hybrid neuro-fuzzy method

• The fuzzy logic system and the neural network work as one synchronized entity

• Parallel architecture• Same architecture as traditional fuzzy systems except

that a layer of hidden neurons performs each of the tasks of the fuzzy inference system

Hybrid neuro-fuzzy method: structure

• Layer 1. Fuzzification– Crisp inputs are fuzzified through mapping into

membership functions• Layer 2. Rule nodes

– One node per each fuzzy if-then rule• Layer 3. Normalization

– Firing strengths of the fuzzy rules are normalized• Layer 4. Consequent layer

– The values of the consequent are multiplied by normalized firing strengths

• Layer 5. Summation– Computes the overall output as the summation of

incoming signals

Adaptive-Network based Fuzzy Inference System

• ANFIS is an example of a hybrid neuro-fuzzy system

• Five-layer feed-forward network• Supports only Sugeno-type systems with

the following constraints– First or zero order Sugeno-type systems

– Single output, obtained using a weighted average defuzzification method

– The weight of each rule is unity

Five-layer ANFIS 1/3

Page 11: Fuzzy vs. crisp - Hesitant Fuzzy Set Theory| Fuzzy ... · Fuzzy vs. crisp Crisp system Fuzzy logic system-Complex systems hard to model-incomplete information leads to inaccuracy-numerical-No

11

Five-layer ANFIS 2/3 Five-layer ANFIS 3/3• Layer 1

– Stores parameters to define a bell-shaped membership function that represents the profile of linguistic variable

• Layer 2– Stores the rules

• Layer 3– Computes the relative degree of fulfilment for every

rule

• Layer 4– Computes the consequent part of the rule

• Layer 5– Computes the final summation

Four-layer ANFIS

• Also a three-layer neuro-fuzzy approximator has been proposed

Construction of neuro-fuzzy systems

• Structure learning phase– Determining the fuzzy rules structure

– Based on partitioning of the input-output space

– Each partition represents one rule– Overlap between boundaries in fuzzy systems

– Several partitioning methods• Grid-type partitioning (fixed or adaptive)• Clustering• Scatter partitioning

Construction of neuro-fuzzy systems

• Parameter learning phase– Tuning and optimizing the parameters

(membership functions, output parameters)

– Typically a hybrid learning technique is used. E.g. Least squares + gradient descent

Example

• Let’s look at the MATLAB ANFIS tool• The try to solve the Peaks problem that we

studied earlier with Neural Networks. • Start the GUI: ANFISEDIT• Import data• Generate structure• Train!