Typhoon forecast method based on deep learning mixing CNN-LSTM model
Technical field
The present invention relates to one kind based on deep learning mixing convolutional neural networks (CNN) and shot and long term Memory Neural Networks
(LSTM) the typhoon forecast method of model belongs to computer and meteorological, ocean crossing domain.
Background technique
Typhoon not only will affect offshore activities as a kind of Extreme Weather Events, but also can give the life of maritime people
Living and urban economy causes heavy losses.Therefore, typhoon research and prediction are always the emphasis of each coastal state's concern.Typhoon
Prediction is usually to predict the intensity of typhoon and path, and in recent years, path prediction achieves bigger progress, and typhoon
Prediction of strength is but still without too big improvement.
In order to provide the early warning of typhoon disaster, accurate typhoon formation, intensity, path prediction technique are always meteorology
The focal point in field.Due to the complexity and variability of typhoon system, existing typhoon forecast method is generally difficult to typhoon
Accomplish accurately to predict.Existing typhoon forecast method is generally divided into three classes, and one kind is the prediction technique based on numerical model, such as base
In region mode Hurricane Weather and Research Forecasting Model (HWRF), Global Model
ECMWF global model (EMX), intergration model (GFS) prediction technique etc.;One kind is the prediction technique based on statistical analysis,
Such as weather persistence model Climatology and Persistence model (CILIEPER5), statistics dynamic model
Statistical Hurricane Intensity Prediction Scheme (SHIPS) etc.;There are also one kind to be based on engineering
The prediction technique of habit, such as logistic regression Logistic Regression (LR) and artificial neural network
Artificial Neural Network (ANN) etc..Gone out based on the prediction technique of numerical model from the physical background field of atmosphere
Hair, the activity to be detected a typhoon by solving hydrodynamic equations.And it is existing pre- with machine learning based on statisticalling analyze
Survey method is usually some significant variables found out and influenced during Typhoon Activity, then excavate these variables and typhoon formation it
Between correlation, with to after typhoon formation and formation path and intensity predict.Such as document " Wijnands J S,
Qian G, Kuleshov Y.Variable Selection for Tropical Cyclogenesis Predictive
Modeling [J] .Monthly Weather Review, 2016,144. " (the i.e. variable choosings of tropical cyclone generation prediction modeling
Select, " the monthly weather review " page 144 published in 2016) it describes in a text and a kind of generates predictive variable for tropical cyclone
Preference pattern, number is analyzed by using history tropical cyclone optimal path data set and European medium-range numerical forecast center again
According to when qualified tropical cyclone is selected from history tropical cyclone optimal path data set first generating and be mobile
Between and position, then corresponding environment field variable is matched from analyzing again according to time and position in data, then with probability artwork
After type screens variable, machine learning model is established to predict the shape of tropical cyclone with LR using the variable after screening
At.Prediction for path and intensity, now more commonly used method is Statistical-dynamic method, and this method is with Numerical Weather mould
Formula is to rely on, and the environment field parameter that use pattern operation obtains establishes Statistical Prediction Model.It is most represented in typhoon operational forecast
Property be SHIPS model, what which selected when initially proposing is the duration variable of several Climatologicals, such as acts the heat at quarter of giving the correct time
Julian date, tropical cyclone when with cyclone intensity, longitude and latitude, moving direction, generation shift to vector and other dynamical variables,
Such as the opposite whirlpool of vertical wind shear, 200 hPa shell of compression between maximum possible intensity, 850~20,000 pa (hPa) shell of compression
Momentum spread etc. establishes statistical regression model using these variables come the path to detect a typhoon and intensity.The statistics of the model is returned
Return coefficient that will be updated with new sample in annual typhoon season, and can constantly be improved in operational forecast.
Although existing typhoon forecast method has considerable effect for current typhoon forecast, but still exists very
More shortcomings.The difference of numerical model method parameter scheme and primary condition can have very big shadow to the accuracy of prediction
It rings, so that there are unstability for prediction result.Existing statistical method is difficult to consider the non-linear relation between each variable, machine
Learning method does not consider the temporal correlation of each variable, so that the accuracy of prediction decreases.Therefore these types of method is equal
It is difficult to obtain the higher prediction effect of more stable and accuracy.In addition, existing method substantially focuses on that typhoon influence becomes
The selection of amount, does not there is the improvement of relatively deep to model, and too simple model is likely difficult to portray the complexity of Typhoon Activity
Process.Therefore how to provide one efficient, easy to carry out and that accuracy is high typhoon forecast method is those skilled in the art pole
The technical issues of to pay close attention to.
Summary of the invention
The technical problem to be solved by the present invention is to for existing typhoon forecast method prediction result, there are unstability, standards
Exactness problem to be improved proposes a kind of typhoon forecast method based on deep learning mixing CNN-LSTM model.This method
The Atmosphere and Ocean variable data of usage history tropical cyclone optimal path data set and the whole world, by using 3DCNN (three-dimensional CNN)
The space characteristics for extracting atmospheric variable data extract the space characteristics of ocean variable data with 2DCNN (two-dimentional CNN), use LSTM
The time serial message during typhoon occurrence and development is extracted, the typhoon forecast mould of a mixing CNN-LSTM is thus constructed
Type, and path after whether typhoon is formed and formed using the model and intensity are predicted.
Technical solution is: the Atmosphere and Ocean variable number of acquisition history tropical cyclone optimal path data set and the whole world first
According to, form the data set of training pattern, then building mixing CNN-LSTM typhoon forecast model, recycle the number of training pattern
It is trained fitting according to typhoon forecast model of the collection to mixing CNN-LSTM, finally using the platform of trained mixing CNN-LSTM
Wind prediction model whether typhoon is formed and is formed after path and intensity predict.
Specific technical solution of the present invention the following steps are included:
The first step obtains tropical cyclone optimal path data set, selects tropical cyclone optimal path record, matching record pair
The Atmosphere and Ocean variable data answered, data set needed for constructing training pattern, method is:
1.1 download history tropical cyclone optimal path data set in recent years from tropical cyclone official website.The selection torrid zone
The tropical cyclone optimal path data set in the region that sea area is divided is generated in cyclone optimal path data set by tropical cyclone
(element is tropical cyclone optimal path record).Including different year in each region tropical cyclone optimal path data set
Tropical cyclone optimal path record, each year include the tropical cyclone optimal path record of different item numbers again.Single tropical cyclone
Optimal path record is containing the tropical cyclone from being formed the All Time of extinction, longitude and latitude position and strength information.
The 1.2 a certain fixed area for enabling needs detect a typhoon are region A1, A1Tropical cyclone optimal path data set be Q,
It checks whether the maximum intensity in Q on single tropical cyclone optimal path reaches 64kt (32.7m/s) one by one, maximum intensity is reached
Single tropical cyclone record (i.e. typhoon record) to 64kt is put to typhoon data set Q1, maximum intensity is reached into 34kt
The tropical cyclone single record (i.e. tropical storm record) that (17.2m/s) is not up to 64kt is put to tropical storm data set Q2, by
This constructs typhoon data set Q1, tropical storm data set Q2, remaining record for being unsatisfactory for condition casts out.
1.3 downloading Q1Middle whole typhoon records the time of all moment record points, longitude and latitude position, is become using Atmosphere and Ocean
Data set generation method is measured according to Q1Middle whole typhoon records the time of all moment record points, center longitude position carries out group
It knits, Q needed for obtaining model training1Corresponding Atmosphere and Ocean variable data collectionMethod is:
1.3.1 by Q1In typhoon record carry out it is randomly ordered, enable N1For Q1Typhoon record number, initialization typhoon note
Record serial number np=1;
1.3.2 enablingIt is n-thpThe record point number of typhoon record, initialization n-thpThe record point sequence of typhoon record
Number
1.3.3 according to n-thpThe of article typhoon recordThe time of a record pointLongitude station
Position LatitudeUsing single-point variable data method for down loading, from weather forecast center website, (such as: European medium-range weather is pre-
Report center) the corresponding Atmosphere and Ocean variable data of selection downloading, single-point variable data method for down loading is:
1.3.3.1 the range of Atmosphere and Ocean variable data downloading is set as with n-thpThe of article typhoon recordA record point
Longitude and latitude position centered on w ° × w ° longitude and latitude grid, w is positive integer less than 180, the longitude of w ° of expression data cover
Span or latitude span.
1.3.3.2 the resolution ratio of Atmosphere and Ocean variable data downloading is set as n-thpThe of article typhoon recordA record point
U ° × u ° of the highest resolution that can be got.The u ° of longitude interval or latitude interval indicated between lattice point, region A1Interior lattice point
Number is
1.3.3.3 the atmospheric variable of downloading is set as n-thpThe of article typhoon recordThe variable of a record, is denoted as p1,
p2..., pi..., pI, I is atmospheric variable species number, and I is positive integer, and selected variable is relevant to typhoon occurrence and development
Atmospheric variable;Layer is n-th where setting the atmospheric variable space of downloadingpThe of article typhoon recordA record it is retrievable
l1, l2..., li..., lzLayer, z are the atmospheric variable number of plies, and z is positive integer.
1.3.3.4 the ocean variable of downloading is set as n-thpThe of article typhoon recordThe variable of a record, is denoted as s1,
s2..., si..., sJ, J is ocean variable species number, and J is positive integer, and selected variable is relevant to typhoon occurrence and development
Ocean variable;Layer where setting the ocean variable space of downloading is n-thpThe of article typhoon recordA record it is retrievable
f1, f2..., fi... fWLayer, W are the ocean variable number of plies, and W is positive integer.
1.3.3.5 n-th is downloadedpThe of article typhoon recordThe corresponding atmospheric variable data X of a record pointPAnd ocean
Variable data XS, by XPAnd XSIt is packaged composition n-thpThe of article typhoon recordThe time of a record point and longitude and latitude are big accordingly
Qihai ocean variable data, is denoted as It is n-thpThe of article typhoon recordA record
The time of point,It is n-thpThe of article typhoon recordThe longitude of a record point,It is n-thpTyphoon note
The of recordThe latitude of a record point.
1.3.4 enabling
If 1.3.5 np≤N1AndTurn 1.3.3;If np≤N1ButEnable np=np+ 1, it goes to step
1.3.2;If np> N1, execute 1.3.6.
1.3.6 will Packing group
As a data set, as Q1Corresponding Atmosphere and Ocean variable data collectionContaining N1All record points pair of typhoon
The Atmosphere and Ocean variable data answered.
1.4 downloading Q2Whole tropical storms record the time of all moment record points, center longitude position, using step
The 1.3 Atmosphere and Ocean variable data set creation methods, according to Q2Whole tropical storms record all moment record point time,
Longitude and latitude position carries out tissue, Q needed for obtaining model training2Corresponding Atmosphere and Ocean variable data collection
1.5 according to Q1, Q2AndFor the data of the different different prediction models of prediction target building training
Collection, method is:
If 1.5.1 prediction target is whether typhoon forms, data needed for whether training typhoon forms prediction model are constructed
Collect R1, method is:
1.5.1.1 according to Q1AndConstruct the required data set R of training pattern11, method is:
1.5.1.1.1 typhoon record number n is initializedp=1;Initialize R11Input data serial number q=1;
1.5.1.1.2 from Q1In select n-thpTyphoon record;FromIn select n-thpTyphoon records corresponding atmosphere
Ocean variable data It is packaged, is recorded as
1.5.1.1.3 n-th is enabledpThe numbered positions of record point of first intensity greater than 64kt are in typhoon record
1.5.1.1.4 it selectes predicted time and walks k, look-back time walks b.Enabling k=T/6, T is predicted time, and for 6 it is just whole
Several times, any positive integer of the b between 1~k.
1.5.1.1.5 ifFromIn pick out n-thpThe in article record The corresponding Atmosphere and Ocean variable data of a record point is packaged, composition n-thpTyphoon record
For input data constructed by training pattern, it is recorded as X 'q, X 'qIndicate R11In q-th of input data, enable q=q+1, turn
1.5.1.1.6;IfDirectly turn 1.5.1.1.6.
1.5.1.1.6 n is enabledp=np+ 1, if np≤ N1, turns 1.5.1.1.2;If np> N1, illustrate to have obtainedM1For R11In input data number, M1≤N1, turn 1.5.1.1.7.
1.5.1.1.7 willIt is packaged, is utilized Q1In all typhoon recording needles to training pattern institute
The input data set of building.By M1A input data tagged 1, is utilized Q1For label constructed by training pattern
Data set.Input data set and label data collection have collectively constituted data set R needed for whether trained typhoon forms model11, R11
Containing M1A input data and M1A label data.
1.5.1.2 according to Q2AndConstruct the required data set R of training pattern12, method is:
1.5.1.2.1 N is enabled2For Q2Tropical storm record number, initialize tropical storm record number mp=1;Initialization
R12Input data serial number h=1;
1.5.1.2.2 from Q2In select mpTropical storm record, enables mpThe number of tropical storm record record point
ForFromIn select mpTropical storm records corresponding Atmosphere and Ocean variable dataIt is packaged, note
For
1.5.1.2.3 enabling mpThe numbered positions of the record point of first maximum of intensity are in tropical storm record
1.5.1.2.4 it selectes predicted time and walks k, look-back time walks b.Enable k be T/6, T is predicted time, and for 6 it is just whole
Several times, any positive integer of the b between 1~k.
1.5.1.2.5 ifFromIn pick out mpThe in article record The corresponding Atmosphere and Ocean variable data of a record point is packaged, and forms mpTropical storm
Recording needle is recorded as X ' to input data constructed by training patternh, X 'hIndicate R12In h-th of input data, enable h=h+1,
Turn 1.5.1.2.6;IfDirectly turn 1.5.1.2.6.
1.5.1.2.6 m is enabledp=mp+ 1, if mp≤N2, turn 1.5.1.2.2;If mp> N2, illustrate to have obtainedM2For R12In input data number, M2≤N2, turn 1.5.1.2.7.
1.5.1.2.7 willIt is packaged, is utilized Q2In all tropical storm recording needles to training mould
Input data set constructed by type.By M2A input data tagged 0, is utilized Q2For constructed by training pattern
Label data collection.Input data set and label data collection have collectively constituted data set needed for whether trained typhoon forms model
R12, R12Containing M2A input data and M2A label data.
1.5.1.3 by R11And R12Merge into data set R needed for whether trained typhoon forms prediction model1, R1Containing model
Required I1A input data, I1A label data, I1=M1+M2;Turn 1.6.
If 1.5.2 prediction target is typhoon track, data set R needed for constructing training typhoon track prediction model2, method
It is: to Q1In all typhoons record latitude and longitude value and corresponding Atmosphere and Ocean variable dataDislocation processing is carried out, at dislocation
The method of reason is:
1.5.2.1 typhoon record number n is initializedp=1;Enable I2Indicate R2In input data number, initialization data set
R2The serial number i of middle input datap=1;
1.5.2.2 from Q1In at random select n-thpTyphoon record.
1.5.2.3 n-th is enabledpThe numbered positions recorded a little in typhoon record areInitializationThis is enabled to record
Above the total number of all record points is
1.5.2.4 it selectes predicted time and walks k, look-back time walks b.K is T/6, and the positive integer times that T is 6, b is between 1~k
Any positive integer.
1.5.2.5 ifFromA record point starts, selection The Atmosphere and Ocean variable data of total b+1 record point, which is packaged, is used as R2In i-thpA input data, is recorded asSelection theThe typhoon longitude and latitude position of point is recorded as R2In i-thpThe label data of a input data, note
Record isTurn 1.5.2.6;IfButSelectionAltogether
The Atmosphere and Ocean variable data of b+1 record point is as R2In i-thpThe input data of a sample, is recorded asIt willThe typhoon longitude and latitude position value of a record point is assigned to 0, and as R2In i-thpA input number
According to label data, be recorded asTurn 1.5.2.6;IfEnable np=np+ 1, turn 1.5.2.7.
1.5.2.6 enablingip=ip+ 1, turn 1.5.2.5.
If 1.5.2.7 np≤ N1, turns 1.5.2.2;If np> N1, turn 1.5.2.8.
1.5.2.8 willIt is packaged, is utilized Q1In all typhoon recording needles to training pattern institute structure
The path input data set built.It willIt is packaged, is utilized Q1In all typhoon recording needles to training pattern institute
The path label data set of building.Input data set and label data collection have collectively constituted needed for trained typhoon track prediction model
Data set R2, R2Containing I2A path input dataAnd I2A path label dataPath label data are latitude and longitude value;Turn 1.6.
If 1.5.3 prediction target is intensity of typhoon, data set R needed for constructing training intensity of typhoon prediction model3, method
It is that the dislocation processing method is walked using 1.5.2 to Q1In all typhoons record intensity value and corresponding Atmosphere and Ocean variable number
According toDislocation processing is carried out, intensity input data set and intensity label data needed for training intensity of typhoon prediction model are obtained
Collection, constitutes data set R by intensity input data set and intensity label data set3, intensity input data set is containing I2A intensity inputs number
According toIntensity label data set contains I2A intensity label dataIntensity label data is intensity value;Turn 1.6.
1.6 couples of R1, R2, R3It is pre-processed;Respectively to R1Input data set, R2Input data set and R2Number of tags
According to collection, R3Input data set and R3Label data collection be normalized by formula (1),
Wherein R indicates R1, R2, R3In any one data set input data set or R2, R3In any one data set
Label data collection, RmaxIndicate the maximum value of the data set, RminIndicate the minimum value of the data set.R1, R2, R3It is pretreated
Data set is respectively R '1, R '2, R '3;
Second step, building deep learning mix CNN-LSTM model, and method is:
2.1 build deep learning environment.Deep learning library Keras based on Python is installed on the server, and is used
Google deep learning frame TensorFlow is as rear end.
The 2.2 deep learning library Keras building deep learnings based on Python mix CNN-LSTM typhoon forecast model, side
Method is:
2.2.1 learn the 3DCNN module of atmospheric variable space characteristics in building mixing CNN-LSTM model:
The input layer for being 1 layer of Keras by the configuration settings of neural network in 3DCNN module, mALayer Three dimensional convolution layer
(Conv3d layers), mALayer batch regularization layer (BatchNormalization layers), 1 layer of tiling layer (flatten layers), 1 layer connects entirely
Connect layer (Dense layers).The 1st layer of Three dimensional convolution layer is set to contain3 a dimensions convolution kernel (i.e. filter), the size of convolution kernel areStep-length isThe 2nd layer of Three dimensional convolution layer is set to contain3 a dimension convolution kernels (filter
Device), the size of convolution kernel isStep-length isSet mALayer Three dimensional convolution layer contains3 a dimensions convolution kernel (i.e. filter), the size of convolution kernel areStep-length isOne layer batch of regularization layer is added after every layer of Three dimensional convolution layer, and all layers of neuron selection is sharp
Function living is ' Relu ' function, and concrete form is Relu (x)=max (0, x) (taking the maximum value in 0 and x).' Relu ' function
On the one hand the non-linear property that model can be enhanced, on the other hand can be enhanced the sparsity of network.Set the nerve of full articulamentum
First number is dAIt is a, wherein parameter It is positive integer.
2.2.2 learn the 2DCNN module of ocean variable space feature in building mixing CNN-LSTM model:
The input layer for being 1 layer of Keras by the configuration settings of neural network in 2DCNN module, mBLayer two-dimensional convolution layer
(Conv2d layers), mBLayer batch regularization (BatchNormalization layers), 1 layer of tiling layer (flatten layers) and 1 layer of full connection
(Dense layers) composition of layer, as shown in the module for handling ocean variable in Fig. 3.The 1st layer of two-dimensional convolution layer is set to containA 2D
The size of convolution kernel, convolution kernel isStep-length isThe 2nd layer of two-dimensional convolution layer is set to containA 2D convolution
The size of core, convolution kernel isStep-length isEvery layer of two dimension volume ..., setting mBLayer two-dimensional convolution layer containsA 2D convolution kernel, the size of convolution kernel areStep-length isAdd after every layer of two-dimensional convolution layer
One layer of batch regularization layer, and the activation primitive that all layers of neuron selects is ' Relu ' function.Set the nerve of full articulamentum
First number is dBIt is a, wherein
It is positive integer.
2.2.3 learn the LSTM module of temporal aspect in building mixing CNN-LSTM model:
The structure of neural network in LSTM module is set as the LSTM of 1 layer of Keras layer.The neuron number that LSTM is arranged is
dCA, the activation primitive that all layers of neuron selects is still ' Relu ' function.
2.2.4 by 3DCNN module, 2DCNN module, LSTM module passes through the Sequential sequent modular built in Keras
Connection, and one layer of output layer is added, set output layer neuron number as 1, be mapped as single value to export, neuron selects
The activation primitive selected is ' sigmoid ' function σ (x), and concrete form is(truth of a matter that e is natural logrithm),
Model after connection is to mix CNN-LSTM model.Wherein, the input of 3DCNN module is R '1, R '2, R '3Middle input data set
Atmospheric variable data, export as airspace feature vector OP, airspace feature vector OPVector length is full articulamentum
Neuron number dA.The input of 2DCNN module is R '1, R '2, R '3The ocean variable data of middle input data set, exports as atmosphere
Spatial signature vectors OS, airspace feature vector OSVector length is the neuron number d of full articulamentumB.LSTM module it is defeated
Enter the merging vector O=[O for 3DCNN module and 2DCNN module output vectorP, OS], merging vector O is Atmosphere and Ocean space
Feature vector, O are got by (Merge layers) merging of merging layer of Keras, and the length of O is dA+dB.The output of LSTM module is 1
A output mapping value.
Third step, be fitted to obtain by constructed data set training mixing CNN-LSTM model typhoon whether formed it is pre-
Model, typhoon tracks forecast model, intensity of typhoon prediction model are surveyed, method is:
3.1 according to demand by R '1, R '2, R '3In data upset at random after (input data and label data need one a pair of
Answer), the ratio cut partition by a: b is training set R '11, R '21, R '31With test set R '12, R '22, R '32, wherein a, b be positive integer and
a≥b。R′11With R '12Contain N respectivelyFAnd NF' a input data and label data, R '21With R '22Contain N respectivelyLAnd NL' a input number
According to and label data, R '31With R '32Equally contain N respectivelyLAnd NL' a input data and label data.
3.2 utilize R '1Training mixing CNN-LSTM model obtains whether typhoon forms prediction model to fitting, and method is such as
Under:
3.2.1 it selects to intersect loss function of the entropy function as mixing CNN-LSTM model, functional form is as follows:
Wherein, loss function value is loss_value1, NFFor R '11Input data or label data total number, iFFor
R′11The serial number of middle data, 1≤iF≤NF,For R '11In i-thFA true label data,For the number of tags of model prediction
According to,Expression pairTake logarithm.
3.2.2 evaluation index of the accuracy rate (ACC) as model quality is selected:
Wherein, NAFor R '12The middle sum by the correct label data of model prediction, NF' it is R '12Label data sum.
3.2.3 by R '1Input mixing CNN-LSTM model, is trained mixing CNN-LSTM model, fitting obtains platform
The no formation prediction model of wind, the loss function of model are to intersect entropy function, evaluation index ACC.
It comprises the concrete steps that:
3.2.3.1 loop initialization number serial number nc=1;
3.2.3.2 initializing the number of iterations epoch=10;Epoch value interval is 10~ke, and be positive integer;keIt is all
Positive integer, and ke≥10;
3.2.3.3 initialization batch size batchsize=32;The value interval of batchsize is 32~NF, and be 32
Positive integer times;
3.2.3.4 initializing learning rate lr=0.1;The value interval of lr isklIt is just whole between 1~9
Number.
3.2.3.5 model.compile (loss, optimizer (lr), the metrics) function built in Keras is called
Compiling mixing CNN-LSTM model, the parameter setting of function are as follows: loss function loss is to intersect entropy function, optimization algorithm
Optimizer is Adam algorithm, and learning rate lr is lr, and evaluation index metrics is ACC.
3.2.3.6 by call Keras built in model.fit (data_train, labels_train, epochs,
Batch_size) function mixes CNN-LSTM model to be fitted, and obtains the loss function value loss_valuel of training set.By letter
Several parameter setting are as follows: training data data_train is R '11NFA input data, training label data labels_train
For R '11NFA label data, the number of iterations epochs are epoch, and crowd size batch_size is batchsize.
3.2.3.7 by calling model.evaluate (data_test, the labels_test) function built in Keras
Assessment mixing CNN-LSTM model, obtains the ACC of mixing CNN-LSTM model.By the parameter setting of function are as follows: test data
Data_test is R '12NF' a input data, test data labels_test are R '12NF' a label data.
If 3.2.3.8 epoch≤keAnd batchsize≤NFAndRecord n-thcThe epoch of secondary circulation,
Batchsize, lr, the loss function value loss_valuel of training set and the ACC of test set are called built in Keras
Model.save (filename) function saves ncSecondary to recycle obtained model, filename is set as model name.Enable nc=nc+
1, lr=lr × 0.1, turn 3.2.3.5;If epoch≤keAnd batchsize≤NFButEnable batchsize=
Batchsize+32 turns 3.2.3.4;If epoch≤keBut batchsize > NF, epoch=epoch+1 is enabled, 3.2.3.2 is turned;
If epoch > ke, turn 3.2.3.9.
3.2.3.9 by the 1st, 2 ..., nc..., epoch, batchsize, lr, loss_ that C circulation is recorded
Value1, ACC are integrated into the complete documentation of a model of fit.Searched out from complete documentation the smallest loss_value1 and
Cycle-index serial number n ' corresponding to maximum ACCc.By the n-th 'cThe epoch of secondary preservation, batchsize, lr is as optimal ginseng
Number, by the n-th 'cWhether the model of secondary preservation forms prediction model as typhoon.
3.3 utilize R '2Training mixing CNN-LSTM model, fitting obtain typhoon tracks forecast model, the method is as follows:
3.3.1 select root-mean-square error function as the loss function of typhoon tracks forecast model:
Wherein, loss function value is loss_value2, NLFor R '21Input data or label data total number, iLFor
R′21The serial number of middle data, 1≤iL≤NL, YiLFor R '21In i-thLA true label data,It is i-thLA model prediction
Label data.
3.3.2 select absolute error function as the evaluation index of typhoon tracks forecast model:
Wherein, N 'LFor R '22Input data or label data total number, i 'LFor R '22The serial number of middle data, 1≤i 'L
≤N′L,For R '22In the i-th 'LA true label data,It is the i-th 'LThe label data of a model prediction.
3.3.3 by R '2Input mixing CNN-LSTM model, is trained mixing CNN-LSTM model, fitting obtains platform
Wind path diameter prediction model, the loss function of model are root-mean-square error function, and evaluation index is absolute error function.Specific steps
It is:
3.3.3.1 loop initialization number serial number nc=1;
3.3.3.2 initializing the number of iterations epoch=10;Epoch value interval is 10~ke, and be positive integer;keIt is all
Positive integer, and ke≥10;
3.3.3.3 initialization batch size batchsize=32;The value interval of batchsize is 32~NF, and be 32
Positive integer times;
3.3.3.4 initializing learning rate lr=0.1;The value interval of lr isklIt is just whole between 1~9
Number.
3.3.3.5 model.compile (loss, optimizer (lr), the metrics) function built in Keras is called
Compiling mixing CNN-LSTM model, the parameter setting of function are as follows: loss function loss is root-mean-square error function, optimization algorithm
Optimizer is Adam algorithm, and learning rate lr is lr, and evaluation index metrics is that evaluation index is MAE.
3.3.3.6 by call Keras built in model.fit (data_train, labels_train, epochs,
Batch_size) function mixes CNN-LSTM model to be fitted, and obtains the loss function value loss_value1 of training set.By letter
Several parameter setting are as follows: training data data_train is R '21NLA input data, training label data labels_train
For R '21NLA label data, the number of iterations epochs are epoch, and crowd size batch_size is batchsize.
3.3.3.7 by calling model.evaluate (data_test, the labels_test) function built in Keras
Assessment mixing CNN-LSTM model, obtains the MAE of mixing CNN-LSTM model.By the parameter setting of function are as follows: test data
Data_test is R '22NL' a input data, test data labels_test are R '22NL' a label data.
If 3.3.3.8 epoch≤keAnd batchsize≤NFAndRecord n-thcThe epoch of secondary circulation,
Batchsize, lr, the loss function value loss_value2 of training set and the ACC of test set are called built in Keras
Model.save (filename) function saves ncSecondary to recycle obtained model, filename is set as model name.Enable nc=nc+
1, lr=lr × 0.1, turn 3.3.3.5;If epoch≤keAnd batchsize≤NFButEnable batchsize=
Batchsize+32 turns 3.3.3.4;If epoch≤keBut batchsize > NF, epoch=epoch+1 is enabled, 3.3.3.2 is turned;
If epoch > ke, turn 3.3.3.9.
3.3.3.9 by the 1st, 2.., nc..., epoch, batchsize, lr, loss_ that C circulation is recorded
Value2, MAE are integrated into the complete documentation of a model of fit.Searched out from complete documentation the smallest loss_value2 and
Cycle-index serial number n ' corresponding to the smallest MAEc.By the n-th 'cThe epoch of secondary preservation, batchsize, lr is as optimal ginseng
Number, by the n-th 'cThe model of secondary preservation is as typhoon tracks forecast model.
3.4 utilize R '3Training mixing CNN-LSTM model, fitting obtain intensity of typhoon prediction model:
3.4.1 select root-mean-square error function as the loss function of intensity of typhoon prediction model:
Wherein, loss function value is loss_value3, NLFor R '21Input data or label data total number, iLFor
R′31The serial number of middle data, 1≤iL≤NL,For R '31In i-thLA true label data,It is i-thLA model prediction
Label data;
3.4.2 select absolute error function as the evaluation index of intensity of typhoon prediction model:
Wherein, N 'LFor R '32Input data or label data total number, i 'LFor R '32The serial number of middle data, 1≤i 'L
≤N′L,For R '22In the i-th 'LA true label data,It is the i-th 'LThe label data of a model prediction;
3.4.3 parameter regulation means are used, by calling the built-in function of Keras, by R '3Input mixing CNN-LSTM mould
Type is trained mixing CNN-LSTM model, and fitting obtains intensity of typhoon prediction model, and the loss function of model is root mean square
Error function, evaluation index are absolute error function.It comprises the concrete steps that:
3.4.3.1 loop initialization number serial number nc=1;
3.4.3.2 initializing the number of iterations epoch=10;Epoch value interval is 10~ke, and be positive integer;keIt is all
Positive integer, and ke≥10;
3.4.3.3 initialization batch size batchsize=32;The value interval of batchsize is 32~NF, and be 32
Positive integer times;
3.4.3.4 initializing learning rate lr=0.1;The value interval of lr isklIt is just whole between 1~9
Number.
3.4.3.5 model.compile (1oss, optimizer (lr), the metrics) function built in Keras is called
Compiling mixing CNN-LSTM model, the parameter setting of function are as follows: loss function loss is root-mean-square error function, optimization algorithm
Optimizer is Adam algorithm, and learning rate lr is lr, and evaluation index metrics is that evaluation index is MAE.
3.4.3.6 by call Keras built in model.fit (data_train, labels_train, epochs,
Batch_size) function mixes CNN-LSTM model to be fitted, and obtains the loss function value loss_value3 of training set.By letter
Several parameter setting are as follows: training data data_train is R '31NLA input data, training label data labels_train
For R '31NLA label data, the number of iterations epochs are epoch, and crowd size batch_size is batchsize.
3.4.3.7 by calling model.evaluate (data_test, the labels_test) function built in Keras
Assessment mixing CNN-LSTM model, obtains the MAE of assessment models.By the parameter setting of function are as follows: test data data_test is
R′32NL' a input data, test data labels_test are R '32NL' a label data.
If 3.4.3.8 epoch≤keAnd batchsize≤NFAndRecord n-thcThe epoch of secondary circulation,
Batchsize, lr, the loss function value loss_value3 of training set and the MAE of test set are called built in Keras
Model.save (filename) function saves ncSecondary to recycle obtained model, filename is set as model name.Enable nc=nc+
1, lr=lr × 0.1, turn 3.4.3.5;If epoch≤keAnd batchsize≤NFButEnable batchsize=
Batchsize+32 turns 3.4.3.4;If epoch≤keBut batchsize > NF, epoch=epoch+1 is enabled, 3.4.3.2 is turned;
If epoch > ke, turn 3.4.3.9.
3.4.3.9 by the 1st, 2 ..., nc..., epoch, batchsize, lr, loss_ that C circulation is recorded
Value3, MAE are integrated into the complete documentation of a model of fit.Searched out from complete documentation the smallest loss_value3 and
Cycle-index serial number n ' corresponding to the smallest MAEc.By the n-th 'cThe epoch that secondary circulation saves, batchsize, lr is as optimal
Parameter, by the n-th 'cThe model that secondary circulation saves is as intensity of typhoon prediction model.
4th step is predicted that method is using three kinds of typhoon forecast models
4.1 enable the longitude and latitude range of target prediction region A for UA°×WA°, UA° be A longitude span, WA° be A latitude
Span, it is desirable that the tropical cyclone record region of A and first step selection belongs to same sea area.The data type of selected downloading is A
In existing highest resolution uA°×uA° gridding Atmosphere and Ocean variable data.Therefore, total lattice point number G=N × M in A,
Wherein
4.2 consistent predicted times when selecting with training pattern walk k, and look-back time walks b.
Typhoon forecast is carried out after Atmosphere and Ocean variable data corresponding to lattice point in 4.3 downloading A, method is:
4.3.1 coordinate is established as origin using first point of the two-dimentional longitude and latitude grid of A, enabling origin is (1,1);
4.3.2 initialization ordinate is variable n=1;
4.3.3 initialization abscissa is variable m=1;
4.3.4 use the method downloading coordinate of downloading lattice point Atmosphere and Ocean variable data for the big Qihai of lattice point at (m, n)
Foreign variable data X[m, n].Method is:
According to the current time t of prediction1And at (m, n) lattice point longitude station lon[m, n], Position Latitude lat[m, n]It adopts
The single-point variable data method for down loading described in step 1.3.3, downloads t from weather forecast center one by one1, t1- 6, t1- 12,
...t1The Atmosphere and Ocean variable data of lattice point, is recorded as respectively at -6b moment (m, n)Each lattice point is one in grid
Five-tuple structure, five-tuple structure are (NUM, LOC, TT, XP, XS), wherein NUM is the coordinate (m, n) of grid, and LOC is (m, n)
Locate the longitude and latitude value of lattice point, TT is the set of a time, contains t1, t1- 6, t1- 12 ..., t1The time at -6b moment,
XPIt is the atmospheric variable data at lattice point TT each moment at (m, n), XSIt is the ocean variable data at lattice point TT each moment at (m, n), XP
With XSIt is the Atmosphere and Ocean data X of lattice point at (m, n) after synthesis[m, n]。
If 4.3.5 n≤N and m≤M, by X[m, n]It is input to whether typhoon forms prediction model, lattice point 6k at prediction (m, n)
Whether there is typhoon formation after hour.If prediction result is not formed, m=m+1 is enabled, 4.3.4 is turned;If prediction result is to be formed, turn
4.3.6;If n≤N but m > M, enable n=n+1, turn 4.3.3;If n > M, turn the 5th step;
4.3.6 initialization prediction sequence number variable nf=1;
4.3.7 current according to the prediction of real-time update using the method for 4.3.4 step downloading lattice point Atmosphere and Ocean variable data
Moment t2And the longitude and latitude position of lattice point re-downloads data and obtains X ' at (m, n)[m, n], the X ' that will obtain[m, n]Input typhoon
Path prediction model, obtains n-thfSecondary path prediction result As typhoon is in t2+6k×nfThe longitude and latitude position at moment.
4.3.8 by X '[m, n]Intensity of typhoon prediction model is inputted, obtains n-thfSecondary prediction of strength result As platform
Wind is in t2+6k×nfThe intensity value at moment.
4.3.9 ifIt is not 0, the longitude and latitude position obtained according to predictionIt searches for corresponding with latitude and longitude value identical in A
Lattice point coordinate (m ', n '), enable nf=nf+ 1, turn 4.3.7.IfIt is 0, nf=prediction total degree NF, turns 4.3.10.
4.3.10 by nfSecondary typhoon tracks forecastConnection is from t after drawing2From moment
6k×nfPredicted path after hour, nfSecondary intensity of typhoon predictionAs corresponding path
On intensity of typhoon value.
5th step terminates.
Following beneficial effect can be reached using the present invention:
The invention proposes a kind of typhoon forecast methods based on deep learning mixing CNN-LSTM model.This method uses
The Atmosphere and Ocean variable data of history tropical cyclone optimal path data set and the whole world is constructed and has been fitted based on mixing convolution mind
The typhoon forecast model of interacting depth learning model through network (CNN) and shot and long term Memory Neural Networks (LSTM), to typhoon
Whether path and intensity after being formed and being formed are predicted.The model can automatically extract atmosphere in conjunction with 3DCNN and 2DCNN
The space characteristics of extra large table variable data, and the time serial message during typhoon occurrence and development is automatically extracted in conjunction with LSTM.
Eventually by the various temporal correlations conducive to typhoon occurrence and development variable of capture to reach higher predictablity rate.Using this
Invention can obtain following effect:
1. the present invention can be convenient using existing public data collection and deep learning frame carry out model building and
Prediction.The first step of the present invention obtains existing public data collection from tropical cyclone official website and weather forecast center and is used for model
The preparation of building and training, second step carry out the building of model using deep learning frame Keras.Therefore cost is small, and easily
In implementation.
2. the present invention numerical prediction prediction technique, statistical prediction methods and traditional machine learning different from the past
Prediction technique.The present invention automatically extracts the ability of the non-linear relation between variable using deep learning and CNN and LSTM exists
Ability in studying space data and time series data constructs the deep learning model for being directed to typhoon.The present invention is second
Step and third step are trained the model of building using the typhoon data and Atmosphere and Ocean variable data of recent decades, therefore
4th step can directly effectively improve the accuracy rate of typhoon forecast using trained model.
3. different prediction targets can be arranged by different demands in the present invention, scalability is strong.Third step of the present invention is logical
Training fitting typhoon formation model is crossed, typhoon track model and intensity of typhoon model, the 4th step are utilized respectively these three models
Successfully whether typhoon can be formed, the position and intensity after formation are predicted.
Detailed description of the invention
Fig. 1 is overview flow chart of the present invention.
Fig. 2 is the flow chart of second step building mixing CNN-LSTM model of the present invention.
Fig. 3 is the building-block of logic of the mixing CNN-LSTM model of second step building of the present invention.
Specific embodiment
The first step obtains tropical cyclone optimal path data set, selects tropical cyclone optimal path record, matching record pair
The Atmosphere and Ocean variable data answered, data set needed for constructing training pattern, method is:
1.1 from NOAA, (National Oceanic and Atmospheric Administration, is translated into: state, the U.S.
Family ocean and Atmospheric Administration) NCDC (National Centers for environmental information, is translated
Are as follows: U.S. environment information centre) websitehttps://www.ncdc.noaa.gov/ibtracs/It obtains 1979~2016 years and passes through
The IBTrACs of WMO (World Meteorological Organization, be translated into World Meteorological Organization) certification
(International Best Track Archive for Climate Stewardship is translated into international weather management most
Good file store) version tropical cyclone optimal path data set.It selects to press tropical cyclone in tropical cyclone optimal path data set
Generate the tropical cyclone optimal path data set (element is tropical cyclone optimal path record) in the region that sea area is divided.Often
Tropical cyclone optimal path in one region tropical cyclone optimal path data set including different year records, and wraps again in each year
Include the tropical cyclone optimal path record of different item numbers.Single tropical cyclone optimal path record containing the tropical cyclone from formed to
All Time, longitude and latitude position and the strength information of extinction.
The 1.2 a certain fixed area for enabling needs detect a typhoon are Western Pacific (West Pacific, abbreviation WP), the heat of WP
Band cyclone optimal path data set is Q, checks whether the maximum intensity in Q on single tropical cyclone optimal path reaches one by one
64kt (32.7m/s) puts the single tropical cyclone record (i.e. typhoon record) that maximum intensity reaches 64kt to typhoon data set
Q1, by maximum intensity reach 34kt (17.2m/s) be not up to 64kt tropical cyclone single record (i.e. tropical storm record) put
To tropical storm data set Q2, thus construct typhoon data set Q1, tropical storm data set Q2, remaining is unsatisfactory for the note of condition
Record is cast out.
1.3 downloading Q1Middle whole typhoon records the time of all moment record points, longitude and latitude position, is become using Atmosphere and Ocean
Data set generation method is measured according to Q1Middle whole typhoon records the time of all moment record points, center longitude position carries out group
It knits, Q needed for obtaining model training1Corresponding Atmosphere and Ocean variable data collectionMethod is:
1.3.1 by Q1In typhoon record carry out it is randomly ordered, enable N1For Q1Typhoon record number, initialization typhoon note
Record serial number np=1;
1.3.2 enablingIt is n-thpThe record point number of typhoon record, initialization n-thpThe record point sequence of typhoon record
Number
1.3.3 according to n-thpThe of article typhoon recordThe time of a record pointLongitude station
Position LatitudeUsing single-point variable data method for down loading, from ECMWF (European Centre for Medium-
Range Weather Forecasts, is translated into European Center for Medium Weather Forecasting) downloading ERA-Interim is analyzed again on website
As corresponding Atmosphere and Ocean variable data, single-point variable data method for down loading is data:
1.3.3.1 the range of Atmosphere and Ocean variable data downloading is set as with n-thpThe of article typhoon recordA record point
Longitude and latitude position centered on 10 ° × 10 ° longitude and latitude grids, 10 ° expression data cover longitude span or latitude span.
1.3.3.2 the resolution ratio of Atmosphere and Ocean variable data downloading is set as n-thpThe of article typhoon recordA record point
0.125 ° × 0.125 ° of the highest resolution that can be got.0.125 ° of longitude interval or latitude interval indicated between lattice point, area
Domain A1Interior lattice point number is 81 × 81.
1.3.3.3 the atmospheric variable of downloading is set as n-thpThe of article typhoon recordZonal wind (the zonal of a record
Wind, abbreviation u), meridional wind (meridional wind, abbreviation v), and geopotential unit (Geopotential Height, referred to as
Z), temperature (Temperature, abbreviation T), relative humidity (Relative Humidity, abbreviation Rh);Set the atmosphere of downloading
Layer where the variable space is n-thpThe of article typhoon recordRetrievable the 1000/975/925/850/800/ of a record
The shell of compression of 700/600/500/400/300/200/100hpa.
1.3.3.4 the ocean variable of downloading is set as n-thpThe of article typhoon recordSea surface temperature (the Sea of a record
Surface Temperature, abbreviation SST);Layer where setting the ocean variable space of downloading is n-thpThe of article typhoon recordA record obtains one layer of extra large table.
1.3.3.5 n-th is downloadedpThe of article typhoon recordThe corresponding atmospheric variable data X of a record pointPAnd ocean
Variable data XS, by XPAnd XSIt is packaged composition n-thpThe of article typhoon recordThe time of a record point and longitude and latitude are big accordingly
Qihai ocean variable data, is denoted as It is n-thpThe of article typhoon recordA note
The time of point is recorded,It is n-thpThe of article typhoon recordThe longitude of a record point,It is n-thpTyphoon
The of recordThe latitude of a record point.
1.3.4 enabling
If 1.3.5 np≤N1AndTurn 1.3.3;If np≤N1ButEnable np=np+ 1, it goes to step
1.3.2;If np> N1, execute 1.3.6.
1.3.6 will
Packing group becomes a data set, as Q1Corresponding Atmosphere and Ocean variable data collectionContaining N1Item platform
The corresponding Atmosphere and Ocean variable data of all record points of wind.
1.4 downloading Q2Whole tropical storms record the time of all moment record points, center longitude position, using step
The 1.3 Atmosphere and Ocean variable data set creation methods, according to Q2Whole tropical storms record all moment record point time,
Longitude and latitude position carries out tissue, Q needed for obtaining model training2Corresponding Atmosphere and Ocean variable data collection
1.5 according to Q1, Q2AndThe data set of different prediction models is trained for different prediction target buildings,
Method is:
If 1.5.1 prediction target is whether typhoon forms, data needed for whether training typhoon forms prediction model are constructed
Collect R1, method is:
1.5.1.1 according to Q1AndConstruct the required data set R of training pattern11, method is:
1.5.1.1.1 typhoon record number n is initializedp=1;Initialize R11Input data serial number q=1;
1.5.1.1.2 from Q1In select n-thpTyphoon record;FromIn select n-thpTyphoon records corresponding atmosphere
Ocean variable dataIt is packaged, is recorded as
1.5.1.1.3 n-th is enabledpThe numbered positions of record point of first intensity greater than 64kt are in typhoon record
1.5.1.1.4 selected predicted time T=24h, predicted time walk k=T/6=4;Selected look-back time walks b=2.
1.5.1.1.5 ifFromIn pick out n-thpThe in article record The corresponding Atmosphere and Ocean variable data of a record point is packaged, composition n-thpTyphoon recording needle is to training pattern institute structure
The input data built, is recorded as X 'q, X 'qIndicate R11In q-th of input data;Q=q+1 is enabled, 1.5.1.1.6 is turned;IfDirectly turn 1.5.1.1.6.
1.5.1.1.6 n is enabledp=np+ 1, if np≤N1, turn 1.5.1.1.2;If np> N1, illustrate to have obtainedM1For R11In input data number, M1≤N1, turn 1.5.1.1.7.
1.5.1.1.7 willIt is packaged, is utilized Q1In all typhoon recording needles to training pattern institute
The input data set of building.By M1A input data tagged 1, is utilized Q1For label constructed by training pattern
Data set.Input data set and label data collection have collectively constituted data set R needed for whether trained typhoon forms model11, R11
Containing M1A input data and M1A label data.
1.5.1.2 according to Q2AndConstruct the required data set R of training pattern12, method is:
1.5.1.2.1 N is enabled2For Q2Tropical storm record number, initialize tropical storm record number mp=1;Initialization
R12Input data serial number h=1;
1.5.1.2.2 from Q2In select mpTropical storm record, enables mpThe number of tropical storm record record point
ForFromIn select mpTropical storm records corresponding Atmosphere and Ocean variable dataIt is packaged, note
For
1.5.1.2.3 enabling mpThe numbered positions of the record point of first maximum of intensity are in tropical storm record
1.5.1.2.4 selected predicted time T=24h, predicted time walk k=T/6=4;Selected look-back time walks b=2.
1.5.1.2.5 ifFromIn pick out mpThe in article record The corresponding Atmosphere and Ocean variable data of a record point is packaged, and forms mpTropical storm recording needle is to training mould
Input data constructed by type, is recorded as X 'h, X 'hIndicate R12In h-th of input data;H=h+1 is enabled, 1.5.1.2.6 is turned;IfDirectly turn 1.5.1.2.6.
1.5.1.2.6 m is enabledp=mp+ 1, if mp≤N2, turn 1.5.1.2.2;If mp> N2, illustrate to have obtainedM2≤N2, M2For R12In input data number, turn 1.5.1.2.7.
1.5.1.2.7 willIt is packaged, is utilized Q2In all tropical storm recording needles to training mould
Input data set constructed by type.By M2A input data tagged 0, is utilized Q2For constructed by training pattern
Label data collection.Input data set and label data collection have collectively constituted data set needed for whether trained typhoon forms model
R12, R12Containing M2A input data and M2A label data.
1.5.1.3 by R11And R12Merge into data set R needed for whether trained typhoon forms prediction model1, R1Containing model
Required I1A input data, I1A label data, I1=M1+M2;Turn 1.6.
If 1.5.2 prediction target is typhoon track, data set R needed for constructing training typhoon track prediction model2, method
It is: to Q1In all typhoons record latitude and longitude value and corresponding Atmosphere and Ocean variable dataDislocation processing is carried out, at dislocation
The method of reason is:
1.5.2.1 typhoon record number n is initializedp=1;Enable I2Indicate R2In input data number, initialization data set
R2The serial number i of middle input datap=1;
1.5.2.2 from Q1In at random select n-thpTyphoon record.
1.5.2.3 n-th is enabledpThe numbered positions recorded a little in typhoon record areInitializationThis is enabled to record
Above the total number of all record points is
1.5.2.4 predicted time T=24h is selected, predicted time walks k=T/6=4;Selected look-back time walks b=2.
1.5.2.5 ifFromA record point starts, selection Totally 3
The Atmosphere and Ocean variable data of record point, which is packaged, is used as R2In i-thpA input data, is recorded asSelection theRecord
The typhoon longitude and latitude position of point is as R2In i-thpThe label data of a input data, is recorded asTurn 1.5.2.6;IfButSelection The Atmosphere and Ocean variable data of totally 3 record points
As R2In i-thpThe input data of a sample, is recorded asIt willThe typhoon longitude and latitude of a record point
Positional value is assigned to 0, and as R2In i-thpThe label data of a input data, is recorded asTurn 1.5.2.6;IfEnable np=np+ 1, turn 1.5.2.7.
1.5.2.6 enablingip=ip+ 1, turn 1.5.2.5.
If 1.5.2.7 np≤N1, turn 1.5.2.2;If np> N1, turn 1.5.2.8.
1.5.2.8 willIt is packaged, is utilized Q1In all typhoon recording needles to training pattern institute structure
The path input data set built.It willFourth packet, is utilized Q1In all typhoon recording needles to training pattern institute
The path label data set of building.Path input data set and path label data set have collectively constituted trained typhoon tracks forecast
Data set R needed for model2, R2Containing I2A path input dataAnd I2A path label data Path label data are latitude and longitude value;Turn 1.6.
If 1.5.3 prediction target is intensity of typhoon, to Q1In all typhoons record intensity value and corresponding Atmosphere and Ocean
Variable dataDislocation processing is carried out, data set R needed for constructing training intensity of typhoon prediction model3, R3In containing utilize Q1
In all typhoon recording needles to intensity input data set constructed by training pattern and utilize Q1In all typhoon recording needles to instruction
Practice intensity label data set constructed by model, intensity input data concentration contains I2A input data, I2A input data isContain I in intensity label data set2A label data, I2A mark
Signing data is Intensity label data is intensity value;Turn 1.6;
1.6 couples of R1, R2, R3It is pre-processed;Respectively to R1Input data set, R2Input data set and R2Number of tags
According to collection, R3Input data set and R3Label data collection be normalized by formula (1),
Wherein R indicates R1, R2, R3In any one data set input data set or R2, R3In any one data set
Label data collection, RmaxIndicate the maximum value of the data set, RminIndicate the minimum value of the data set.R1, R2, R3It is pretreated
Data set is respectively R '1, R '2, R '3;
Second step, building deep learning mix CNN-LSTM model, and construction method is as shown in Figure 2:
2.1 build deep learning environment.Deep learning library Keras based on Python is installed on the server, and is used
Google deep learning frame TensorFlow is as rear end.
The 2.2 deep learning library Keras building deep learnings based on Python mix CNN-LSTM typhoon forecast model, side
Method is:
2.2.1 learn the 3DCNN module of atmospheric variable space characteristics in building mixing CNN-LSTM model.In Fig. 3
Shown in 3DCNN module:
The input layer for being 1 layer of Keras by the configuration settings of neural network in 3DCNN module, 3 (mA=3) layer Three dimensional convolution
Layer, 3 (mA=3) layer batch regularization layer, 1 layer of tiling layer, 1 layer of full articulamentum.It sets first layer Three dimensional convolution layer and contains 323 dimensions convolution kernel (i.e. filter), the size of convolution kernel isStep-length is Setting
Second layer Three dimensional convolution layer contains3 a dimensions convolution kernel (i.e. filter), the size of convolution kernel areStep-length is Setting
Third layer Three dimensional convolution layer contains3 a dimensions convolution kernel (i.e. filter), the size of convolution kernel areStep-length isEvery layer three
Tie up one layer of batch regularization layer of addition after convolutional layer, and the activation primitive that all layers of neuron selects is ' Relu ' function, specifically
Form is Relu (x)=max (0, x) (taking the maximum value in 0 and x).Set the neuron number d of full articulamentumA=100
It is a.
2.2.2 learn the 2DCNN module of ocean variable space feature in building mixing CNN-LSTM model.In Fig. 3
Shown in 2DCNN module:
The input layer for being 1 layer of Keras by the configuration settings of neural network in 3DCNN module, 3 (mB=3) layer two-dimensional convolution
Layer, 3 (mB=3) layer batch regularization, 1 layer of tiling layer and 1 layer of full articulamentum composition.The 1st layer of two-dimensional convolution layer is set to containA 2D convolution kernel, the size of convolution kernel are Step-length isThe 2nd layer of two-dimensional convolution layer is set to containA 2D convolution kernel, convolution kernel
Having a size ofStep-length isThe 3rd layer of two-dimensional convolution layer is set to containA 2D convolution kernel, the size of convolution kernel areStep-length is After every layer of two-dimensional convolution layer plus one layer of batch regularization layer, and all layers of neuron selection
Activation primitive is ' Relu ' function.The neuron number of full articulamentum is set as dB=100.
2.2.3 learn the LSTM module of temporal aspect in building mixing CNN-LSTM model.Such as LSTM module institute in Fig. 3
Show:
The structure of neural network in LSTM module is set as the LSTM of 1 layer of Keras layer.The neuron number that LSTM is arranged is
dC=100, the activation primitive that all layers of neuron selects is still ' Relu ' function.
2.2.4 by 3DCNN module, 2DCNN module, LSTM module is by with the Sequential progressive die built in Keras
Block connection, and one layer of output layer is added, output layer neuron number is set as 1, is mapped as single value to export, neuron
The activation primitive selected is ' sigmoid ' function σ (x), and concrete form is(e is the bottom of natural logrithm
Number), the model after connection is to mix CNN-LSTM model.Wherein, the input of 3DCNN module is R '1, R '2, R '3Middle input number
According to the atmospheric variable data of collection, export as airspace feature vector 0P, airspace feature vector OPVector length is full connection
The neuron number d of layerA=100.The input of 2DCNN module is R '1, R '2, R '3The ocean variable data of middle input data set,
Output is ocean space feature vector OS, ocean space feature vector OSVector length is the neuron number d of full articulamentumB=
100.The input of LSTM module is merging vector, that is, Atmosphere and Ocean space characteristics of 3DCNN module and 2DCNN module output vector
Vector O=[OP, OS], merging vector O is got by (Merge layers) merging of merging layer of Keras, and the length of O is dA+dB=
200.The output of LSTM module is 1 output mapping value.
Third step, be fitted to obtain by constructed data set training mixing CNN-LSTM model typhoon whether formed it is pre-
Model, typhoon tracks forecast model, intensity of typhoon prediction model are surveyed, method is:
3.1 according to demand by R '1, R '2, R '3In data upset at random after (input data and label data need one a pair of
Answer), the ratio cut partition by 7: 3 is training set R '11, R '21, R '31With test set R '12, R '22, R '32。R′11With R '12Contain N respectivelyF
And NF' a input data and label data, R '21With R '22Contain N respectivelyLAnd NL' a input data and label data, R '31With R '32
Equally contain N respectivelyLAnd NL' a input data and label data.
3.2 utilize R '1Training mixing CNN-LSTM model obtains whether typhoon forms prediction model to fitting, and method is such as
Under:
3.2.1 it selects to intersect loss function of the entropy function as mixing CNN-LSTM model, functional form is as follows:
Wherein, loss function value is loss_valuel, NFFor R '11Input data or label data total number, iFFor
R′11The serial number of middle data, 1≤iF≤NF,For R '11In i-thFA true label data,For the number of tags of model prediction
According to,Expression pairTake logarithm.
3.2.2 evaluation index of the accuracy rate (ACC) as model quality is selected:
Wherein, NAFor R '12The middle sum by the correct label data of model prediction, NF' it is R '12Label data sum.
3.2.3 parameter regulation means are used, by calling the built-in function of Keras, by R '1Input mixing CNN-LSTM mould
Type is trained mixing CNN-LSTM model, and fitting obtains the no formation prediction model of typhoon, and the loss function of model is to intersect
Entropy function, evaluation index ACC.It comprises the concrete steps that:
3.2.3.1 loop initialization number serial number nc=1;
3.2.3.2 initializing the number of iterations epoch=10;Epoch value interval is 10~100, and is positive integer;
3.2.3.3 initialization batch size batchsize=32;The positive integer times that the value of batchsize is 32, and need small
In NF;
3.2.3.4 initializing learning rate lr=0.1;The value interval of lr is 0.1~10-6;
3.2.3.5 model.compile (loss, optimizer (lr), the metrics) function built in Keras is called
Compiling mixing CNN-LSTM model, the parameter setting of function are as follows: loss function loss is to intersect entropy function, optimization algorithm
Optimizer is Adam algorithm, and learning rate lr is lr, and evaluation index metrics is ACC.
3.2.3.6 by call Keras built in model.fit (data_train, labels_train, epochs,
Batch size) function come be fitted mixing CNN-LSTM model, obtain the loss function value loss_value1 of training set.By letter
Several parameter setting are as follows: training data data_train is R '11NFA input data, training label data labels_train
For R '11NFA label data, the number of iterations epochs are epoch, and crowd size batch_size is batchsize.
3.2.3.7 by calling model.evaluate (data_test, the labels_test) function built in Keras
Assessment mixing CNN-LSTM model, obtains the ACC of mixing CNN-LSTM model.By the parameter setting of function are as follows: test data
Data_test is R '12NF' a input data, test data labels_test are R '12NF' a label data.
If 3.2.3.8 epoch≤100 and batchsize≤NFAnd lr >=10-6, record n-thcThe epoch of secondary circulation,
Batchsize, lr, the loss function value loss_value1 of training set and the ACC of test set are called built in Keras
Model.save (filename) function saves ncSecondary to recycle obtained model, filename is set as model name.Enable nc=nc+
1, lr=lr × 0.1, turn 3.2.3.5;If epoch≤100 and batchsize≤NFBut lr < 10-6, enable batchsize=
Batchsize+32 turns 3.2.3.4;If epoch≤100 but batchsize > NF, epoch=epoch+1 is enabled, is turned
3.2.3.2;If epoch > 100, turns 3.2.3.9.
3.2.3.9 by the 1st, 2 ..., nc..., epoch, batchsize, lr, loss_ that C circulation is recorded
Value1, ACC are integrated into the complete documentation of a model of fit.Searched out from complete documentation the smallest loss_value1 and
Cycle-index serial number n ' corresponding to maximum ACCc.By the n-th 'cThe epoch that secondary circulation saves, batchsize, lr is as optimal
Parameter, by the n-th 'cWhether the model that secondary circulation saves forms prediction model as typhoon.
3.3 utilize R '2Training mixing CNN-LSTM model, fitting obtain typhoon tracks forecast model, the method is as follows:
3.3.1 select root-mean-square error function as the loss function of typhoon tracks forecast model:
Wherein, loss function value is loss_value2, NLFor R '21Input data or label data total number, iLFor
R′21The serial number of middle data, 1≤iL≤NL,For R '21In i-thLA true label data,It is i-thLA model prediction
Label data.
3.3.2 select absolute error function as the evaluation index of typhoon tracks forecast model:
Wherein, N 'LFor R '22Input data or label data total number, i 'LFor R '22The serial number of middle data, 1≤i 'L
≤N′L,For R '22In the i-th 'LA true label data,It is the i-th 'LThe label data of a model prediction.
3.3.3 by R '2Input mixing CNN-LSTM model, is trained mixing CNN-LSTM model, fitting obtains platform
Wind path diameter prediction model, the loss function of model are root-mean-square error function, and evaluation index is absolute error function.Specific steps
It is:
3.3.3.1 loop initialization number serial number nc=1;
3.3.3.2 initializing the number of iterations epoch=10;Epoch value interval is 10~100, and is positive integer.
3.3.3.3 initialization batch size batchsize=32;The positive integer times that the value of batchsize is 32, and need small
In NL。
3.3.3.4 initializing learning rate lr=0.1;The value interval of lr is 0.1~10-6。
3.3.3.5 model.compile (1oss, optimizer (lr), the metrics) function built in Keras is called
Compiling mixing CNN-LSTM model, the parameter setting of function are as follows: loss function loss is root-mean-square error function, optimization algorithm
Optimizer is Adam algorithm, and learning rate lr is lr, and evaluation index metrics is that evaluation index is MAE.
3.3.3.6 by call Keras built in model.fit (data_train, labels_train, epochs,
Batch_size) function mixes CNN-LSTM model to be fitted, and obtains the loss function value loss_value2 of training set.By letter
Several parameter setting are as follows: training data data_train is R '21NLA input data, training label data labels_train
For R '21NLA label data, the number of iterations epochs are epoch, and crowd size batch_size is batchsize.
3.3.3.7 by calling model.evaluate (data_test, the labels_test) function built in Keras
Assessment mixing CNN-LSTM model, obtains the MAE of mixing CNN-LSTM model.By the parameter setting of function are as follows: test data
Data_test is R '22NL' a input data, test data labels_test are R '22NL' a label data can be obtained
The MAE of assessment models.
If 3.3.3.8 epoch≤100 and batchsize≤NFAnd lr >=10-6, the epoch of n-th c times circulation is recorded,
Batchsize, lr, the loss function value loss_value2 of training set and the ACC of test set are called built in Keras
Model.save (filename) function saves ncSecondary to recycle obtained model, filename is set as model name.Enable nc=nc+
1, lr=lr × 0.1, turn 3.3.3.5;If epoch≤100 and batchsize≤NFBut lr < 10-6, enable batchsize=
Batchsize+32 turns 3.3.3.4;If epoch≤100 but batchsize > NF, epoch=epoch+1 is enabled, is turned
3.3.3.2;If epoch > 100, turns 3.3.3.9.
3.3.3.9 by the 1st, 2 ..., nc..., epoch, batchsize, lr, loss_ that C circulation is recorded
Value2, MAE are integrated into the complete documentation of a model of fit.Searched out from complete documentation the smallest loss_value2 and
Cycle-index serial number n ' corresponding to the smallest MAEc.By the n-th 'cThe epoch that secondary circulation saves, batchsize, lr is as optimal
Parameter, by the n-th 'cThe model that secondary circulation saves is as typhoon tracks forecast model.
3.4 utilize R '3Training mixing CNN-LSTM model, fitting obtain intensity of typhoon prediction model:
3.4.1 select root-mean-square error function as the loss function of intensity of typhoon prediction model:
Wherein, loss function value is loss_value3, NLFor R '21Input data or label data total number, iLFor
R′31The serial number of middle data, 1≤iL≤NL,For R '31In i-thLA true label data,It is i-thLA model prediction
Label data;
3.4.2 select absolute error function as the evaluation index of intensity of typhoon prediction model:
Wherein, N 'LFor R '32Input data or label data total number, i 'LFor R '32The serial number of middle data, 1≤i 'L
≤N′L,For R '22In the i-th 'LA true label data,It is the i-th 'LThe label data of a model prediction;
3.4.3 parameter regulation means are used, by calling the built-in function of Keras, by R '3Input mixing CNN-LSTM mould
Type is trained mixing CNN-LSTM model, and fitting obtains intensity of typhoon prediction model, and the loss function of model is root mean square
Error function, evaluation index are absolute error function.It comprises the concrete steps that:
3.4.3.1 loop initialization number serial number nc=1;
3.4.3.2 initializing the number of iterations epoch=10;Epoch value interval is 10~100, and is positive integer.
3.4.3.3 initialization batch size batchsize=32;The positive integer times that the value of batchsize is 32, and need small
In NL。
3.4.3.4 initializing learning rate lr=0.1;The value interval of lr is 0.1~10-6。
3.4.3.5 model.compile (loss, optimizer (lr), the metrics) function built in Keras is called
Compiling mixing CNN-LSTM model, the parameter setting of function are as follows: loss function loss is root-mean-square error function, optimization algorithm
Optimizer is Adam algorithm, and learning rate lr is lr, and evaluation index metrics is that evaluation index is MAE.
3.4.3.6 by call Keras built in model.fit (data_train, labels_train, epochs,
Batch_size) function mixes CNN-LSTM model to be fitted, and obtains the loss function value loss_value3 of training set.By letter
Several parameter setting are as follows: training data data_train is R '31NLA input data, training label data labels_train
For R '31NLA label data, the number of iterations epochs are epoch, and crowd size batch_size is batchsize.Thus may be used
Obtain the loss function value loss_value3 of training set.
3.4.3.7 by calling model.evaluate (data_test, the labels_test) function built in Keras
Assessment mixing CNN-LSTM model, obtain the MAE of mixing CNN-LSTM model.By the parameter setting of function are as follows: test data
Data_test is R '32NL' a input data, test data labels_test are R '32NL' a label data can be obtained
The MAE of assessment models.
3.4.3.8 epoch≤100 and batchsize≤NFAnd lr >=10-6, record n-thcThe epoch of secondary circulation,
Batchsize, lr, the loss function value loss_value3 of training set and the MAE of test set are called built in Keras
Model.save (filename) function saves ncSecondary to recycle obtained model, filename is set as model name.Enable nc=nc+
1, lr=lr × 0.1, turn 3.4.3.5;If epoch≤100 and batchsize≤NFBut lr < 10-6, enable batchsize=
Batchsize+32 turns 3.4.3.4;If epoch≤100 but batchsize > NF, epoch=epoch+1 is enabled, is turned
3.4.3.2;If epoch > 100, turns 3.4.3.9.
3.4.3.9 by the 1st, 2 ..., nc..., epoch, batchsize, lr, loss_ that C circulation is recorded
Value3, MAE are integrated into the complete documentation of a model of fit.Searched out from complete documentation the smallest loss_value3 and
Cycle-index serial number n ' corresponding to the smallest MAEc.By the n-th 'cThe epoch that secondary circulation saves, batchsize, lr is as optimal
Parameter, by the n-th 'cThe model that secondary circulation saves is as intensity of typhoon prediction model.
4th step carries out typhoon forecast, method using three kinds of typhoon forecast models fixed sea area A a certain to Western Pacific
It is:
4.1 enable the longitude and latitude range of A for UA°×WA°, UA° be A longitude span, WA° be A latitude span.Under selected
The data type of load is the gridding Atmosphere and Ocean variable data of 0.125 ° × 0.125 ° of the existing highest resolution of A.Therefore, A
Interior total lattice point number G=N × M, wherein
4.2 consistent predicted times when selecting with training pattern walk k=4, and look-back time walks b=2.
Typhoon forecast is carried out after Atmosphere and Ocean variable data corresponding to lattice point in 4.3 downloading A, method is:
4.3.1 coordinate is established as origin using first point of the two-dimentional longitude and latitude grid of A, enabling origin is (1,1);
4.3.2 initialization ordinate is variable n=1;
4.3.3 initialization abscissa is variable m=1;
4.3.4 use the method downloading coordinate of downloading lattice point Atmosphere and Ocean variable data for the big Qihai of lattice point at (m, n)
Foreign variable data X[m, n].Method is:
According to the current time t of prediction1And at (m, n) lattice point longitude station lon[mm, n], Position Latitude lat[m, n]It adopts
The single-point variable data method for down loading described in step 1.3.3, downloads t from weather forecast center one by one1, t1- 6, t1- 12 moment
The Atmosphere and Ocean variable data of lattice point, is recorded as respectively at (m, n)Each lattice point is one five in grid
Tuple structure, five-tuple structure are (NUM, LOC, TT, XP, XS), wherein NUM is the coordinate (m, n) of grid, and LOC is at (m, n)
The longitude and latitude value of lattice point, TT are the set of a time, contain t1, t1- 6, t1The time at -12 moment, XPIt is at (m, n)
The atmospheric variable data at lattice point TT each moment, XSIt is the ocean variable data at lattice point TT each moment at (m, n), XPWith XsAfter synthesis
The Atmosphere and Ocean data X of lattice point as at (m, n)[m, n]。
If 4.3.5 n≤N and m≤M, by X[m, n]It is input to whether typhoon forms prediction model, lattice point 24 at prediction (m, n)
Whether there is typhoon formation after hour.If prediction result is not formed, m=m+1 is enabled, 4.3.4 is turned;If prediction result is to be formed, turn
4.3.6;If n≤N but m > M, enable n=n+1, turn 4.3.3;If n > M, turn the 5th step;
4.3.6 initialization prediction sequence number variable nf=1;
4.3.7 current according to the prediction of real-time update using the method for 4.3.4 step downloading lattice point Atmosphere and Ocean variable data
Moment t2And the longitude and latitude position of lattice point re-downloads data and obtains X ' at (m, n)[m, n], the X ' that will obtain[m, n]Input typhoon
Path prediction model, obtains n-thfSecondary path prediction result As typhoon is in t2+24×nfThe longitude and latitude position at moment.
4.3.8 by X '[m, n]Intensity of typhoon prediction model is inputted, obtains n-thfSecondary prediction of strength result As platform
Wind is in t2+24×nfThe intensity value at moment.
4.3.9 ifIt is not 0, the longitude and latitude position obtained according to predictionIt searches for corresponding with latitude and longitude value identical in A
Lattice point coordinate (m ', n '), enable nf=nf+ 1, turn 4.3.7.IfIt is 0, nf=prediction total degree NF, turns 4.3.10.
4.3.10 by nfSecondary typhoon tracks forecastConnection is from t after drawing2Moment
Play 24 × nfPredicted path after hour, nfSecondary intensity of typhoon predictionAs corresponding road
Intensity of typhoon value on diameter.
5th step terminates.