introduction to fuzzy logic and applications in...

Download Introduction to Fuzzy Logic and Applications in GIShomepage.univie.ac.at/.../ESRI_Fuzzy_Logic/File_1_Kainz_Slides.pdf · Fuzzy Logic and Applications in GIS Wolfgang Kainz 3 Wolfgang

If you can't read please download the document

Upload: dinhhanh

Post on 06-Feb-2018

249 views

Category:

Documents


3 download

TRANSCRIPT

  • Fuzzy Logic and Applications in GIS

    Wolfgang Kainz 1

    Introduction to Fuzzy Logic and Applications in GISWolfgang KainzCartography and GeoinformationDepartment of Geography and Regional ResearchUniversity of Vienna, Universittsstrae 7, A-1010 Vienna, AustriaTel.: +43 (1) 4277 48640 Fax: +43 (1) 4277 9486e-mail: [email protected]://homepage.univie.ac.at/wolfgang.kainz

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 2

    Schedule

    Examples: fuzzy site analysis, fuzzy spatial reasoning

    03.30pm - 05.00pmBreak03.00pm - 03.30pmFuzzy reasoning, software tools01.30pm - 03.00pmLunch12.00pm - 01.30pm

    Fuzzy relations, linguistic variables and hedges, fuzzy boundaries

    10.30am - 12.00pmBreak10.00am - 10.30am

    Introduction, fuzzy sets, membership functions, operations, -cuts

    08.30am - 10.00am

    Introduction

    Crisp exampleFuzziness and probabilityFuzzy sets

  • Fuzzy Logic and Applications in GIS

    Wolfgang Kainz 2

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 4

    Example: problem statementGiven a topographic data set, find all areaswith

    flat slope,favorable aspect, andmoderate elevation; that areclose to a lake or reservoir,not near a major road, and arenot located in a park or military installation.

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 5

    CriteriaFlat slope is less than 10 degrees.Aspect is favorable when the terrain is flat or oriented towards SE, S, or SW, i.e., aspect is -1 or between 135 and 225.Elevation is moderate when it is between 1,350 and 2,150 meters.Close to a lake or reservoir means within a buffer of 1,000 meters.Not near a major road means not within a buffer of 300 meters.

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 6

    FuzzinessFuzziness refers to vagueness and uncertainty, in particular to the vagueness related to human language and thinking.

    the set of tall people. all people living close to my home. all areas that are very suitable for growing corn.

  • Fuzzy Logic and Applications in GIS

    Wolfgang Kainz 3

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 7

    Fuzziness vs. probabilityProbability gives us an indication about the likelihood an event will occur. Whether it is going to happen or not, is not known. Fuzziness is an indication to what degreesomething belongs to a class. We know that it exists. What we do not know, however, is its extent, i.e., to which degree members of a given universe belong to the class.

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 8

    Terminology is member of set , belongs to is not a member of , does not belong to is subset of , is included in united with intersected with

    for all

    x Ax A

    x Ax A

    x Ax AA B

    A BA B

    A B A BA B A B

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 9

    Characteristic function of crisp sets

    =AxAx

    xX AA iff 0 iff 1

    )(where}1,0{:

    Let A be a subset of the universe X. Then the characteristic function A is defined as:

    Where iff means if and only if.

  • Fuzzy Logic and Applications in GIS

    Wolfgang Kainz 4

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 10

    Characteristic function: example

    Let X be the set of all persons attending the ESRI user conference.Let A X be the set of all persons who attend this seminar.The characteristic function of all xthat are member of A is 1.

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 11

    Fuzzy sets

    A fuzzy (sub-)set A of a universe X is defined by a membership function A.

    . in of the is)( where]1,0[:

    Axvalue membershipxX AA

    The universe is never fuzzy!

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 12

    Crisp sets versus fuzzy setsCharacteristic function Membership function

    =

    AxAx

    x

    X

    A

    A

    iff 0 iff 1

    )(

    where}1,0{:

    . in ofvalue membership

    the is)( where]1,0[:

    Ax

    xX

    A

    A

  • Fuzzy Logic and Applications in GIS

    Wolfgang Kainz 5

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 13

    ExampleHeight of three persons: A is 185cm (6 0.8), B is 165cm (5 5.0), and C is 186cm (6 1.2)

    short average tall

    0

    1

    165 185

    Height

    short average tall

    0

    1

    165 185

    HeightAB C CAB

    short average tallA 0 1 0B 1 0 0C 0 0 1

    Characteristic Functions Membership Functions

    short average tallA 0 0.60 0.50B 0.50 0.60 0C 0 0.56 0.53

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 14

    Notation of fuzzy sets:discrete expressionWhen the universe X = {x1, x2, , xn} is finite a fuzzy set A on X can be expressed as

    ii

    n

    iAnnAA xxxxxxA /)(/)(/)(

    111

    =

    =++=

    The symbol / is called separator. The symbols and + function as aggregation and connection of terms.

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 15

    Notation of fuzzy sets:continuous expression

    When the universe X = {x1, x2, } is infinite a fuzzy set A on X can be expressed as

    xxAX A

    /)(= The symbols / and function as separator and aggregation.NOTE: The symbol has nothing to do with the integral!

  • Fuzzy Logic and Applications in GIS

    Wolfgang Kainz 6

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 16

    Empty setThe empty set is defined as

    0)( , = xXx

    For every element of the universe we have trivially

    1)( , = xx X

    Membership Functions

    Linear membership functionsSinusoidal membership functionsSemantic import approach

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 18

    Membership functionThe membership function must be a real valued function whose values are between 0 and 1.The membership values should be 1 at the center of the set, i.e., for those members that definitely belong to the set.

  • Fuzzy Logic and Applications in GIS

    Wolfgang Kainz 7

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 19

    Membership functionThe membership function should fall off in an appropriate way from the center through the boundary.The points with membership value 0.5 (crossover point) should be at the boundary of the crisp set, i.e., if we would apply a crisp classification, the class boundary should be represented by the crossover points.

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 20

    Choice of membership function

    The membership function depends on the application.

    Example: moderate elevation may be defined differently in the Netherlands than in Tibet.

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 21

    Choice of membership function

    Classification based on attributesSemantic Import Approach (using a priorimembership functions)Fuzzy k-means or c-means (data driven, not discussed here)

  • Fuzzy Logic and Applications in GIS

    Wolfgang Kainz 8

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 22

    Types of membership functions

    Linear membership functionsSinusoidal membership functionsGaussian membership function

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 23

    Linear membership function

    a

    b c

    d

    0 20 40 60 80 100U

    0.10.20.30.40.50.60.70.80.9

    1Membership Value

    >

    +

  • Fuzzy Logic and Applications in GIS

    Wolfgang Kainz 9

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 25

    trapezoidala

    b c

    dtriangulara d

    b=c

    S-shapeda

    b=c=d

    L-shaped

    a=b=c

    d

    Shapes of membership functions

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 26

    2

    2( )

    2( )x c

    A x e

    =

    -20 -10 0 10 20

    0.10.20.30.40.50.60.70.80.9

    1Membership Value

    Uc

    2

    Gaussian membership function

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 27

    Assignment 1List five phenomena in your work environment that can better be described as fuzzy sets than with a crisp classification.

  • Fuzzy Logic and Applications in GIS

    Wolfgang Kainz 10

    Operations on Fuzzy Sets

    Support, HeightEquality, InclusionUnion, IntersectionComplement

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 29

    Support of a fuzzy setThe support of a fuzzy set is the set of all elements of the universe that have a membership degree greater than 0.

    supp( ) { | ( ) 0}AA x X x= >

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 30

    Core of a fuzzy setThe core of a fuzzy set is the set of all elements of the universe that have a membership degree equal to 1.

    core( ) { | ( ) 1}AA x X x= =

  • Fuzzy Logic and Applications in GIS

    Wolfgang Kainz 11

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 31

    Height of a fuzzy setThe height of a fuzzy set A, hgt(A), is the largest membership degree in A.

    If the height is 1 then the fuzzy set is called normal.

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 32

    Equality of fuzzy setsTwo fuzzy sets A and B are said to be equal (written as A = B) iff

    ).()(, xxXx BA =

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 33

    Inclusion of fuzzy setsThe inclusion of fuzzy set A in B is defined as )()( iff , xxBAXx BA

    20 10 0 10 20

    0.1

    0.2

    0.3

    0.4

    0.5

    0.6

    0.7

    0.8

    0.9

    1Membership Value

    A

    B

  • Fuzzy Logic and Applications in GIS

    Wolfgang Kainz 12

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 34

    Fuzzy set theoretic operations: UnionThe union of two fuzzy sets is defined as one of the following operators:

    , ( ) max( ( ), ( )), ( ) ( ) ( ) ( ) ( ), ( ) min(1, ( ) ( ))

    A B A B

    A B A B A B

    A B A B

    x X x x xx X x x x x xx X x x x

    = = + = +

    where AB is the membership function of AB.

    (2)(3)

    (1)

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 35

    120 140 160 180 200 220

    0.1

    0.2

    0.3

    0.4

    0.5

    0.6

    0.7

    0.8

    0.9

    1Type 1

    120 140 160 180 200 220

    0.1

    0.2

    0.3

    0.4

    0.5

    0.6

    0.7

    0.8

    0.9

    1Type 2

    120 140 160 180 200 220

    0.1

    0.2

    0.3

    0.4

    0.5

    0.6

    0.7

    0.8

    0.9

    1Type 3

    short average

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 36

    Fuzzy set theoretic operations: IntersectionThe intersection of two fuzzy sets is defined as one of the following operators:

    , ( ) min( ( ), ( )), ( ) ( ) ( ), ( ) max(0, ( ) ( ) 1)

    A B A B

    A B A B

    A B A B

    x X x x xx X x x xx X x x x

    = = = +

    where AB is the membership function of AB.

    (2)(3)

    (1)

  • Fuzzy Logic and Applications in GIS

    Wolfgang Kainz 13

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 37

    120 140 160 180 200 220

    0.1

    0.2

    0.3

    0.4

    0.5

    0.6

    0.7

    0.8

    0.9

    1Type 1

    120 140 160 180 200 220

    0.1

    0.2

    0.3

    0.4

    0.5

    0.6

    0.7

    0.8

    0.9

    1Type 2

    120 140 160 180 200 220

    0.1

    0.2

    0.3

    0.4

    0.5

    0.6

    0.7

    0.8

    0.9

    1Type 3

    short average

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 38

    Fuzzy set theoretic operations: ComplementThe complement of a fuzzy set A is defined as

    )(1)(, xxXx AA =

    where A is the membership function of A.

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 39

    120 140 160 180 200 220

    0.1

    0.2

    0.3

    0.4

    0.5

    0.6

    0.7

    0.8

    0.9

    1Average

    120 140 160 180 200 220

    0.10.2

    0.30.4

    0.5

    0.60.7

    0.80.9

    1Complement of Average

  • Fuzzy Logic and Applications in GIS

    Wolfgang Kainz 14

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 40

    Properties valid for both fuzzy and crisp sets

    ,A A A A A A = =Idempotent law

    ,A B B A A B B A = = Commutative law( ) ( )( ) ( )

    A B C A B CA B C A B C = =

    Associative law

    ( ) ( ) ( )( ) ( ) ( )

    A B C A B A CA B C A B A C = =

    Distributive law

    A A=Double negation

    A B A BA B A B =

    = De Morgan's law

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 41

    Properties in general valid only for crisp sets

    Law of the excluded middle A A X =

    Law of contradiction A A =

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 42

    220120 140 160 180 200

    0.1

    0.2

    0.3

    0.4

    0.5

    0.6

    0.7

    0.8

    0.9

    1

    120 140 160 180 200 220

    0.1

    0.2

    0.3

    0.4

    0.5

    0.6

    0.7

    0.8

    0.9

    1A A A A

    A = average

  • Fuzzy Logic and Applications in GIS

    Wolfgang Kainz 15

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 43

    Assignment 2Can you give an explanation why the Min / Max operators for intersection / union are called non-interactive, whereas the alternative operators using the product and sum are called interactive?

    -Cuts

    -level sets

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 45

    -Cuts (or -level sets)

    The (weak) -cut A (with (0,1]) of a fuzzy set A is defined as

    })(|{ = xXxA A

    A strong -cut is defined as

    })(|{ >= xXxA A

  • Fuzzy Logic and Applications in GIS

    Wolfgang Kainz 16

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 46

    5 7 9 11 13 15 17 19 21 23 25U

    0.2

    0.4

    0.6

    0.8

    1Membership Grade

    Example

    A0.6

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 47

    -cuts (or -level sets)An -cut is the set of all elements of the universe that typically belong to a fuzzy set.With -cuts we can decompose a membership function into an infinite number of rectangular membership functions (decomposition principle).

    Fuzzy Relations

    Binary fuzzy relations

  • Fuzzy Logic and Applications in GIS

    Wolfgang Kainz 17

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 49

    Binary fuzzy relations:Continuous expression

    A binary fuzzy relation R between sets X and Y is defined as

    = YX R yxyxR ),/(),(where R is the membership function of R as

    ]1,0[: YXR

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 50

    Binary fuzzy relations:Discrete expression

    A binary fuzzy relation R between sets X = {x1,,xn} and Y = {y1,,ym} is denoted as a fuzzy matrix

    =

    ),(),(

    ),(),(

    1

    111

    mnRnR

    mRR

    yxyx

    yxyxR

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 51

    Binary Fuzzy Relations: Example

    X = {Vienna, Graz, Salzburg}Y = {Bratislava, Budapest, Ljubljana}Fuzzy relation: close

    Bratislava Budapest LjubljanaVienna 0.9 0.6 0.5Graz 0.7 0.5 0.6

    Salzburg 0.5 0.4 0.5

  • Fuzzy Logic and Applications in GIS

    Wolfgang Kainz 18

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 52

    Binary Fuzzy Relations: Example

    Vienna

    Graz

    SalzburgBratislava

    Budapest

    Ljubljana

    00.20.40.60.81

    Grade

    Linguistic Variables and Hedges

    OperatorsHedges

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 54

    Linguistic variableA linguistic variable is a variable that assumes linguistic values (linguisticterms).

    ExampleVariable: heightValues: short, average, tall

  • Fuzzy Logic and Applications in GIS

    Wolfgang Kainz 19

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 55

    HedgesA hedge h functions as modifier of a meaning of a term x, thus resulting in a composite term hx, e.g., very steep.Examples for hedges are very, sort of, slightly, etc.They are implemented with operators on fuzzy sets.

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 56

    Operators as a basis for hedges

    =

    =

    =

    =

    otherwise))(1(21]5.0,0[)( for)(2)(:ationintensificcontrast

    )()(:dilation

    )()(:ionconcentrat

    )(hgt)()(:ionnormalizat

    2

    2

    )(int

    )(dil

    2)(con

    )(norm

    xxxx

    xx

    xx

    xx

    A

    AAA

    AA

    AA

    A

    AA

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 57

    Models of hedgesvery A = con(A)

    more or less A(fairly A)

    = dil(A)

    plus A = A 1.25

    slightly A = int[norm(plus A andnot (very A))]

  • Fuzzy Logic and Applications in GIS

    Wolfgang Kainz 20

    Fuzzy Boundaries

    Map unit approachIndividual approach

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 59

    Fuzzy polygon boundariesMap unit approach

    All boundaries in the data set are assumed to be equally fuzzy

    Individual boundary approachFuzziness determined for each feature class

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 60

    Fuzzy polygon boundaries (in raster representation)

    Extract the boundaries (e.g., with an edge filter)Use a spread function to compute the zones around the boundariesThe membership function has the cross over point at the original boundary

  • Fuzzy Logic and Applications in GIS

    Wolfgang Kainz 21

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 61

    Fuzzy boundariesBoundary

    (membership degree = 0.5)Boundary width

    Inside(membership between 1 and 0.5)Outside

    (membership between 0.5 and 0)

    Well inside

    Well outside

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 62

    Polygon with fuzzy boundary

    1.0 0.5

    0.0

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 63

    Assignment 3How would you measure (determine) the width of a boundary in practice? Give examples for different phenomena (e.g., parcels, land use units, soil types,)?

  • Fuzzy Logic and Applications in GIS

    Wolfgang Kainz 22

    Fuzzy Reasoning

    Direct methodSimplified method

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 65

    Fuzzy Reasoning: Rules of inference

    In binary logic reasoning is based on Deduction (modus ponens)

    Premise 1: If x is A then y is B Premise 2: x is A Conclusion: y is B

    Induction (moduls tollens) Premise 1: If x is A then y is B Premise 2: y is not B Conclusion: x is not A

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 66

    Fuzzy Reasoning: Rules of inference

    ExampleDeduction (modus ponens)

    Premise 1: If it rains then I get wet Premise 2: It rains Conclusion: I get wet

    Induction (moduls tollens) Premise 1: If it rains then I get wet Premise 2: I do not get wet Conclusion: It does not rain

  • Fuzzy Logic and Applications in GIS

    Wolfgang Kainz 23

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 67

    Fuzzy Reasoning: generalized modus ponens

    Premise 1: If x is A then y is BPremise 2: x is A'Conclusion: y is B'

    A, B, A', and B' are fuzzy sets where A'and B' are not exactly the same as Aand B.

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 68

    Fuzzy Reasoning: generalized modus ponens (example)Premise 1: If temperature is low then set the

    heater to highPremise 2: Temperature is very lowConclusion: Set the heater to very high

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 69

    Fuzzy ReasoningDirect methods

    Mamdanis Direct MethodTagaki & Sugenos Fuzzy ModelingSimplified Method

    Indirect MethodNot discussed here

  • Fuzzy Logic and Applications in GIS

    Wolfgang Kainz 24

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 70

    Mamdanis Direct Method:Inference Rule

    If x is A and y is B then z is C

    where A, B, and C are fuzzy sets,x and y are premise variables,z is the consequence variable

    premise consequence

    fuzzy set

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 71

    Mamdanis Direct Method:Inference Rule Example

    set the air conditioner setting to highthen

    humidity is fairly highand

    room temperature is highIf

    where the room temperature is measured in degreesCentigrade, the humidity in percent, and the air conditioner setting range from 1 to 10

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 72

    Tagaki & Sugenos Fuzzy Modeling:Inference Rule

    If x is A and y is B then z = ax+by+c

    where A and B are fuzzy sets, x and y are premise variables, z = ax+by+c is the consequence part linear equation with the consequence part parameters a, b and c

    premise consequence

    linear function

  • Fuzzy Logic and Applications in GIS

    Wolfgang Kainz 25

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 73

    Tagaki & Sugenos Fuzzy Modeling: Inference Rule Example

    set the air conditioner setting to room temperature x 0.2 + humidity x 0.05then

    humidity is fairly highand

    room temperature is highIf

    where the room temperature is measured in degreesCentigrade, the humidity in percent, and the air conditioner setting range from 1 to 10

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 74

    Simplified Method:Inference Rule

    If x is A and y is B then z = c

    where A and B are fuzzy sets, x and y are premise variables, c is the consequence, a real value (fuzzy singleton)

    premise consequence

    fuzzy singleton

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 75

    Simplified Method :Inference Rule Example

    set the air conditioner setting to 9then

    humidity is fairly highand

    room temperature is highIf

    where the room temperature is measured in degreesCentigrade, the humidity in percent, and the air conditioner setting range from 1 to 10

  • Fuzzy Logic and Applications in GIS

    Wolfgang Kainz 26

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 76

    Generalized modus ponens with two premise variables

    1 1 1

    2 2 2

    1

    1

    If is and is then is If is and is then is

    :

    If is then is then is : is , is : z is

    n n n

    x A y B z Cx A y B z C

    p q

    x A y B z Cp x A y Bq C

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 77

    1. Apply the input values to the premise variables for every rule andcompute the minimum of 0( )iA x and 0( )iB y :

    1 1

    2 2

    1 1 0 0

    2 2 0 0

    n 0 0

    Rule : min( ( ), ( ))Rule : min( ( ), ( ))

    Rule : min( ( ), ( ))n n

    A B

    A B

    n A B

    m x ym x y

    m x y

    =

    =

    =

    2. Cut the membership function of the consequence ( )iC

    z at im :

    1 1

    2 2

    1 1 1

    2 2 2

    n

    Conclusion of rule : ( ) min( , ( ))Conclusion of rule : ( ) min( , ( ))

    Conclusion of rule : ( ) min( , ( ))n n

    C C

    C C

    C n C n

    z m z z Cz m z z C

    z m z z C

    =

    =

    =

    3. Compute the final conclusion by determining the union of allindividual conclusions from step 2:

    1 2( ) max( ( ), ( ), , ( ))

    nC C C Cz z z z =

    Mam

    dani

    Mam

    dani

    ssD

    irec

    t M

    etho

    dD

    irec

    t M

    etho

    d

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 78

    To derive a single value from the fuzzy set of the conclusion we defuzzify it by the center of area method.

    0

    ( )( )

    C

    C

    z zz

    z

    =

    Mam

    dani

    Mam

    dani

    ssD

    irec

    t M

    etho

    dD

    irec

    t M

    etho

    d

  • Fuzzy Logic and Applications in GIS

    Wolfgang Kainz 27

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 79

    Example

    If distance between cars is long and speed is high then maintain speed

    Rule 4

    If distance between cars is long and speed is low then increase speed

    Rule 3

    If distance between cars is short and speed is high then reduce speed

    Rule 2

    If distance between cars is short and speed is low then maintain speed

    Rule 1

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 80

    Distance between cars

    0 10 20 30 40m

    0.2

    0.4

    0.6

    0.8

    1Membership

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 81

    Speed

    0 20 40 60 80 100kmh

    0.2

    0.4

    0.6

    0.8

    1Membership

  • Fuzzy Logic and Applications in GIS

    Wolfgang Kainz 28

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 82

    Acceleration

    - 20 - 10 0 10 20kmh2

    0.2

    0.4

    0.6

    0.8

    1Membership

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 83

    Step 1: distance = 15, speed = 60

    0.250.750.254

    0.250.250.253

    0.750.750.752

    0.250.250.751

    MinHighLowLongShortRule

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 84

    - 10 0 10 20U

    - 20

    0.2

    0.4

    0.6

    0.8

    1Rule 1 Rule 2

    - 20 - 10 0 10 20U

    0.2

    0.4

    0.6

    0.8

    1

    Rule 3

    - 20 - 10 0 10 20U

    0.2

    0.4

    0.6

    0.8

    1Rule 4

    - 10 0 10 20U

    - 20

    0.2

    0.4

    0.6

    0.8

    1

    Step 2: distance = 15, speed = 60

  • Fuzzy Logic and Applications in GIS

    Wolfgang Kainz 29

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 85

    - 10 0 10 20U

    - 20

    0.2

    0.4

    0.6

    0.8

    1Rule 1 Rule 2

    - 20 - 10 0 10 20U

    0.2

    0.4

    0.6

    0.8

    1

    Rule 3

    - 20 - 10 0 10 20U

    0.2

    0.4

    0.6

    0.8

    1Rule 4

    - 10 0 10 20U

    - 20

    0.2

    0.4

    0.6

    0.8

    1

    Step 2: distance = 15, speed = 60

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 86

    - 10 0 10 20U

    - 20

    0.2

    0.4

    0.6

    0.8

    1

    Step 3: distance = 15, speed = 60

    20 10 0 10 20U

    0.2

    0.4

    0.6

    0.8

    1

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 87

    Defuzzification

    Reduce speed a little

    20 10 0 10 20U

    0.2

    0.4

    0.6

    0.8

    1Membership Grade

    Center of area is -5.45833

  • Fuzzy Logic and Applications in GIS

    Wolfgang Kainz 30

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 88

    1. Apply the input values to the premise variables for every rule and compute the minimum of 0( )iA x and 0( )iB y :

    1 1

    2 2

    1 1 0 0

    2 2 0 0

    n 0 0

    Rule : min( ( ), ( ))Rule : min( ( ), ( ))

    Rule : min( ( ), ( ))n n

    A B

    A B

    n A B

    m x ym x y

    m x y

    =

    =

    =

    2. Compute the conclusion value per rule as: 1 1 1 1

    2 2 2 2

    n

    Conclusion of rule :Conclusion of rule :

    Conclusion of rule : n n n

    c m cc m c

    c m c

    = =

    =

    3. Compute the final conclusion as:

    1

    1

    nii

    nii

    cc

    m=

    =

    =

    Sim

    plif

    ied

    Met

    hod

    Sim

    plif

    ied

    Met

    hod

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 89

    Example

    If slope is steep and aspect is unfavorable then risk is 4

    Rule 4

    If slope is flat and aspect is unfavorable then risk is 1

    Rule 3

    If slope is steep and aspect is favorable then risk is 2

    Rule 2

    If slope is flat and aspect is favorable then risk is 1

    Rule 1

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 90

    Example: slope

    0 10 20 30 40Percent

    0.2

    0.4

    0.6

    0.8

    1Membership

    flat

    steep

  • Fuzzy Logic and Applications in GIS

    Wolfgang Kainz 31

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 92

    0 50 100 150 200 250 300 350Aspect

    0.2

    0.4

    0.6

    0.8

    1Membership

    favorable

    unfavorable

    Example: aspect

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 93

    Example:slope = 10, aspect = 180

    0000.2Rule4

    0000.5Rule3

    0.40.210.2Rule2

    0.50.510.5Rule1

    ConclusionMin(s,a)Aspect (a)

    Slope (s)

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 94

    Example: final conclusion

    0.5 0.4 0 0 1.290.5 0.2 0 0

    c + + + = =+ + +

  • Fuzzy Logic and Applications in GIS

    Wolfgang Kainz 32

    Fuzzy Example

    Fuzzy site analysisFuzzy reasoning

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 96

    Fuzzy Site AnalysisFind all areas with flat slope, favorable aspect and moderate elevation that are close to a water body, not near a major road and are not located in a park or military installation.

    Wolfgang Kainz Introduction to Fuzzy Logic and Applications in GIS 97

    Fuzzy Risk AnalysisDerive a risk map from the slope and aspect according to the following rules:

    If slope is steep and aspect is unfavorable then risk is 4

    Rule 4

    If slope is flat and aspect is unfavorable then risk is 1

    Rule 3

    If slope is steep and aspect is favorable then risk is 2

    Rule 2

    If slope is flat and aspect is favorable then risk is 1

    Rule 1