CN114169502A - Rainfall prediction method and device based on neural network and computer equipment - Google Patents

Rainfall prediction method and device based on neural network and computer equipment Download PDF

Info

Publication number
CN114169502A
CN114169502A CN202111494096.8A CN202111494096A CN114169502A CN 114169502 A CN114169502 A CN 114169502A CN 202111494096 A CN202111494096 A CN 202111494096A CN 114169502 A CN114169502 A CN 114169502A
Authority
CN
China
Prior art keywords
precipitation
data
neural network
function
radial basis
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111494096.8A
Other languages
Chinese (zh)
Inventor
蒙芳秀
覃碧莉
苏健昌
吴俊皇
蒋宜蓉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guilin University of Technology
Original Assignee
Guilin University of Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guilin University of Technology filed Critical Guilin University of Technology
Priority to CN202111494096.8A priority Critical patent/CN114169502A/en
Publication of CN114169502A publication Critical patent/CN114169502A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/048Activation functions
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01WMETEOROLOGY
    • G01W1/00Meteorology
    • G01W1/10Devices for predicting weather conditions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/047Probabilistic or stochastic networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Biomedical Technology (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Environmental & Geological Engineering (AREA)
  • Probability & Statistics with Applications (AREA)
  • Atmospheric Sciences (AREA)
  • Biodiversity & Conservation Biology (AREA)
  • Ecology (AREA)
  • Environmental Sciences (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a rainfall prediction method based on a neural network, which comprises the following steps: acquiring a precipitation data set; constructing a logistic regression precipitation generation model based on the logistic regression hypothesis function; dividing the precipitation data set into data of days without precipitation and data of days with precipitation according to a logistic regression precipitation generation model; meanwhile, for the data of the day without precipitation, the predicted no precipitation is output; constructing a radial basis function neural network precipitation prediction model based on a radial basis function neural network; and inputting the data of the days with precipitation into a radial basis function neural network precipitation prediction model, and outputting the predicted precipitation. According to the method, the logistic regression and the radial basis function neural network are combined, and the logistic regression and the RBF neural network connection judgment improve the stability and accuracy of prediction.

Description

Rainfall prediction method and device based on neural network and computer equipment
Technical Field
The invention relates to the field of rainfall prediction, in particular to a rainfall prediction method and device based on a logistic regression-radial basis function neural network and computer equipment.
Background
The existing BP neural network rainfall prediction method is low in approximation accuracy, and the learning rate of the BP neural network is fixed, so that the convergence speed of the network is low, and long training time is needed. When the expression function of the BP network approaches, a negative gradient descent method is adopted for weight adjustment, and the method for adjusting the weight has limitation. And secondly, the convolution cloud neural network forecast rainfall is too complex, excessive rainfall forecast factor graphs are required to be processed for multiple times, and unsuitable small individuals can learn and forecast. Then the prediction scoring accuracy of the EC mode is not stable enough.
In the prior art, a Logistic discrimination model is introduced firstly, then, meteorological physical factors are selected for principal component analysis, models of three schemes are designed, and after results of the three schemes are analyzed, precipitation quantity value is forecasted and the effect is tested. However, the defect is mainly that the heavy precipitation is mostly caused by a mesoscale system directly, and currently considered influence factors only contain large-scale information; meanwhile, the model is established on the basis of the numerical mode output field, and is inevitably influenced by mode deviation, so that the accuracy of rainfall prediction is influenced.
Disclosure of Invention
In view of the above, there is a need to provide a method, an apparatus and a computer device for predicting precipitation based on a neural network.
The embodiment of the invention provides a rainfall prediction method based on a neural network, which comprises the following steps:
acquiring a precipitation data set;
constructing a logistic regression precipitation generation model based on the logistic regression hypothesis function; dividing the precipitation data set into data of days without precipitation and data of days with precipitation according to a logistic regression precipitation generation model; meanwhile, for data of days without precipitation, the predicted no precipitation is output;
constructing a radial basis function neural network precipitation prediction model based on a radial basis function neural network; and inputting the data of the days with precipitation into a radial basis function neural network precipitation prediction model, and outputting the predicted precipitation.
Further, the precipitation dataset comprises: precipitation influence factors; and the precipitation influence factor comprises: 850hPa radial wind, latitudinal wind, potential altitude field, relative humidity and specific humidity.
Further, according to the logistic regression precipitation occurrence model, the precipitation data set is divided into data of days without precipitation and data of days with precipitation, and the method specifically comprises the following steps:
converting the precipitation data set into 0/1 attribute precipitation data, and dividing 0/1 attribute precipitation data into experimental data and test data; wherein, the 0 attribute precipitation data is data of no precipitation day, and the 1 attribute precipitation data is data of precipitation day;
training a logistic regression precipitation generation model by using experimental data;
and inputting the test data into the trained logistic regression precipitation occurrence model to obtain data of days without precipitation and data of days with precipitation.
Further, the method includes the steps of inputting data of days with precipitation into a radial basis function neural network precipitation prediction model, and outputting predicted precipitation, wherein the steps specifically include:
dividing the data of the days with precipitation into experimental data and test data;
training and optimizing parameters of experimental data;
inputting the experimental data after training and parameter optimization into a radial basis function neural network rainfall prediction model, and training the radial basis function neural network rainfall prediction model; taking the output data which accord with the error judgment range as a prediction result, and carrying out parameter optimization on the non-conforming output data again;
and inputting the test data into the trained radial basis function neural network precipitation prediction model, and outputting the predicted precipitation.
Further, the logistic regression hypothesis function specifically includes:
the output of the linear regression is noted as:
z=θTx=θ1x12x2+...+θnxn
wherein, theta is a characteristic weight vector, and x is a characteristic vector;
introducing a sigmoid function corresponding formula as follows:
Figure BDA0003399260610000031
mapping any real number input into a [0, 1] interval through a sigmoid function, obtaining a predicted value in a linear regression Z, mapping the predicted value into the sigmoid function, and completing the conversion from the value to the probability, so that an assumed function h theta (x) of the logistic regression is a probability value corresponding to y ═ 1, and is expressed as:
p(y|x;θ(x))=(hθ(x)y(1-hθ(x))1-y
wherein, when h θ (x) > - [ 0.5 ], y is predicted to be 1, and when h θ (x) <0.5, y is predicted to be 0.
Further, the building of the logistic regression precipitation occurrence model specifically includes:
integrating the probability of the assumed function of the logistic regression, and setting a cost function:
p(y|x;θ(x))=(hθ(x)y(1-hθ(x))1-y
wherein y is equal to 0 or 1;
for all samples, m is the number of samples, resulting in a corresponding likelihood function:
Figure BDA0003399260610000032
finally solving a maximum likelihood function, and carrying out logarithm processing on the likelihood function:
Figure BDA0003399260610000033
in this case, the maximum value is determined, and for the conversion into a gradient descent task, the formula is introduced:
Figure BDA0003399260610000034
finally, a cost function is solved:
Figure BDA0003399260610000041
in the gradient descent process, the cost function is subjected to partial derivation by using a chain rule to obtain a gradient:
Figure BDA0003399260610000042
wherein j is the jth characteristic, j (0.. n), and n is the number of the characteristics;
the formula of the gradient descent function is:
Figure BDA0003399260610000043
wherein α is a learning rate;
inputting a training sample set into a logistic regression function, training a logistic regression rainfall prediction model by adopting a gradient descent algorithm, adaptively adjusting the learning rate by adopting an Adagarad optimization algorithm to perform model tuning, and outputting a rainfall label; the Adagrad optimization algorithm formula is as follows:
Figure BDA0003399260610000044
where t is the number of rounds to calculate the gradient, Gt,jFor the sum of squares of the gradient from the first round to the tth round, ∈ is a smoothing term to avoid the denominator being 0, gt,jThe gradient of the jth feature of the tth round.
Further, the radial basis function neural network specifically includes:
the radial basis function neural network is composed of an input layer, an output layer and a hidden layer 3; after the input layer node obtains the input vector, transmitting the input vector to the hidden layer; the hidden layer node is composed of radial basis functions, the radial basis functions adopt Gaussian functions, the hidden layer executes nonlinear transformation, and an input space is mapped to a new space; the output layer is a linear function; the hidden layer node and the output layer node are completely connected with different weights; the activation function of the hidden layer node generates a local stress on the input excitation, and the closer the input vector is to the center of the radial basis function, the greater the stress made by the hidden layer node is; the output stress of the jth node of the hidden layer is as follows:
Figure BDA0003399260610000045
wherein x is an input vector of dimension N; c. CjThe central value of the jth function has the same dimension as the input vector x; sigmajA normalization constant for the width of the jth center point of the basis function; k is the number of hidden layer nodes; i x-cjI is vector cjNorm of (a) represents x and cjThe distance between them; ri(x) Represents the stress of the jth basis function on the input vector, at cjTakes a unique maximum value, and Ri(x) Will follow | | x-cjThe increase in | rapidly decays to zero; input layer implementation from x to Ri(x) And the output layer implements the slave Ri(x) To yiThe linear mapping of (a), namely:
Figure BDA0003399260610000051
further, the building of the radial basis function neural network precipitation prediction model specifically includes:
all raw data input into the radial basis function neural network are normalized:
Figure BDA0003399260610000052
when outputting, the data is restored by the following formula:
Figure BDA0003399260610000053
wherein x is an input or output factor; x is the number ofmax、xminThe maximum value and the minimum value of the factor x;
Figure BDA0003399260610000054
for the normalized factor, the data is transformed to [ -1, 1] by this change]An interval;
predicting daily rainfall by using a radial basis function neural network, namely predicting the (n + 1) th-order rainfall by using data of previous n days, regarding the daily rainfall of each month as a discrete time sequence y (t), wherein t is 1,2,3, and regarding a data value of each time point to be related to the previous n time values, namely, a function F is provided to enable the time sequence y (t) to meet y (t) F (y (t-1), y (t-2), and.
The number of neurons in the output layer is determined by the output result, and if the precipitation of two days later is predicted, the number of neurons in the output layer is designed to be 2;
the number of the hidden layer neurons is obtained through training, a radial basis function is established in a newrb () function in a matlabR2016 neural network tool box, when the function establishes an RBF neural network, training is started from 0 hidden layer neurons, and then the number of the hidden layer neurons is gradually and automatically increased until a preset error requirement or a set maximum number of the hidden layer neurons is reached;
the radial basis function neural network has 3 parameters to solve: center, variance, weight between hidden layer and output layer of the basis function;
h training samples are selected as a clustering center Ci(i ═ 1,2, 3.., h); training sample set x to be inputpGrouping by nearest neighbor rule, according to xpEuclidean distance from center Ci will be xpRespective cluster-stations assigned to input samples
Figure BDA0003399260610000061
Performing the following steps; calculating the average value of the training samples in each cluster set to obtain a new cluster center ciIf the new cluster center is not changing, the resulting ciThe central solution is the final basis function center of the radial basis function neural network, otherwise, the clustering set is re-solved, and the central solution of the next round is carried out;
when the basis function is a Gaussian function, the variance σ of the ith basis function centeriComprises the following steps:
Figure BDA0003399260610000062
wherein, cmaxThe maximum distance between the selected centers;
the connecting weight of the neuron between the hidden layer and the output layer is directly calculated by a least square method to obtain:
Figure BDA0003399260610000063
training the function newrb (), using the radial basis neural network function in the MatlabR2016 neural network toolbox; the function is used for designing an approximate radial basis function neural network, and the newrb () function gradually and automatically increases the number of hidden layer neurons from 0 hidden layer neurons until a preset error requirement or a set maximum number of hidden layer neurons is reached, and the format is as follows:
【net,tr】=newrb(P,T,GOAL,SPREAD,MN,DF)
wherein, P is an R-Q dimensional matrix formed by input samples; t is an S-X-Q dimensional matrix formed by target samples; the coarse is the mean square error and is 0 by default; the spread is the distribution density of the radial basis function and is 1 by default; MN is the maximum number of neurons and is defaulted to Q; DF is the display frequency of the training process, and the default is 25; net is the return value, an RBF function, tr is the return value, training record.
The embodiment of the invention also provides a rainfall prediction device based on the neural network, which comprises:
the rainfall data acquisition unit is used for acquiring a rainfall data set;
the rainfall data classification unit is used for constructing a logistic regression rainfall occurrence model based on a logistic regression hypothesis function; dividing the precipitation data set into data of days without precipitation and data of days with precipitation according to a logistic regression precipitation generation model; meanwhile, for the data of the day without precipitation, the predicted no precipitation is output;
the rainfall determination unit is used for constructing a radial basis function neural network rainfall prediction model based on the radial basis function neural network; and inputting the data of the days with precipitation into a radial basis function neural network precipitation prediction model, and outputting the predicted precipitation.
The embodiment of the present invention further provides a computer device, which includes a memory and a processor, where the memory stores a computer program, and the processor implements the following steps when executing the computer program:
acquiring a precipitation data set;
constructing a logistic regression precipitation generation model based on the logistic regression hypothesis function; dividing the precipitation data set into data of days without precipitation and data of days with precipitation according to a logistic regression precipitation generation model; meanwhile, for the data of the day without precipitation, the predicted no precipitation is output;
constructing a radial basis function neural network precipitation prediction model based on a radial basis function neural network; and inputting the data of the days with precipitation into a radial basis function neural network precipitation prediction model, and outputting the predicted precipitation.
Compared with the prior art, the rainfall prediction method, the rainfall prediction device and the computer equipment based on the neural network have the beneficial effects that:
according to the method, the logistic regression and the radial basis function neural network are combined, and the logistic regression and the RBF neural network connection judgment improve the stability and accuracy of prediction. Specifically, after precipitation prediction is graded through a Logistic judgment model method, a Logistic regression precipitation prediction algorithm model is constructed after a precipitation data set is obtained, the data set with a prediction result of 1 is screened through the Logistic regression precipitation prediction model, the data set is substituted into a radial basis function neural network model, error judgment is carried out on the data obtained by carrying out network training and parameter optimization on the data, the data meeting the requirements are output, the parameter optimization is carried out again on the data not meeting the requirements until complete data are output, therefore, inaccurate prediction of the heavy rainstorm condition can be effectively avoided, and the accuracy of precipitation prediction is improved.
Drawings
Fig. 1 is a schematic flowchart of a precipitation prediction method based on a logistic regression-radial basis neural network according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
Referring to fig. 1, in one embodiment, a neural network-based precipitation prediction method is provided, and the method includes:
the method comprises the following steps of firstly, acquiring precipitation data and influence factors thereof, and preprocessing the precipitation data to acquire a data sample set, wherein the influence factors comprise: 850hPa radial wind, latitudinal wind, potential altitude field, relative humidity and specific humidity. It should be noted that the precipitation data and the data related to the influence factors thereof may be downloaded from relevant departments such as the national environmental forecast center and the national weather science data center.
And step two, collecting precipitation data into 0-1 attribute data, dividing the data into experimental data and test data, training a logistic regression precipitation generation model by using the experimental data, inputting the test data into the trained logistic regression precipitation generation model, and classifying the precipitation data.
And step three, outputting a prediction result of no precipitation for a number set (no precipitation day) with a prediction result of 0 according to the logistic regression precipitation occurrence model result: and inputting a Radial Basis Function (RBF) neural network precipitation prediction model to predict the precipitation for a number set (precipitation days) with a prediction result of 1.
And step four, dividing a data set with the prediction result of the logistic regression precipitation prediction model being 1 into experimental data and test data, and performing network design training and parameter optimization on the experimental data set. Radial basis function requires trained parameters: the center and variance of the basis function can be obtained by a k-means algorithm: while the hidden layer to the output layer needs to train the parameter of weight, which can also be solved by formula.
And step five, carrying out error judgment on the network output result and testing the network, outputting data which accord with the error judgment range as a prediction result, and returning the data which do not accord with the error judgment range to the step five until the allowable error is met.
And step six, inputting the test data into the trained RBF neural network rainfall prediction model to predict the rainfall.
And seventhly, outputting the precipitation amount of the precipitation day according to the result of the RBF neural network precipitation amount prediction model.
The rainfall prediction method based on the logistic regression-radial basis function neural network is applied, specifically, the RBF network can approach any nonlinear function with any precision, has global approximation capability, fundamentally solves the local optimal problem of the BP network, has compact topological structure, can realize separate learning of structural parameters, and has high convergence speed; the RBF neural network can determine a corresponding network topological structure according to specific problems, has self-learning, self-organizing and self-adapting functions, has consistent approximability to nonlinear continuous functions, is high in learning speed, can perform large-range data fusion, and can process data at high speed in parallel; compared with the limitation of the BP neural network, the RBF neural network expands the precipitation prediction. The rainfall forecast of the Logistic discrimination model has higher ts scores of weather, light rain and rainstorm and a more stable forecast result than the forecast of the EC mode.
The construction of the logistic regression precipitation occurrence model specifically comprises the following steps:
1) setting up hypothesis functions
The output of the linear regression is noted as:
Z=θTx=θ1x1+θ2x2+...+θmxn
where θ is the feature weight vector and x is the feature vector.
Since the output result of linear regression is continuous in the real number domain, the sigmoid function is introduced with the corresponding formula:
Figure BDA0003399260610000091
when the independent variable value is any real number, the value range is [0, 1], any input is mapped into the [0, 1] interval through the sigmoid function, so that a predicted value is obtained in the linear regression z, and the value is mapped into the sigmoid function, so that the conversion from the value to the probability is completed, therefore, the assumed function of the logistic regression is as follows:
p(y|x;θ(x))=(hθ(x)y(1-hθ(x))1-y
the assumed function h θ (x) of the logistic regression is a probability value corresponding to y being 1, and can be expressed as:
p(y|x;θ(x))=(hθ(x)y(1-hθ(x))1-y
2) setting judgment rules
In general, it is determined that y is predicted to be 1 when h θ (x) > - > 0.5, and y is predicted to be 0 when h θ (x) < 0.5.
3) Setting up a cost function according to the hypothesis function
In the process of calculating the cost function, the probability of the hypothesis function is integrated to obtain:
p(y|x;θ(x))=(hθ(x)y(1-hθ(x))1-y
wherein y is equal to 0 or 1.
4) Obtaining a gradient by partial derivation of the cost function, and constructing a gradient descent function
Since the resulting probability values for each sample are independent, the corresponding likelihood function is obtained for all samples:
Figure BDA0003399260610000101
where m is the number of samples
Finally solving the maximum likelihood function, namely all sample data are solved better and better, and for the convenience of calculation, the logarithm of the likelihood function is:
Figure BDA0003399260610000102
in this case, the maximum value is determined, and for the conversion into a gradient descent task, the formula is introduced:
Figure BDA0003399260610000103
finally, a cost function is solved:
Figure BDA0003399260610000111
in the gradient descent process, the cost function is subjected to partial derivation by using a chain rule to obtain a gradient:
Figure BDA0003399260610000112
wherein j is the jth feature, j (0.. n), and n is the number of features.
The formula of the gradient descent function is:
Figure BDA0003399260610000113
where α is the learning rate.
5) The judgment rule is that the set threshold value is 0.5, if the value of the function value is less than 0.5, the day without precipitation is predicted; otherwise, there are days of precipitation. In this embodiment, after the logistic regression precipitation prediction model is constructed, a training sample set is input into the logistic regression precipitation prediction model to perform model training, so that a precipitation label is output. The model training specifically comprises: inputting the training sample set into the algorithm model; and adaptively adjusting the learning rate and carrying out model tuning. In order to ensure the training effect of the model, when the model is trained by using a gradient descent algorithm, the Adagad optimization algorithm is adopted to carry out model tuning, the learning rate is adaptively adjusted according to the training degree, the learning rate is smaller when the model is closer to the minimum value, and the problem that the model training is too slow because a cost function cannot approach the minimum value or the learning rate is too small because the learning rate is too large is prevented. The Adagrad optimization algorithm formula is as follows:
Figure BDA0003399260610000114
where t is the number of rounds to calculate the gradient, Gt,jFor the sum of squares of the gradient from the first round to the tth round, ∈ is a smoothing term to avoid the denominator being 0, gt,jThe gradient of the jth feature of the tth round.
The construction of the radial basis RBF neural network prediction precipitation model specifically comprises the following steps:
1) the RBF neural network is composed of an input layer, an output layer and a hidden layer 3. And after the input layer node acquires the input vector, transmitting the input vector to the hidden layer. The hidden layer nodes are composed of radial basis functions, which may take a multi-medial form (typically gaussian functions). The hidden layer performs a non-linear transformation that maps the input space to a new space. The output layer is a simple linear function. The hidden layer node and the output layer node are fully connected with different weights. The activation function of the hidden layer node generates a local stress to the input excitation, and the closer the input vector is to the center of the basis function, the greater the stress made by the hidden layer node. The output stress of the jth node of the hidden layer is as follows:
Figure BDA0003399260610000121
wherein x is an input vector of dimension N; c. CjThe central value of the jth function has the same dimension as the input vector x; sigmajA normalization constant for the width of the jth center point of the basis function; k is the number of hidden layer nodes; i x-cjI is vector cjNorm of (a) represents x and cjThe distance between them; ri(x) Represents the stress of the jth basis function on the input vector, at cjTakes a unique maximum value, and Ri(x) Will follow | | x-cjThe increase in | rapidly decays to zero; input layer implementation from x to Ri(x) And the output layer implements the slave Ri(x) To yiThe linear mapping of (a), namely:
Figure BDA0003399260610000122
2) data preprocessing:
the training of the network directly by using the raw data can cause the saturation of the neurons, so that all the raw data input into the RBF network model need to be preprocessed before the modeling prediction is carried out by using the neural network, and the aim of eliminating the difference of the raw data forms is fulfilled. It is common practice to perform a normalization pre-processing on the raw data. The normalization processing method comprises the following steps:
Figure BDA0003399260610000123
when outputting, the data is restored by the following data:
Figure BDA0003399260610000124
wherein x is an input or output factor; x is the number ofmax、xminThe maximum value and the minimum value of the factor x;
Figure BDA0003399260610000125
for the normalized factor, the data is transformed to [ -1, 1] by this change]An interval.
3) Input, output and number of hidden layer neurons
And (3) predicting the daily rainfall by using the RBF neural network model, namely predicting the (n + 1) th-purpose rainfall by using the previous n-purpose data, and regarding the multi-month daily rainfall as a discrete time sequence y (t), wherein t is 1,2 and 3. The data value at each time point is considered to be related to the previous n time values, i.e. there is a function F such that the time series y (t) satisfies y (t) F (y (t-1), y (t-2). After repeated experiments with 10 months of data, the current value is predicted from 4 past values, where n is 4, and therefore the input layer neuron number is set to 6.
And determining the number of neurons in the output layer according to the output result, and if the precipitation of two days later is predicted, designing the number of neurons in the output layer to be 2.
The number of the hidden layer neurons is obtained through training, an RBF neural network can be created through a newrb () function in a matlabR2016 neural network tool box, when the RBF neural network is created, the function starts to train from 0 hidden layer neurons, and then the number of the hidden layer neurons is gradually and automatically increased until a preset error requirement or a set maximum number of the hidden layer neurons is reached.
4) RBF neural network learning algorithm
The RBF neural network has 3 parameters to be solved: basis function center, variance, weight between hidden layer to output layer.
a) The center of the basis function is found using k-means clustering:
h training samples are selected as a clustering center Ci (i ═ 1,2, 3.. h); then the input training sample set xpGrouping by nearest neighbor rule, according to xpAnd center is ciBetween them, xpRespective sets of clusters assigned to input samples
Figure BDA0003399260610000131
Performing the following steps; thereafter, the average of the training samples in each cluster set, i.e. the new cluster center c, is calculatediIf the new cluster center is not changing, the resulting ciThat is, the final basis function center of the RBF neural network, otherwise, returning to the second step to re-obtain the clustering set, and proceeding toAnd (5) solving the center of the next round.
b) Solving the variance, wherein when the base function is a Gaussian function, the variance is as follows:
Figure BDA0003399260610000132
wherein, cmaxThe maximum distance between the selected centers; sigmaiIs the variance of the ith basis function center.
c) The connection weight of the neuron between the hidden layer and the output layer can be directly calculated by a least square method to obtain:
Figure BDA0003399260610000141
5) next, the function newrb (), is trained using the RBF neural network function in the MatlabR2016 neural network toolbox; the function can be used to design an approximate radial basis function neural network, and the newrb () function can gradually and automatically increase the number of hidden layer neurons starting from 0 hidden layer neurons until a predetermined error requirement or a set maximum number of hidden layer neurons is reached. The format is as follows:
【net,tr】=newrb(P,T,GOAL,SPREAD,MN,DF)
wherein, P is an R-Q dimensional matrix formed by input samples; t is an S-X-Q dimensional matrix formed by target samples; the coarse is the mean square error and is 0 by default; the spread is the distribution density of the radial basis function and is 1 by default; MN is the maximum number of neurons and is defaulted to Q; DF is the display frequency of the training process, and the default is 25; net is the return value, an RBF function, tr is the return value, training record.
6) Error determination
In the calculation, the following statistical index values are used in order to evaluate the prediction effect.
a) Mean absolute error
Figure BDA0003399260610000142
b) Mean square error
Figure BDA0003399260610000143
c) Correlation coefficient
Figure BDA0003399260610000144
Wherein, ypi
Figure BDA0003399260610000145
Respectively representing the predicted amount and the average value of the amount, yai
Figure BDA0003399260610000146
The actual values and the distance between the actual values and the average values are respectively, N is the total number of forecasts, and the forecasting accuracy degree can be analyzed and obtained from the comparison of the statistical indexes.
In one embodiment, a neural network-based precipitation prediction device is provided, the device comprising:
and the precipitation data acquisition unit is used for acquiring a precipitation data set.
The rainfall data classification unit is used for constructing a logistic regression rainfall occurrence model based on a logistic regression hypothesis function; dividing the precipitation data set into data of days without precipitation and data of days with precipitation according to a logistic regression precipitation generation model; meanwhile, the data of the precipitation-free days are output to predict the precipitation-free quantity.
The rainfall determination unit is used for constructing a radial basis function neural network rainfall prediction model based on the radial basis function neural network; and inputting the data of the days with precipitation into a radial basis function neural network precipitation prediction model, and outputting the predicted precipitation.
For specific definition of the neural network based precipitation prediction device, reference may be made to the above definition of the neural network based precipitation prediction method, and details are not repeated here. The modules in the neural network based precipitation prediction device can be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
a precipitation dataset is obtained.
Constructing a logistic regression precipitation generation model based on the logistic regression hypothesis function; dividing the precipitation data set into data of days without precipitation and data of days with precipitation according to a logistic regression precipitation generation model; meanwhile, the data of the precipitation-free days are output to predict the precipitation-free quantity.
Constructing a radial basis function neural network precipitation prediction model based on a radial basis function neural network; and inputting the data of the days with precipitation into a radial basis function neural network precipitation prediction model, and outputting the predicted precipitation.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features. Furthermore, the above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A precipitation prediction method based on a neural network is characterized by comprising the following steps:
acquiring a precipitation data set;
constructing a logistic regression precipitation generation model based on the logistic regression hypothesis function; dividing the precipitation data set into data of days without precipitation and data of days with precipitation according to a logistic regression precipitation generation model; meanwhile, for data of days without precipitation, the predicted no precipitation is output;
constructing a radial basis function neural network precipitation prediction model based on a radial basis function neural network; and inputting the data of the days with precipitation into a radial basis function neural network precipitation prediction model, and outputting the predicted precipitation.
2. The neural network-based precipitation prediction method of claim 1, wherein said precipitation dataset comprises: precipitation influence factors; and the precipitation influence factor comprises: 850hPa radial wind, latitudinal wind, potential altitude field, relative humidity and specific humidity.
3. The neural network-based precipitation prediction method of claim 1, wherein the precipitation data set is divided into data for days without precipitation and data for days with precipitation according to a logistic regression precipitation occurrence model, and the steps specifically include:
converting the precipitation data set into 0/1 attribute precipitation data, and dividing 0/1 attribute precipitation data into experimental data and test data; wherein, the 0 attribute precipitation data is data of no precipitation day, and the 1 attribute precipitation data is data of precipitation day;
training a logistic regression precipitation generation model by using experimental data;
and inputting the test data into the trained logistic regression precipitation occurrence model to obtain data of days without precipitation and data of days with precipitation.
4. The neural network-based precipitation prediction method of claim 1, wherein the data of days with precipitation are input into a radial basis function neural network precipitation prediction model, and predicted precipitation is output, and the steps specifically include:
dividing the data of the days with precipitation into experimental data and test data;
training and optimizing parameters of experimental data;
inputting the experimental data after training and parameter optimization into a radial basis function neural network rainfall prediction model, and training the radial basis function neural network rainfall prediction model; taking the output data which accord with the error judgment range as a prediction result, and carrying out parameter optimization on the non-conforming output data again;
and inputting the test data into the trained radial basis function neural network precipitation prediction model, and outputting the predicted precipitation.
5. The method of claim 1, wherein the logistic regression hypothesis function specifically comprises:
the output of the linear regression is noted as:
z=θTx=θ1x12x2+…+θnxn
wherein, theta is a characteristic weight vector, and x is a characteristic vector;
introducing a sigmoid function corresponding formula as follows:
Figure FDA0003399260600000021
mapping any real number input into a [0, 1] interval through a sigmoid function, obtaining a predicted value in a linear regression Z, mapping the predicted value into the sigmoid function, and completing the conversion from the value to the probability, so that an assumed function h theta (x) of the logistic regression is a probability value corresponding to y ═ 1, and is expressed as:
p(y|x;θ(x))=(hθ(x)y(1-hθ(x))1-y
wherein, when h θ (x) > <0.5, y is predicted to be 1, and when h θ (x) <0.5, y is predicted to be 0.
6. The neural network-based precipitation prediction method of claim 5, wherein the constructing of the logistic regression precipitation occurrence model specifically comprises:
integrating the probability of the assumed function of the logistic regression, and setting a cost function:
p(y|x;θ(x))=(hθ(x)y(1-hθ(x))1-y
wherein y is equal to 0 or 1;
for all samples, m is the number of samples, resulting in a corresponding likelihood function:
Figure FDA0003399260600000022
finally solving a maximum likelihood function, and carrying out logarithm processing on the likelihood function:
Figure FDA0003399260600000031
in this case, the maximum value is determined, and for the conversion into a gradient descent task, the formula is introduced:
Figure FDA0003399260600000032
finally, a cost function is solved:
Figure FDA0003399260600000033
in the gradient descent process, the cost function is subjected to partial derivation by using a chain rule to obtain a gradient:
Figure FDA0003399260600000034
wherein j is the jth characteristic, j (0 … n), and n is the number of the characteristics;
the formula of the gradient descent function is:
Figure FDA0003399260600000035
wherein α is a learning rate;
inputting a training sample set into a logistic regression function, training a logistic regression rainfall prediction model by adopting a gradient descent algorithm, adaptively adjusting the learning rate by adopting an Adagarad optimization algorithm to perform model tuning, and outputting a rainfall label; the Adagrad optimization algorithm formula is as follows:
Figure FDA0003399260600000036
where t is the number of rounds to calculate the gradient, Gt,jFor the sum of squares of the gradient from the first round to the tth round, ∈ is a smoothing term to avoid the denominator being 0, gt,jThe gradient of the jth feature of the tth round.
7. The method of claim 1, wherein the radial basis function neural network specifically comprises:
the radial basis function neural network is composed of an input layer, an output layer and a hidden layer 3; after the input layer node obtains the input vector, transmitting the input vector to the hidden layer; the hidden layer node is composed of radial basis functions, the radial basis functions adopt Gaussian functions, the hidden layer executes nonlinear transformation, and an input space is mapped to a new space; the output layer is a linear function; the hidden layer node and the output layer node are completely connected with different weights; the activation function of the hidden layer node generates a local stress on the input excitation, and the closer the input vector is to the center of the radial basis function, the greater the stress made by the hidden layer node is; the output stress of the jth node of the hidden layer is as follows:
Figure FDA0003399260600000041
wherein x is an input vector of dimension N; c. CjThe central value of the jth function has the same dimension as the input vector x; sigmajA normalization constant for the width of the jth center point of the basis function; k is the number of hidden layer nodes; i x-cjI is vector cjNorm of (a) represents x and cjThe distance between them; ri(x) Represents the stress of the jth basis function on the input vector, at cjTakes a unique maximum value, and Ri(x) Will follow | | x-cjThe increase in | rapidly decays to zero; input layer implementation from x to Ri(x) And the output layer implements the slave Ri(x) To yiThe linear mapping of (a), namely:
Figure FDA0003399260600000042
8. the method for predicting precipitation based on the neural network as claimed in claim 7, wherein the constructing of the radial basis function neural network precipitation prediction model specifically comprises:
all raw data input into the radial basis function neural network are normalized:
Figure FDA0003399260600000043
when outputting, the data is restored by the following formula:
Figure FDA0003399260600000044
wherein x is an input or output factor; x is the number ofmax、xminThe maximum value and the minimum value of the factor x;
Figure FDA0003399260600000045
for the normalized factor, the data is transformed to [ -1, 1] by this change]An interval;
predicting the daily rainfall by using a radial basis function neural network, namely predicting the rainfall on the (n + 1) th day by using data on the previous n days, regarding the daily rainfall on a plurality of months as a discrete time series y (t), wherein t is 1,2,3 and …, regarding a data value at each time point as related to the previous n time values, namely, a function F is provided to enable the time series y (t) to satisfy y (t) F (y (t-1), y (t-2), … and (t-n)), after repeated experiments are carried out on data of 10 months, the selected n is 4, namely, the current value is predicted by using the past 4 values, and therefore, the number of neurons in the input layer is set as 6;
the number of neurons in the output layer is determined by the output result, and if the precipitation of two days later is predicted, the number of neurons in the output layer is designed to be 2;
the number of the hidden layer neurons is obtained through training, a radial basis function is established in a newrb () function in a matlabR2016 neural network tool box, when the function establishes an RBF neural network, training is started from 0 hidden layer neurons, and then the number of the hidden layer neurons is gradually and automatically increased until a preset error requirement or a set maximum number of the hidden layer neurons is reached;
the radial basis function neural network has 3 parameters to solve: center, variance, weight between hidden layer and output layer of the basis function;
h training samples are selected as a clustering center Ci (i is 1,2,3 … … h); training sample set x to be inputpGrouping by nearest neighbor rule, according to xpEuclidean distance from center Ci will be xpRespective sets of clusters assigned to input samples
Figure FDA0003399260600000051
Performing the following steps; calculating the average value of the training samples in each cluster set to obtain a new cluster center ciIf the new cluster center is not changing, the resulting ciThe central solution is the final basis function center of the radial basis function neural network, otherwise, the clustering set is re-solved, and the central solution of the next round is carried out;
when the basis function is a Gaussian function, the variance σ of the ith basis function centeriComprises the following steps:
Figure FDA0003399260600000052
wherein, cmaxThe maximum distance between the selected centers;
the connecting weight of the neuron between the hidden layer and the output layer is directly calculated by a least square method to obtain:
Figure FDA0003399260600000053
training the function newrb (), using the radial basis neural network function in the MatlabR2016 neural network toolbox; the function is used for designing an approximate radial basis function neural network, and the newrb () function gradually and automatically increases the number of hidden layer neurons from 0 hidden layer neurons until a preset error requirement or a set maximum number of hidden layer neurons is reached, and the format is as follows:
【net,tr】=newrb(P,T,GOAL,SPREAD,MN,DF)
wherein, P is an R-Q dimensional matrix formed by input samples; t is an S-X-Q dimensional matrix formed by target samples; the coarse is the mean square error and is 0 by default; the spread is the distribution density of the radial basis function and is 1 by default; MN is the maximum number of neurons and is defaulted to Q; DF is the display frequency of the training process, and the default is 25; net is the return value, an RBF function, tr is the return value, training record.
9. A neural network-based precipitation prediction device, comprising:
the rainfall data acquisition unit is used for acquiring a rainfall data set;
the rainfall data classification unit is used for constructing a logistic regression rainfall occurrence model based on a logistic regression hypothesis function; dividing the precipitation data set into data of days without precipitation and data of days with precipitation according to a logistic regression precipitation generation model; meanwhile, for the data of the day without precipitation, the predicted no precipitation is output;
the rainfall determination unit is used for constructing a radial basis function neural network rainfall prediction model based on the radial basis function neural network; and inputting the data of the days with precipitation into a radial basis function neural network precipitation prediction model, and outputting the predicted precipitation.
10. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor when executing the computer program implements the steps of the method of any of claims 1-8.
CN202111494096.8A 2021-12-08 2021-12-08 Rainfall prediction method and device based on neural network and computer equipment Pending CN114169502A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111494096.8A CN114169502A (en) 2021-12-08 2021-12-08 Rainfall prediction method and device based on neural network and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111494096.8A CN114169502A (en) 2021-12-08 2021-12-08 Rainfall prediction method and device based on neural network and computer equipment

Publications (1)

Publication Number Publication Date
CN114169502A true CN114169502A (en) 2022-03-11

Family

ID=80484525

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111494096.8A Pending CN114169502A (en) 2021-12-08 2021-12-08 Rainfall prediction method and device based on neural network and computer equipment

Country Status (1)

Country Link
CN (1) CN114169502A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115166871A (en) * 2022-05-09 2022-10-11 北京信息科技大学 Microwave imager rainfall inversion method based on hybrid neural network
CN116485010A (en) * 2023-03-20 2023-07-25 四川省雅安市气象局 S2S precipitation prediction method based on cyclic neural network

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115166871A (en) * 2022-05-09 2022-10-11 北京信息科技大学 Microwave imager rainfall inversion method based on hybrid neural network
CN116485010A (en) * 2023-03-20 2023-07-25 四川省雅安市气象局 S2S precipitation prediction method based on cyclic neural network
CN116485010B (en) * 2023-03-20 2024-04-16 四川省雅安市气象局 S2S precipitation prediction method based on cyclic neural network

Similar Documents

Publication Publication Date Title
CN109858647B (en) Regional flood disaster risk evaluation and estimation method coupled with GIS and GBDT algorithm
CN111815037B (en) Interpretable short-critical extreme rainfall prediction method based on attention mechanism
CN111563706A (en) Multivariable logistics freight volume prediction method based on LSTM network
CN115270965B (en) Power distribution network line fault prediction method and device
CN112149898B (en) Training of failure rate prediction model, failure rate prediction method and related device
CN111665575B (en) Medium-and-long-term rainfall grading coupling forecasting method and system based on statistical power
CN114169502A (en) Rainfall prediction method and device based on neural network and computer equipment
CN111723929A (en) Numerical prediction product correction method, device and system based on neural network
CN109143408B (en) Dynamic region combined short-time rainfall forecasting method based on MLP
CN112330027B (en) Search engine index-based power load prediction method
CN114444378A (en) Short-term power prediction method for regional wind power cluster
CN108802857A (en) A kind of Meteorology Forecast System based on meteorological data
Vuyyuru et al. A novel weather prediction model using a hybrid mechanism based on MLP and VAE with fire-fly optimization algorithm
CN113128769A (en) Intelligent flight delay prediction method based on deep learning
CN114897204A (en) Method and device for predicting short-term wind speed of offshore wind farm
CN112836937A (en) Flood disaster loss evaluation method based on entropy weight and BP neural network technology
CN110738363A (en) photovoltaic power generation power prediction model and construction method and application thereof
CN117290673A (en) Ship energy consumption high-precision prediction system based on multi-model fusion
CN115454988B (en) Satellite power supply system missing data complement method based on random forest network
CN117131654A (en) Target observation method based on nonlinear optimal disturbance of pre-analysis initial guess condition
CN115600498A (en) Wind speed forecast correction method based on artificial neural network
CN116663404A (en) Flood forecasting method and system coupling artificial intelligence and Bayesian theory
Naik et al. Rainfall prediction based on deep neural network: a review
CN115423091A (en) Conditional antagonistic neural network training method, scene generation method and system
CN114626594A (en) Medium-and-long-term electric quantity prediction method based on cluster analysis and deep learning

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination