programming for geographical information analysis: advanced skills

18
Programming for Geographical Information Analysis: Advanced Skills Online mini-lecture: Introduction to Fuzzy Logic Dr Andy Evans

Upload: kawena

Post on 07-Jan-2016

19 views

Category:

Documents


0 download

DESCRIPTION

Programming for Geographical Information Analysis: Advanced Skills. Online mini-lecture: Introduction to Fuzzy Logic Dr Andy Evans. How do our statements match the real world?. We’re assuming we know what words like “hunger” and “high” mean in “if hunger is high go to café”. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Programming for  Geographical Information Analysis: Advanced Skills

Programming for Geographical Information Analysis:

Advanced Skills

Online mini-lecture: Introduction to Fuzzy Logic

Dr Andy Evans

Page 2: Programming for  Geographical Information Analysis: Advanced Skills

How do our statements match the real world?

We’re assuming we know what words like “hunger” and “high” mean in “if hunger is high go to café”.

While we might be able to give a clear RDF definition of “hunger” it won’t ever match the real world. This may not matter if our rules replicate reality quantitatively.

However, to do this, we need to define and use “high”.For this, we need Fuzzy Sets and Fuzzy Logic.

Page 3: Programming for  Geographical Information Analysis: Advanced Skills

FuzzinessTraditional logic: true vs. falseTraditional empiricism: what exists or does not, what causes something, and what doesn’t.THESE ARE THE FOUNDATIONS OF SCIENCE.

However, since the early Greeks, people have found that the way we understand the world isn’t black and white.

The Sorites ParadoxIf I remove one sand grain from a pile, it’s still a pile, but if I carry on, it’s soon not a pile (well, go figure…).

Page 4: Programming for  Geographical Information Analysis: Advanced Skills

Reality is fuzzy

Language isn’t usually precise…How hot is “hot”? 30 degrees? 40 degrees?

Reality isn’t actually that precise…Most things, including us, are just continually renewing lumps of

geology! Where do we begin? Where do we end? Atoms aren’t distinct.Shrödinger’s poor old cat is both alive and dead.

Page 5: Programming for  Geographical Information Analysis: Advanced Skills

Fuzzy Sets and Logic

.

Fuzzy Sets let us say something is 90% “one thing” and 10% “another”, without being illogical.

Fuzzy Logic then lets us use this in rules:E.g. it’s 90% “right” to do something, so I’ll do it 90% - adding warm

water to a washing machine cycle, for example.

Page 6: Programming for  Geographical Information Analysis: Advanced Skills

The fuzzy rebellion

1923: “Bertie” Russell releases a paper on Vagueness.

How do we define objects that are partly in two normally mutually exclusive sets?

1937: Black defines Vague sets.

1965: Zadeh coins the daft name “Fuzzy” for a logic based on Vague set membership, instantly putting humourless scientist’s backs up.

1972: 1st practical demonstration Mamdani’s steam engine.

1981: 1st commercial applications using fuzzy logic to control systems.

1994: Japan exported $35 billion worth of fuzzy products.

Page 7: Programming for  Geographical Information Analysis: Advanced Skills

Scientists loved it so much…

“Fuzzy theory is wrong, wrong, and pernicious. What we need is more logical thinking, not less. The danger of fuzzy logic is that it will encourage the sort of imprecise thinking that has brought us so much trouble. Fuzzy logic is the cocaine of science.”

Prof William Kahan

Page 8: Programming for  Geographical Information Analysis: Advanced Skills

The advantages of Fuzzy Logic

Lets us use terms like “hot” in computers, integrating knowledge and machine learning.

A very simple approach to building computer models of geographical systems.

The model uses human language, so it’s reasonably understandable.

Page 9: Programming for  Geographical Information Analysis: Advanced Skills

Fuzzy SetsWe give things a degree of membership between 0 and 1 in several sets (to a combined total of 1). We then label these sets using human terms.Encapsulates terms with no consensus definition, but we might use surveys to define them.

AgeDegre

e o

f m

em

bers

hip

0

1

90

Young Middle Aged

Old0.5

50

Membershipfunction

38yr old = 10% Young + 90% Middle Aged

Page 10: Programming for  Geographical Information Analysis: Advanced Skills

Fuzzy Logic models

We give our variables membership functions, and express the variables as nouns (“length”, “temperature”) or adjectives (“long”, “hot”).

We can then build up linguistic equations (“IF length long, AND temperature hot, THEN openWindow”).

Page 11: Programming for  Geographical Information Analysis: Advanced Skills

How the models work

Inputs converted to degrees of membership of fuzzy sets.

Fuzzy rules applied to get new sets of members.

These sets are then converted back to real numbers.

Crisp data

FuzzifierMember 90% hot

10% cold

Fuzzy rulesIF 90% hot THEN 80% open

IF 10% cold THEN 20% closed

Fuzzy output set80% open, 20% closed

Defuzzifier

Crisp data

Page 12: Programming for  Geographical Information Analysis: Advanced Skills

A model to work out time by foot itchiness

Work out how bored you are (take a poll of happiness vs. foot itchiness)…

Foot itchiness

Degre

e o

f m

em

bers

hip

0

1

10

Happy Bored0.5

5

Membershipfunction

0.6 bored to tears + 0.4 happy as Larry

Page 13: Programming for  Geographical Information Analysis: Advanced Skills

Decide on rules

If BORED then LECTURE LONG.If HAPPY the LECTURE SHORT.

Make Fuzzy sets defining people’s notion of “Long” and “Short”

0

1

2

Short Long

hours

Page 14: Programming for  Geographical Information Analysis: Advanced Skills

Transfer the degrees to the output sets

Adjust the heights of the sets to e.g. 40% for short.Hours

Hours0

1

2

0.4

0.6

0

1

2

Short Long0.4 Happy

0.6 Bored

Page 15: Programming for  Geographical Information Analysis: Advanced Skills

Calculate the average

The average is usually taken as the gravitational centre of the sets combined.

0 2

0.4

0.6

We’re only half way through!

Page 16: Programming for  Geographical Information Analysis: Advanced Skills

Uses in geography

Spatial Interaction: modelling flows between regions. Can capture the following kind of rules..

If distance is SHORT then TRIPS are LOTS.If distance is MEDIUM then TRIPS are some.If distance is LONG then TRIPS are few.

GIS, remote sensing, land evaluation.Fuzzy viewsheds.Fuzzy GIS - expert system shell on an intelligent GIS.Classification of land cover (vegetation, soils) from satellite imagery.

Page 17: Programming for  Geographical Information Analysis: Advanced Skills

Uses in geographyPhysical Geography

Creation of climate classifications.Fuzzy models of infiltration.Flood forecasting.Modelling subglacial water systems.

DemographicsWhat is the typical behaviour of a group?Is everyone acting normally? Open to abuse – but think how it might catch murderous

extremists, for example. We simply must have it, or society will disintegrate and we’ll all be eating babies before you can say “police state”.

Page 18: Programming for  Geographical Information Analysis: Advanced Skills

Other stuff

It’s often helpful to get other AI techniques to generate the membership functions – e.g. Neural Nets and Genetic Algorithms.

It’s often useful to combine several AIs with Fuzzy Logic – e.g. you might have a Net for “low” river flows and another for “high” ones, and a Fuzzy Logic engine between combining the results.