56
Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside, CA 92521 [email protected] ENGR 101

Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

Embed Size (px)

Citation preview

Page 1: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

Using Computers to Understand (and control) Insects

Eamonn KeoghComputer Science & Engineering Department

University of California - RiversideRiverside, CA [email protected]

ENGR 101

Page 2: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

Outline II want to convince you that..

• There is more to computer science than just programming

• Computer science/engineering is incredibly fun and interesting

• Computer science/engineering can be your passport to work anywhere, do anything

Page 3: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

Outline IIRough outline

• The Machine Learning Problem (AI)• Machine Learning applied to Malaria/Mosquitoes

Please interrupt me at any time with questions

Page 4: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

I am going to show you some problems that were shown to pigeons!

Let us see if you are as smart as a pigeon!

I am going to show you some problems that were shown to pigeons!

Let us see if you are as smart as a pigeon!

Page 5: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

Examples of class A

3 4

1.5 5

6 8

2.5 5

Examples of class B

5 2.5

5 2

8 3

4.5 3

Pigeon Problem 1

Page 6: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

Examples of class A

3 4

1.5 5

6 8

2.5 5

Examples of class B

5 2.5

5 2

8 3

4.5 3

8 1.5

4.5 7

What class is this object?

What class is this object?

What about this one, A or B?

What about this one, A or B?

Pigeon Problem 1

Page 7: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

Examples of class A

3 4

1.5 5

6 8

2.5 5

Examples of class B

5 2.5

5 2

8 3

4.5 3

8 1.5

This is a B!This is a B!Pigeon Problem 1

Here is the rule.If the left bar is smaller than the right bar, it is an A, otherwise it is a B.

Here is the rule.If the left bar is smaller than the right bar, it is an A, otherwise it is a B.

Page 8: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

Examples of class A

4 4

5 5

6 6

3 3

Examples of class B

5 2.5

2 5

5 3

2.5 3

8 1.5

7 7

Even I know this oneEven I know this one

Pigeon Problem 2 Oh! This ones hard!

Oh! This ones hard!

Page 9: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

Examples of class A

4 4

5 5

6 6

3 3

Examples of class B

5 2.5

2 5

5 3

2.5 3

7 7

Pigeon Problem 2

So this one is an A.So this one is an A.

The rule is as follows, if the two bars are equal sizes, it is an A. Otherwise it is a B.

The rule is as follows, if the two bars are equal sizes, it is an A. Otherwise it is a B.

Page 10: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

Examples of class A

4 4

1 5

6 3

3 7

Examples of class B

5 6

7 5

4 8

7 7

6 6

Pigeon Problem 3

This one is really hard!What is this, A or B?

This one is really hard!What is this, A or B?

Page 11: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

Examples of class A

4 4

1 5

6 3

3 7

Examples of class B

5 6

7 5

4 8

7 7

6 6

Pigeon Problem 3 It is a B!It is a B!

The rule is as follows, if the square of the sum of the two bars is less than or equal to 100, it is an A. Otherwise it is a B.

The rule is as follows, if the square of the sum of the two bars is less than or equal to 100, it is an A. Otherwise it is a B.

Page 12: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

Worst game ever!

Why did we spend so much time with this game?

Worst game ever!

Why did we spend so much time with this game?

This game is an example of a classification problem, one of the most fundamental problems in Artificial Intelligence

This game is an example of a classification problem, one of the most fundamental problems in Artificial Intelligence

Page 13: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

Examples of class AJapanese Names

Examples of class BGreek Names

Pigeon Problem XWhat kind of name is this:Japanese or Greek?

What kind of name is this:Japanese or Greek?AYANO

CHIKAKO

CHIYO

CHIYOKO

CHO CHOU

ETSUKO

ABDERUS

CHIYSES

CHARYBDIS

CEPHALUS

CALCHAS CADMUS

Page 14: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

Examples of class A

Alan Turing

Examples of class B

Stan Laurel

Pigeon Problem YWho is this?Who is this?

Page 15: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

Examples of class A

Loop

Examples of class B

Arch

Pigeon Problem ZWhat kind of fingerprint is this?

What kind of fingerprint is this?

Page 16: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

Grasshoppers

KatydidsThe Classification Problem(informal definition)

Given a collection of annotated data.

(In this case five instances Katydids of and five of Grasshoppers)

Decide which class future unlabeled data belongs to.

Katydid or Grasshopper?

Page 17: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

Solving the Classification Problem

How do human and other animals solve the classification problem? (for today, we don’t care)

How can we make computers solve the classification problem? This is called machine learning

The first step is a change of representation, a classic computer science trick

Page 18: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

Examples of class A

3 4

