Artificial Neural Network Models for Rainfall Prediction

— Rainfall prediction is an important meteorological problem that can greatly affect humanity in areas such as agriculture production, flooding, drought, and sustainable management of water resources. The dynamic and nonlinear nature of the climatic conditions have made it impossible for traditional techniques to yield satisfactory accuracy for rainfall prediction. As a result of the sophistication of climatic processes that produced rainfall, using quantitative techniques to predict rainfall is a very cumbersome task. The paper proposed four non-linear techniques such as Artificial Neural Networks (ANN) for rainfall prediction. ANN has the capacity to map different input and output patterns. The Feed Forward Neural Network (FFNN), Cascade Forward Neural Network (CFNN), Recurrent Neural Network (RNN), and Elman Neural Network (ENN) were used to predict rainfall. The dataset used for this work contains some meteorological variables such as temperature, wind speed, humidity, rainfall, visibility, and others for the year 2015-2019. Simulation results indicated that of all the proposed Neural Network (NN) models, the Elman NN model produced the best performance. We also found out that Elman NN has the best performance for the year 2018 (having the lowest RMSE, MSE, and MAE of 6.360, 40.45, and 0.54 respectively). The results indicated that NN algorithms are robust, dependable, and reliable algorithms that can be used for daily, monthly, or yearly rainfall prediction.


I. INTRODUCTION
Accurate prediction of rainfall has been one of the most important area in hydrological research. This is because early warnings of severe weather can help prevent fatalities and harms caused by natural disasters if the prediction is done on time and accurately. Forecasting has been one of the greatest challenges of researchers working on the development of predictive system for rainfall in different disciplines such as weather data mining [1], environmental machine learning [2], operational hydrology [3], and statistical forecasting [4]. Analyzing past rainfall data and using it to predict future rainfall is a complex task that only very robust and effective algorithms can achieve. The physical processes involved in rainfall are usually made up of a number of sub-processes that needs to be put into consideration while modelling rainfall. An accurate modelling of rainfall by a single global model is sometimes not possible [5].
Heavy rainfall prediction is a major challenge for meteorological department as it is closely associated with the economy and life of human. It is a cause for natural disasters like flood and drought which are encountered by people across the globe every year. Accuracy of rainfall forecasting has great importance for countries like Nigeria whose economy is largely dependent on agriculture. Due to dynamic nature of the atmospheric conditions, statistical methods have failed to provide good accuracy for rainfall forecasting. Nonlinearity of rainfall data makes Artificial Neural Network a better technique [6]. The accuracy of rainfall prediction is very important because of the current extreme change in climatic conditions all over the world [4]. Deterministic weather forecasting models have proved to be grossly inadequate and ineffective. They are mostly time consuming. Moreover, they lack the capacity to effectively handle large volume of data [5].
Some techniques have been proposed in the past to overcome the difficulties associated with rainfall prediction. The concept of modular modelling and combining different models has attracted more attention recently in rainfall forecasting. In modular models, several sub-processes are first identified, and then separate models (also called local or expert models) are established for each of them [5]. So far, various modular models have been proposed, depending on soft or hard splitting of training data. Soft splitting means that the dataset can be overlapped, and the overall forecasting output is the weighted average of each local model [7]. Machine learning methods have already proven to be good replacement for traditional deterministic approaches in weather prediction [8].
Artificial Neural Networks (ANN) is one of the most recent advances in machine learning. It has the capability to learn to correctly denote primary data, detect the important features, increase effectiveness of prediction compared to traditional models. ANN also improve the understanding of the significance of data and offers further understanding on the composition of rainfall data [9]. Stimulated by the characteristics of ANN. This paper proposed different Neural Network based approach for prediction of rainfall. Our main contributions in this paper are as stated below: • achieved. The proposed model was evaluated using different performance metrics. • A recent review of state-of-the-art techniques for rainfall prediction is presented. The organization of the rest of this paper is as follows: Section 2 discusses the related works in the field of rainfall prediction. Section 3 explained the proposed methodology used in this work. The presentation of the results and the discussion of the results are in section 4 and section 5 is the conclusion of the paper.

II. RELATED WORKS
This section presents a concise discussion on recent research works done in the field of rainfall prediction. Section one explained that machine-learning algorithms have gained wide acceptance among metrological weather prediction, weather data mining, environmental machine learning, and data scientists for rainfall prediction. In the last few years, several techniques have been proposed to address the challenges associated with rainfall prediction. Sawale and Gupta [10] applied an ANN to predict atmospheric conditions from a dataset that has temperature, humidity, and wind speed as its features. The authors used a hybrid architecture that is made up of Back Propagation Network (BPN) and a Hopfield Network (HN). The approach proposed is able to determine the non-linear relationship that exists between the historical data of parameters: temperature, wind speed, humidity, and others. The shortcoming of their technique is that it does not define the time horizon to which the predictions were made. Luk, Ball, and Sharma [11] proposed an ANN model that is able to recognize the spatio-temporal data needed to attain enhanced accuracy for short-term (5 min 30 min) rainfall prediction in an urban area. The ANN model is used to predict rainfall based on historical rainfall patterns from a series of measurements carried out in a basin study. The findings of the study show that the network that used a lower lag performs better than the ones that use high lag. Beltrn-Castro et al. [12] employed Ensemble Empirical Mode Decomposition (EEMD) for daily rainfall prediction. The original data was divided into a set of simple components. Moreover, a Feed Forward Neural Network (FNN) was applied as a prediction tool to model each component. The model was tested in a case study with rainfall data registered in a meteorological station Only the accumulated precipitation variable from past days was used as input for predictions of daily rainfall of next day which in some cases is not sufficient to predict rainfall accurately.
Abhishek et al. [13] proposed the use of Feed Forward Back Propagation, Layer Recurrent, and Cascaded Feed Forward Back Propagation Neural Networks for predicting the monthly average rainfall in an area of India characterized by monsoon type climate. The authors used the average humidity and average wind speed as explanatory variables. Simulation results indicated that Feed Forward Back Propagation produced the best results. The downside of their work is the meagre data of eight months that was used for the experiment. This is inadequate for ANN to correctly future predict rainfall in an area. Liu, Li, and Dillon [14] applied Naïve Bayes for rainfall prediction after employing genetic algorithms for feature selection of the dataset. Genetic algorithm reduces the complexity of the dataset thereby producing similar or much more better results.
Liu et al. [15] applied Deep Learning model for rainfall prediction using large datasets of about 30 years (1983 to 2012) of environmental records provided by the Hong Kong Observatory (HKO). The proposed system has the ability to predict changes in weather in the next 24 hours. Simulation results indicated that the proposed model produced a very good result compared to previous techniques. The limitation of their work is that the authors did use complex weather datasets such as rainfall data to test the effectiveness and robustness of their method. Grover, Kapoor, and Horvitz [16] applied deep hybrid model with discriminative and generative components for spatio-temporal inferences to forecast weather. Statistical results produced by the model showed that it has better performance were compared to other model such as National Oceanic, and Atmospheric Administration (NOAA) of the United States. Forecasts were made at 6, 12 and 24 hours; however, rainfall is not predicted.

III. METHODOLOGY
Previous section contains a brief discussion of different machine learning models for predicting rainfall. Many of the approaches discussed centers on solving the challenge posed by imbalance data of rainfall and weather condition. However, prediction accuracy and general performance of such algorithms continue to pose a daunting problem to researchers and academicians. To overcome these challenges, we present different Neural Network models for rainfall prediction. This section discusses different Neural Network algorithms used in this study.

A. Feed Forward Neural Network (FFNN)
The FFNN is a very popular neural network. It was developed as a result of the need to develop more efficient artificial neural network that will overcome weaknesses associated with back propagation learning algorithm. The FFNN feeds data from the inputs' layers via the hidden layers to the outputs. The basic reason why it is referred to as feed forward network is that it uses forward propagation. The major strength of the FFNN is their ease of implementation and management. This makes them suitable for approximating any type of input and output representation [17]. The effectiveness of FFNN deeply hangs on the tuning of the weights of the nodes. The discrepancy between the result produced by the FFNN and the forecasted output is finalized after every iteration. As the neural network is separated with regard to their nodes, the training process becomes more controllable. The structure and operation of the FFNN is in Fig. 1. The activation function equation of the ℎ hidden neuron is given in (1): where ℎ is the ℎ hidden neuron, ( ) is the connection function that ensures that the outcome does not change in proportion to a change in any of the inputs among input and hidden layers, is the weight in the ℎ entry in a (K× ) weight matrix, is the K input value.
where is the ℎ output value.

B. Cascade Forward Network
The cascade forward network (CFN) neural networks have some similarities with the FFNN because they also use back propagation algorithm for updating weights. The main difference is that they are made up of a weighted connection to the input of individual level as well as across one level to the successive levels [18]. It was opined that some cascade forward back propagation network can have superior performance compared to FFNN in many cases [19]. One of the striking characteristics of this network is that individual layer of neurons is connected to the entire preceding layer of neurons [20]. The pictorial depiction of CFN is in Fig. 2. The mathematical equation for CFN is stated as: The activation function from the input layer to the output layer is represented as , while the weight from the input layer to the output layer is . In a situation where bias is combined with the input layer, the activation function of each neuron in the hidden layer is represented as ℎ so equation (3) can be expressed as:

C. Recurrent Neural Network (RNN)
RNN is unique class of neural network because of its additional set of feedbacks from the generated output of layer that is hidden in between input and output layers. This layer constitutes the context layer that preserves data among observations [21]. The result of processing in a preceding phase can be carried over and used in the current period phase. This important attribute of the RNN offers a tremendously significant advantage, especially in real-time applications. RNN can have an unrestricted memory level and can therefore learn connections through time in addition to learning via all current possible inputs [22]. The RNN is depicted in Fig. 3. Input to hidden layer is expressed as in (5) as: Here ℎ is the hidden layer at the instance ℎ , moreover, is the function, ℎ is the input to hidden layer of weight matrix, and is the input at instance ℎ . Also, ℎ −1 is the hidden layer at instance − 1, and the bias or threshold value is represented by ℎ . Equation (6) which represents the hidden to output layer is stated as: where the output vector is represented as , the hidden to output layer weight matrix is ℎ , and is the bias or threshold.

