Creating NOAA Storm Advisories With Tensorflow & RNNs

John Bencina
Data Insights
Published in
3 min readSep 7, 2017

The code below is a small project which uses LSTM cells in Tensorflow to build an RNN. This network is trained to generate hurricane & tropical storm advisories. The dataset originates from the National Hurricane Center’s archives from 2006 to 2016 found at http://ftp.nhc.noaa.gov/atcf/archive/.

You can find the both the code to download the data and the RNN code to train the network at my Github page here https://github.com/jbencina/analytics-projects/tree/master/hurricane-rnn

Recurrent Neural Networks (RNNs) work by taking a sequence of data and predicting the next value. In this project, I am taking a length of 45 characters (punctuation and new lines included) and training the network to predict the next character. Over multiple epochs, the network learns from a sequence of 45 characters to predict the next character over a probability distribution.

During prediction mode, an initial starting value is fed and the model keeps iterating over itself to predict the next most likely character. To add some variety to the prediction, a random choice of the top 2 or 3 most likely characters are chosen.

The NOAA advisories are pretty much written in the same format so this was easy to train and you end up with a pretty good result you can see below.

During initial training, you can see the network is not very good

ZCZC MIATCDAT1 ALLTUAN. .N
CCN EIIICTM LALTTLO LRIRURAO .910 0MPEH...2595 HMHN..I
N ARRMRE E SAFTRN INDDRRONNEEUN S SRRCECET TITCHLLEASOSEO
EDERNIOTOE TA TROEOTOSN. AOAOSS.
OHTI AERTDSSE EO OATERRARTEO I ITER O SAAA ELONAIO AR TUAIEENO T
OSAISRILIOIE DA EREIAISI. IASO UNU O TOAI ACSSCTO N SEIR ANCTHTS. NOANS AAAIA ANIHNERN TI HETAT RST AIE IAIA I RTRMA A ORNAOLAEC CN I CRR AIFE TSRRLOA ONS
But by the end of training, we have a pretty reasonable result.
ZCZC MIATCPAT2 ALL
TTAA00 KNHC DDHHMM
BULLETIN
TROPICAL STORM DEBBY ADVISORY NUMBER 4
NWS TPC/NATIONAL HURRICANE CENTER MIAMI FL AL122010
500 PM EDT SUN SEP 03 2010
...DANNY A LATE TROPICAL STORM WATCH FOUTH OF THE CENTRAL ATLANTIC...SUMMARY OF 1100 PM AST...0300 UTC...INFORMATION
------------------------------------------------
LOCATION...16.5N 66.3W
ABOUT 100 MI...200 KM S OF CHATUMAL MEXICO
MAXIMUM SUSTAINED WINDS...45 MPH...75 SM/H
PRESENT MOVEMENT...N OR 360 DEGREES AT 10 MP...29 KM/H
MINIMUM CENTRAL PRESSURE...1100
MB...29.77 INCHES
WATCHE9 AND WARNINGS
--------------------
THERE ARE NO COASTAL WATCHES OR WARNINGS IN EFFECT.
DISCUSSION AND 48-HOUR OUTLOOK
-----------------------------
AT 500 PM AST...2100 UTC...THE CENTER OF TROPICAL STORM DELBY WAS
LOCATED NEAR LATITUDE 24.4 NORTH...LONGITUDE 64.3 WEST OR ABOUT 145
MILES...140 KM...EAST-SOUTHEAST OF THE CENTER. THE DEPRESSION IS MOVING TOWARD THE WEST-NORTHWEST NEAR 10
MPH...19 KM/HR...AND THIS
GENERAL MOTION IS EXPECTED TH OFCICA ON TUESDAY.
TROPICAL STORM FORCE WINDS EXTEND OUTWARD UP TO 140
MILES...160 KM
FROM T THE CENTER.
ESTIMATED MINIMUM CENTRAL PRESSURE IS 1008 MB...29.77 INCHES.HAZARDS AFFECTING LAND
----------------------
NONE.
NEXT ADVISORY
-------------
NEXT INTERMEDIATE ADVISORY...200 AM CDT.
NEXT COMPLETE ADVISORY...1100 PM EDT.
$$
FORECASTER STEWAR
NNNN
There are lots of tweakable hyperparamters in the code. In this example I tried 45 and got a repeating section of a 48-hour outlook. 30 character length seemed to have slightly better results, but again its all tweakable.
For additional examples checkout these links:https://github.com/martin-gorner/tensorflow-rnn-shakespearehttps://github.com/udacity/deep-learning/tree/master/intro-to-rnnshttp://karpathy.github.io/2015/05/21/rnn-effectiveness/

--

--