Hurricane Prediction with Python - SciPy · Python provides efficient packages useful for hurricane...

21
1 Hurricane Prediction with Python Minwoo Lee [email protected] Computer Science Department Colorado State University

Transcript of Hurricane Prediction with Python - SciPy · Python provides efficient packages useful for hurricane...

Page 1: Hurricane Prediction with Python - SciPy · Python provides efficient packages useful for hurricane prediction prototyping. Discovery of possibility of applying linear model can simplify

1

Hurricane Predictionwith Python

Minwoo [email protected]

Computer Science DepartmentColorado State University

Page 2: Hurricane Prediction with Python - SciPy · Python provides efficient packages useful for hurricane prediction prototyping. Discovery of possibility of applying linear model can simplify

2

Hurricane Prediction Hurricane Katrina

“We lost everything. Katrinadidn’t care if you are poor orrich; all the houses look thesame now.”

Mississippi residentPenny Dean (People magazine)

Death toll: 1836 Cost: over 200 billion dollars

(Paul Solanki. Hurricane Katrina: Facts and Information. Buzzle.com)

Manual hurricane prediction is cumbersome. This presentation describes the prototype solution to

automate the process of hurricane prediction usingPython.

Page 3: Hurricane Prediction with Python - SciPy · Python provides efficient packages useful for hurricane prediction prototyping. Discovery of possibility of applying linear model can simplify

3

Hurricane Detection

NOAA Hurricane Detection Buoy

Automated Surface Observing Systems

Reconnaissance aircrafts

Hurricane Satellite Image

Doppler Radar Image

Page 4: Hurricane Prediction with Python - SciPy · Python provides efficient packages useful for hurricane prediction prototyping. Discovery of possibility of applying linear model can simplify

4

What’s wrong with hurricaneprediction?

Large amount of data Long time to predict a hurricane Cumbersome process for human

Hurricane path prediction is not accurate enough

Need automatic process for early detectionand prediction

Page 5: Hurricane Prediction with Python - SciPy · Python provides efficient packages useful for hurricane prediction prototyping. Discovery of possibility of applying linear model can simplify

5

Global Forecast System (GFS) Global spectral model Aviation weather forecast Forecast

Wind speed and direction Temperature Humidity Precipitation Out to 192 hour Every 6 hour

Page 6: Hurricane Prediction with Python - SciPy · Python provides efficient packages useful for hurricane prediction prototyping. Discovery of possibility of applying linear model can simplify

6

Page 7: Hurricane Prediction with Python - SciPy · Python provides efficient packages useful for hurricane prediction prototyping. Discovery of possibility of applying linear model can simplify

7

Hurricane Prediction UsingGFS data

Page 8: Hurricane Prediction with Python - SciPy · Python provides efficient packages useful for hurricane prediction prototyping. Discovery of possibility of applying linear model can simplify

8

Data Preprocessing

Low resolution GFS Analysis 2 degrees of longitude and

latitude interval 100 hPa ~ 1000 hPa Recorded every 6 hours 8 features

Preprocessing Combine 4 grid cell corners at 11

heights Concatenate into a vector

Page 9: Hurricane Prediction with Python - SciPy · Python provides efficient packages useful for hurricane prediction prototyping. Discovery of possibility of applying linear model can simplify

9

Analysis of GFS Data

Eye observation of data shows the cleardistinction between hurricane and non-hurricane locations.

Page 10: Hurricane Prediction with Python - SciPy · Python provides efficient packages useful for hurricane prediction prototyping. Discovery of possibility of applying linear model can simplify

10

Python for Data Preprocessingand Analysis

Numpy Basic data structure for matrix representation and

operation Tools for reading and storing files, linear algebra,

and matrix manipulation Matplotlib

Plot for the eye observation of data Helpful for choosing machine learning algorithm

Page 11: Hurricane Prediction with Python - SciPy · Python provides efficient packages useful for hurricane prediction prototyping. Discovery of possibility of applying linear model can simplify

11

Support Vector Machines

Popular statisticalmethod forclassification,regression, and noveltydetection