1.5 5

6 8

2.5 5

Examples of class B

5 2.5

5 2

8 3

4.5 3

Pigeon Problem 1

We can plot the pigeon problems in 2D space

We can plot the pigeon problems in 2D space

Left

Bar

10

1 2 3 4 5 6 7 8 9 10

123456789

Right Bar

Page 19: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

Examples of class A

4 4

5 5

6 6

3 3

Examples of class B

5 2.5

2 5

5 3

2.5 3

Pigeon Problem 2

Left

Bar

10

1 2 3 4 5 6 7 8 9 10

123456789

Right Bar

Let me look it up… here it is.. the rule is, if the two bars are equal sizes, it is an A. Otherwise it is a B.

Let me look it up… here it is.. the rule is, if the two bars are equal sizes, it is an A. Otherwise it is a B.

Page 20: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

Examples of class A

4 4

1 5

6 3

3 7

Examples of class B

5 6

7 5

4 8

7 7

Pigeon Problem 3

Left

Bar

100

10 20 30 40 50 60 70 80 90 100

102030405060708090

Right Bar

The rule again:if the square of the sum of the two bars is less than or equal to 100, it is an A. Otherwise it is a B.

The rule again:if the square of the sum of the two bars is less than or equal to 100, it is an A. Otherwise it is a B.

Page 21: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

Ante

nna

Len

gth

10

1 2 3 4 5 6 7 8 9 10

123456789

Grasshoppers Katydids

Abdomen Length

Page 22: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

Simple Linear Classifier

If previously unseen instance above the linethen class is Katydidelse class is Grasshopper

KatydidsGrasshoppers

R.A. Fisher1890-1962

10

1 2 3 4 5 6 7 8 9 10

123456789

Page 23: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

10

1 2 3 4 5 6 7 8 9 10

123456789

100

10 20 30 40 50 60 70 80 90 100

102030405060708090

10

1 2 3 4 5 6 7 8 9 10

123456789

Which of the “Pigeon Problems” can be solved by the Simple Linear Classifier?

1) Perfect2) Useless3) Pretty Good

Problems that can be solved by a linear classifier are called linearly separable.

Page 24: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

Now that we understand what the classification problem is, and one way to solve it, let us switch gears for a while…

Page 25: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

What is the Deadliest Animal?(not counting humans!)

Page 26: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

What is the Deadliest Animal?

500+ per year

200+ per year10+ per year

300+ per year

1,000,000+ per year

50,000+ per year

Page 27: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

What is the Deadliest Animal?

50,000+ per year500+ per year

200+ per year10+ per year

300+ per year

1,000,000+ per year

Page 28: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

One penny weights about the same as one thousand mosquitoes

How can something so small be so deadly?

Page 29: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

What is Malaria?• Malaria is a disease that involves high

fevers, shaking chills, joint pain, flu-like symptoms. In some cases it can produce coma and death.

• There are more than 225 million cases of malaria each year, killing around 1-million people.

Page 30: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

Where does Malaria come from?

Malaria has been known since ancient times.

Many believed it came from “bad air” (Italian: mala aria, “bad air”)

500 years ago, a handful of people believed that insects might be involved in human diseases.

Hortus Sanitatis

(The Garden of Health) 1497

Page 31: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

It was Sir Ronald Ross, an British army surgeon working in India, who proved in 1897 that malaria is transmitted by mosquitoes.

Sir Ronald Ross received the 1902 Nobel Prize for Physiology or Medicine for his work

(This was somewhat controversial, as many others made similar discoveries around the same time )

Page 32: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

Malaria Parasites

1st Vector

Initial Human host Liver

infection

Blood infection

2nd Vector

Next Human host

Malaria Transmission Cycle

Page 33: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

We get malaria from mosquitoes

We get malaria from

humans

Page 34: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

• There are 3,528 kinds of mosquitoes• Only a handful of species take human blood• Only the females take human blood

• There are 100 trillion mosquitoes alive today

• Mosquitoes have been around for 100 million years

• We know this from fossil records/DNA studies

• Mosquitoes have spread malaria for at least 35 million years• We know this from insects found in amber

The Mosquito

Page 35: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,
Page 36: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

Where does malaria cause problems?

Page 37: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

www.worldmapper.org

Page 38: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

Given that we have known for over one hundred years how Malaria is spread, where is the magic pill or immunization?

For a variety of reasons, a cure or immunization continues to alluded mankind.

However there are some interventions that can help

In the 20th century, smallpox killed 400 million people worldwide, it is now eradicated.

Polio is almost eradicated.

Page 39: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

Interventions to Mitigate Malaria • The use of insecticidal treated mosquito nets• Spraying of insecticides (including controversial chemicals such as DDT)• Introduction of fish/turtles/crustaceans to eat mosquito larva• The introduction of dragonflies which eat adult mosquitoes. • Habitat reduction by draining ponds and pools• Use of chemical films to reduce the surface tension of water

(drowning the pupa).• .. and hundreds more proven or tentative ideas

Page 40: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

Interventions Cost Money!

• Even cheap solutions have hidden costs• Insecticidal treated mosquito nets are cheap to

make, but…

• To make mosquito nets work, you need educators, incentive programs, maintenance etc

“...aid agencies and non-governmental organizations are quietly grappling with a problem: Data suggest that nearly half of Africans who have access to the nets refuse to sleep under them” (LA Times May-2-2010).

Page 41: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

• We need to know where/when the problem is the greatest. Where are the insects? Which insects are they? When did they arrive?

• The classic solution? Use sticky traps– Inaccurate– Costly– Long time lag

Planning interventions requires knowledge

Page 42: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

My Work at UCR

• I believe that we can count and classify insects with sensors. The classification problem– Must be cheap– Must be low powered – Must be accurate

Page 43: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5x 104-0.2

-0.1

0

0.1

0.2

One second of audio from our sensor. The Common Eastern Bumble Bee (Bombus impatiens) takes about one tenth of a second to pass the laser.

Background noise Bee begins to cross laser Bee has past though the laser

UCR Wingbeat Sensor

Page 44: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

10

1 2 3 4 5 6 7 8 9 10

123456789

Bees

Mosquitos

0 0.5 1 1.5

0 0.5 1 1.5

0 0.5 1 1.5

0 0.5 1 1.5

0 0.5 1 1.5

0 0.5 1 1.5

Page 45: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

10

1 2 3 4 5 6 7 8 9 10

123456789

Bees

Mosquitos

Page 46: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

10

1 2 3 4 5 6 7 8 9 10

123456789

Bees

Mosquitos

0 0.5 1 1.5 2

Page 47: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

17Bee count

21Mosquito count

2134Housefly count

Page 48: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

17Bee count

21Mosquito count

2134Housefly count

Spay the dark red areas at dusk

TimeStamp 12:23:23Probability of: Bee - 0.96Probability of: Housefly - 0.03Probability of: Other - 0.01TimeStamp 12:27:11Probability of: Bee - 0.99:::

Page 49: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

Using Pesticides Intelligently

If we are not sure where the insects are…

If we know where the insects are…

High cost (fuel/pesticide)Damage to environment

Low costLittle damage to environment

Page 50: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

You won 10000KCongratulations! You won the Nigerian lottery!Please send me your name and more than four hours!

Upcoming dentist appDear EamonnDon’t forget your dentist appoint Many thanks, joe

here's we hue opposings and ents thers that fled of the undispriz'd coward to sufferLose Weight Now!

here's we hue opposings and ents thers that fled of the undispriz'd coward to suffer

Make money fast!here's we hue opposings and ents thers that fled of the undispriz'd coward to suffer

Upcoming dentist appDear EamonnDon’t forget your dentist appoint next Wednesday the 17

Upcoming dentist appDear EamonnDon’t forget your dentist appoint next Wednesday the 17

You won 10000KCongratulations! You won the Nigerian lottery!Please send me your name and address

Spam Filter

Spam Folder Email Folder

The holy grail of computational

entomology

With a single click of a button, we can take action on our emails/spam.

We can delete, forward, save them etc

Page 51: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

17Bee count

21Mosquito count

2134Housefly count

Can we do this with insects?

Can we “delete” mosquitoes(Kill them)

Can we “forward” bees(Make them go North and pollinate almonds etc)

The holy grail of computational

entomology

Page 52: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

Controlling Insects with Computers

Insect cyborgs are cool, but not the answer.

We need to be able to control insects at a cost of say 1,000,000 insects per penny.

Page 53: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

Controlling Insects with Computers

We already control some insects with technology/computers

We are exploiting the fact that moths evolved without artificial lights.

What else can we exploit?

Page 54: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

What else can we exploit?

Page 55: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

Now we..

• understand what the classification problem is

• have seen how to solve it with the linear classifier

• have seen how it can be applied to a real problem

Page 56: Using Computers to Understand (and control) Insects Eamonn Keogh Computer Science & Engineering Department University of California - Riverside Riverside,

I hope I have convinced you that

• There is more to computer science than just programming

• Computer science/engineering is incredibly fun and interesting

• Computer science/engineering can be your passport to work anywhere, do anything

Eamonn KeoghComputer Science & Engineering Department

University of California - RiversideRiverside, CA [email protected]