D. Elman Neural Network
Elman Neural Network (ENN) can be defined as a feedback neural network that was improved by Elman in 1990. ENN is centred on the study of the backpropagation neural network (BPNN). The architecture of the Elman neural network is generally partitioned into 4 layers: the input layer, the hidden layer, the Undertake layer, and the output layer. The function of undertake layer is to memorize the hidden layer output. Since it is centred on a backpropagation neural network, the output of the hidden layer connects with its input through the delay and memory of undertake layer [24]. The architecture of Elman neural network is shown in Fig. 1.   Fig. 4. Elman NN Architecture [23].
Based on BP network, the output of hidden associates with its input through the delay and storage of undertake layer. This manner of connection is sensitive to historical data, and internal feedback network can enhance the capacity of managing dynamic information. Memorizing the internal state allows it to possess dynamic mapping function, which makes the system have the capacity to acclimate to temporal changes over time characteristics [23].
Assuming with n input, m output, the number of hidden and undertake neurons are r, the weight of input layer to hidden layer is 1 , the weight of undertake layer to hidden layer is ( ) = ( 2 ( ) + 1 ( ( − 1))), where ( ) = ( − 1); F is the hidden layer transfer function, which is commonly used in S-type functions; that is: g is the transfer function of output layer, which is often a linear function; that is: Elman neural network uses BP algorithm to revise weights; the error of network is: where is the output vector of object.

A. Dataset Description
The dataset used for the experiments conducted in this work was obtained from the repository of Kaggle. The dataset is made up of several months and years of rainfall data in India. The dataset is made up of 132 instances and 29 attributes. Some of the features of the dataset used for the prediction include year, month, location id, maximum temperature both in Celsius and Fahrenheit, minimum temperature both in Celsius and Fahrenheit, average temperature both in Celsius and Fahrenheit. Others are humidity, rainfall in MM and inches, maximum wind speed in Miles and KMPH, visibility in Km and miles. All the simulation for this work was done using MATLAB 2018 version. Mean Absolute Scaled Error (MASE): MASE is defined as is a measure of the accuracy of predictions. It is a scalefree error metric that gives each error as a percentage in comparison to a standard mean error.

C. Results and Discussion
This section describes the statistical results of our simulations. Different ANN models were used to classify and predict future rainfall using the dataset. The dataset was divided into a training set (60%) and test set (40%). The individual classifiers were used to train the dataset. Table 1 shows the simulation results of our proposed model in comparison with some models. The results in Table I depicts the yearly prediction error  rates for India for the periods of January to December of  2015, 2016,       From tour simulations, we discovered except for 2017 seasonal rainfall year, the Elman NN produced the best performance for all the years. For 2015 seasonal rainfall, the RMSE, MSE and MAE for Elman were, 6.633, 44.00 and 0.548 respectively. It shows that the Elman NN model rainfall prediction is more accurate than the other NN models compared. For 2016 seasonal rainfall, the RMSE, MSE and MAE for Elman were, 6.844, 44.15 and 0.56 respectively. And just like the one of 2015, the Elman NN model rainfall prediction is more correct when compared to the other NN models compared.
For the 2017 seasonal rainfall, the CFNN model performed better than all the other NN models. Its RMSE, MSE and MAE for were, 6.38, 38.54 and 0.52 respectively. This performance is closely followed by the one of FFNN with RMSE, MSE and MAE for were, 6.38, 40.73 and 0.55 respectively. For the 2018 seasonal rainfall, the RMSE, MSE and MAE for Elman were, 6.360, 40.45 and 0.54 respectively. This is an indication that the Elman NN model rainfall prediction is more correct than the other NN models compared. For the 2019 seasonal rainfall, the RMSE, MSE and MAE for Elman were, 6.47, 41.91 and 0.52 respectively. This shows that the Elman NN model rainfall prediction is more correct than the other NN models compared.
Our findings shows that the Elman NN model performs best in 2018 (having lowest RMSE, MSE and MASE). We therefore conclude that Elman NN is promising Neural Network algorithm for predicting daily, monthly, or yearly rainfall amounts as long as the historical data is accessible.

V. CONCLUSION
Four Neural Network models for predicting rainfall have been proposed in this paper. The four ANN models used for our experiments are FFNN, RNN, Elman NN and CFNN. Our statistical results show clearly that Elman NN model produced superior results compared to other three models compared. It can therefore be deduced that it is better to predict future rainfall by means of Elman NN. In the future, we hope to employ other state-of-the-art algorithms such as deep learning, and hybrid algorithms that fused machine learning models and bio-inspired algorithms such as Bat Algorithm, Genetic Algorithm, Firefly Algorithm, Particle Swarm Optimisation, Moth Flame Optimisation, Grey Wolf Optimisation, and others. Then compare their performance with the NN algorithms propose in this work.