Searching for thehyperplane thatseparates the data intotwo classes withmaximum margin

Page 12: Hurricane Prediction with Python - SciPy · Python provides efficient packages useful for hurricane prediction prototyping. Discovery of possibility of applying linear model can simplify

12

PyML for Classification

Machine learning library Focuses on SVM and kernel methods Written by Dr. Asa Ben-Hur in CSU

For classification training and prediction,convert Numpy array to VectorDataSet inPyML

Linear kernel is enough for the GFS data

Page 13: Hurricane Prediction with Python - SciPy · Python provides efficient packages useful for hurricane prediction prototyping. Discovery of possibility of applying linear model can simplify

13

Linear Kernel for GFS data

With linear kernel,the data is clearlyseparable

Page 14: Hurricane Prediction with Python - SciPy · Python provides efficient packages useful for hurricane prediction prototyping. Discovery of possibility of applying linear model can simplify

14

Fast Prototyping with Python

PyGTK and Glade Glade-3

Rapid application development tool

Basemap Support plotting data over map projections

Page 15: Hurricane Prediction with Python - SciPy · Python provides efficient packages useful for hurricane prediction prototyping. Discovery of possibility of applying linear model can simplify

15

Glade-3

Page 16: Hurricane Prediction with Python - SciPy · Python provides efficient packages useful for hurricane prediction prototyping. Discovery of possibility of applying linear model can simplify

16

User Interface

Training source selection

Time period for training data

Sampling optionsand data conversion

Options for classifier

Train/store/load classifier

Predict hurricane w/ trained classifierDisplay options on the map

Page 17: Hurricane Prediction with Python - SciPy · Python provides efficient packages useful for hurricane prediction prototyping. Discovery of possibility of applying linear model can simplify

17

Data Conversion, Training, Testing, andDisplaying

gdtool.createMat(self.datapath, self.trackpath, key, key, store=finen, undersample=True, genkeyf=True)

Data conversion

data = pyml.VectorDataSet(filen,labelsColumn=0)self.clssfr = pyml.SVM()self.clssfr.train(data)

Training SVM

result = self.clssfr.test(ml.VectorDataSet(filen,labelsColumn=0))

Predicting hurricane with test data

self.map.plot(x,y,'ro', markersize=5*self.dispSize)self.map.tissot((grid[1]+grid[3])/2., (grid[0]+grid[2])/2.,

(grid[3]-grid[1])*self.dispSize/2., 100)

Projection of prediction results on Basemap

Page 18: Hurricane Prediction with Python - SciPy · Python provides efficient packages useful for hurricane prediction prototyping. Discovery of possibility of applying linear model can simplify

18

Results: Test Data Train

4 days of preprocessed data Entire globe atmospheric data July 1st ~ July 4th, 2008

Test August 29th, 2008 Decent classification result (>90% overall accuracy) with

linear kernel 0 false positive Most false negatives are neighboring locations of actual

hurricanes

Page 19: Hurricane Prediction with Python - SciPy · Python provides efficient packages useful for hurricane prediction prototyping. Discovery of possibility of applying linear model can simplify

19

Prediction Results

Actual hurricanesfrom track data

Predicted hurricanelocations

Page 20: Hurricane Prediction with Python - SciPy · Python provides efficient packages useful for hurricane prediction prototyping. Discovery of possibility of applying linear model can simplify

20

Conclusions Python provides efficient packages useful for

hurricane prediction prototyping. Discovery of possibility of applying linear model can

simplify the problem greatly. Usual complex feature extraction is not necessary.

Online classification of GFS data from cloud is afeasible next step. (PyCloud?) Early detection Incremental training of classifier for accuracy

Path prediction with regression model can beanother path for future research.

Page 21: Hurricane Prediction with Python - SciPy · Python provides efficient packages useful for hurricane prediction prototyping. Discovery of possibility of applying linear model can simplify

21

Acknowledgements

Dr. Mark DeMariaCooperative Institute for Research in theAtmosphere (CIRA)

Dr. Asa Ben-HurComputer Science Dept. Colorado State Univ.