Rainfall Analysis and Forecasting Using Deep Learning Technique

Rainfall forecasting is very challenging due to its uncertain nature and dynamic climate change. It's always been a challenging task for meteorologists. In various papers for rainfall prediction, different Data Mining and Machine Learning (ML) techniques have been used. These techniques show better predictive accuracy. A deep learning approach has been used in this study to analyze the rainfall data of the Karnataka Subdivision. Three deep learning methods have been used for prediction such as Artificial Neural Network (ANN) - Feed Forward Neural Network, Simple Recurrent Neural Network (RNN), and the Long Short-Term Memory (LSTM) optimized RNN Technique. In this paper, a comparative study of these three techniques for monthly rainfall prediction has been given and the prediction performance of these three techniques has been evaluated using the Mean Absolute Percentage Error (MAPE%) and a Root Mean Squared Error (RMSE%). The results show that the LSTM Model shows better performance as compared to ANN and RNN for Prediction. The LSTM model shows better performance with minimum Mean Absolute Percentage Error (MAPE%) and Root Mean Squared Error (RMSE%).


Introduction
Rainfall Prediction will always help to make decisions on agriculture, fisheries, forestry, tourism, etc. Monsoon plays a significant role in agriculture production.For countries like India, where agricultural production has been one of the main factors affecting the economy of India, a decent amount of rainfall gives the entire country an economic outlook and boosts the economy.A decent amount of rain enhances crop productivity and also increases water resources.Where an excess amount of rainfall brings a flood, which destroys crops, causes structural damage, threatens human life.In India, floods occurred in 2019 due to excessive rainfall in July and August, which had affected 13 states, Karnataka and Maharashtra were the most Journal of Informatics Electrical and Electronics Engineering (JIEEE) A2Z Journals severely affected states [17].The early prediction of rainfall is therefore essential.Rainfall prediction will help farmers to make decisions on crop production and harvesting, as well as help prevent flooding, protect human lives and resources.
Rainfall forecasting is very challenging due to its uncertain nature and dynamically changing climate.It is an application of science and technology to predict precipitation in advance.It's always been a challenging task for meteorologists.Prediction of precipitation is categorized into short-range prediction and long-range prediction [5].Forecasting is done through the col-   A. kala et al. [8]

Dataset
The Rainfall dataset has downloaded from the data.gov.inwebsite.Dataset has subdivision wise rainfall data.Rainfall data of the Karnataka Subdivision has been used in this study.The dataset period is from 1901 to 2017.Rainfall data from the Jan to Dec has used for prediction purposes.

Data Preprocessing
Initially, the data set contains some missing values.Thus preprocessing data is very impor tant for the accuracy of the model.The missing values are dropped and replaced with the mean value.Data scaling and normalization transform the data into a standardized form.Normalization helps to scale the data of an attribute so that it falls in a s maller range between 0 to 1 or -1 to 1.The min-max normalization method has been used for this study.Input data were normalized using the formula stated below in Equation 1.
Where Y represents normalized data, y is the actual value of rainfall data to be normalized, y min represents minimum value of rainfall data, ymax represents max value of rainfall data respectively.

Training and Testing Data
The Rainfall dataset split into a training and test dataset.

Techniques
Journal of Informatics Electrical and Electronics Engineering (JIEEE) A2Z Journals and Equation 12.
Here, Ai represents actual rainfall value, and Pi represents the predicted rainfall value for the year i. n is the number of years to be predicted.

Result and Discussion
In this study, the performance of FFNN, Simple RNN, and LSTM for monthly rainfall prediction over Karnataka subdivision of India has evaluated.The performance of these three techniques in terms of MAPE, RMSE has given in this section.Prediction results for monthly rainfall(mm) using LSTM on train data from 1940 to 2010 and on test data from 2011 to 2017 is depicted in Figure 3 and Figure 4. Actual rainfall values has compared with the output of LSTM.
, N. Kr.Shardoor ISSN (Online) : 2582-7006 International Conference on Artificial Intelligence (ICAI-2021) 2 Haidar, A. et al. [6] developed a monthly rainfall prediction model.A deep convolution neural network (CNN) was used for prediction.Performance of the proposed model compared with the first version of the Australian Community Climate and Earth-System Simulator (ACCESS-SI) and Multi-Layer Perceptron (MLP).The proposed model CNN gives better performance for rainfall prediction.Thirumalai, C. et al. [7] presented machine learning techniques for heuristic prediction of rainfall.In this study rainfall da-P.Kanchan, N. Kr.Shardoor ISSN (Online) : 2582-7006 International Conference on Artificial Intelligence (ICAI-2021) 3 Journal of Informatics Electrical and Electronics Engineering (JIEEE) A2Z Journals ta in previous years according to crop season like Rabi, Kharif, Zaid was considered for future prediction of rainfall.Linear Regression model was used for the early prediction of Rainfall.
, loss, LR: Learning rate of network, No. of epochs3.MethodologyJournal of Informatics Electrical and ElectronicsEngineering (JIEEE) A2Z JournalsA rainfall prediction model illustrated in the Figure1.A rainfall dataset has collected in the first step.
From 1940 -2010 data has given to the training phase, and for testing, from 2011 to 2017 rainfall data used.The prediction model first trained using ANN and Simple RNN, then the model was trained with an Long Short Term Memory.The performance of the built model checked with the test dataset.

Figure 3 .
Figure 3. Rainfall Prediction Using LSTM on Training Data.

Figure 4 .
Figure 4. Rainfall Prediction Using LSTM on Test Data.

Figure 5 .
Figure 5. Monthly Rainfall Across All Years.
[20][21][22][23][24][25][26]her and climate data.Rainfall is computed based on various attributes, like Temperature, Humidity, Atmospheric Pressure, Evaporation, Sunshine, and Rainfall Amount(mm)-Hourly, Monthly, Annual, etc. Nowadays, artificial intelligence techniques are booming in the market, are being used for data analysis and prediction purposes in different sectors.In various papers for rainfall prediction different Data Mining and Machine Learning (ML) techniques have been used.These techniques show better predictive accuracy.A deep learning approach is used in this study to analyze the rainfall data of the Karnataka Subdivision.Deep learning is capable of handling a vast amount of data and is capable of handling complex problems.In this study, a Long Short-Term Memory (LSTM) technique has been used for monthly rainfall prediction of the Karnataka subdivision[20][21][22][23][24][25][26].LSTM is evolved version of RNN.The results of the ANN-FFNN (Feed-Forward Neural Network) and RNN model were compared with the performance of LSTM.
[11]his study model built using Artificial Neural Network (ANN) such as Feed Forward Neural Network (FFNN) for predicting rainfall.Four parameters like Temperature, Cloud Cover, Vapor Pressure, and Precipitation were taken for predicting the rainfall.Root Mean Squared Error (RMSE) and Confusion matrix were used to measured prediction accuracy.The proposed model based on ANN indicates acceptable accuracy.Qiu, M. et al.[9]in this paper, proposed a Multi-Task Convolution Neural Network(MT-CNN) model for rainfall prediction.The proposed approach automatically extracts features from the time series measured at observation sites.Based on multisite features, predicted short term rainfall amount.Rasel, R. et al.[10]presented the performance of machine learning and data mining techniques such as Support Vector Machine (SVR) and Artificial Neural Network (ANN) for weather forecasting.The results of this study showed that ANN produces a better result.Chatterjee, S. et al.[11]proposed a model for rainfall prediction using Hybrid Neural Network (HNN) over west Bengal.Data were collected from Dumdum Meteorological Station.K-mean Clustering and Neural Networks were used to the trained model.Performance of HNN in terms of F-measure, accuracy, precision, and recall compared with Multilayer Perceptron-Feedforward Neural Network (MLP-FFN).The proposed model predicted rainfall with 89.54% accuracy.
[16]iman, J. et al.[12]in this study for precipitation prediction an Artificial Neural Network model was used.The Rainfall data was collected from the local meteorological department.The 80% data used for training and 20% of data were used for testing.Precipitation was predicted using Time Delay Neural Network and Auto-Regressive Integrated Moving Average model.The result of this study showed that TDNN outperformed the ARIMA model.Kumar, R. et al.[13]in this research, the author presented different Data Mining Techniques for rainfall prediction.Performance and comparison of various data mining techniques like Decision Tree, Naive Bayes, K-Nearest Neighbour, Neural Network, and Fuzzy Logic were given.Parmar, A. et al.[14]this paper reviewed different approaches and algorithm such as Artificial Neural Network (ANN) -Back-Propagation Neural Network, Cascade Forward Back Propagation Network, Support Vector Machine (SVR), Layer Recurrent Network, and Self Organizing Map (SOM) for rainfall prediction.Poornima, S. et al.[15]proposed a model for rainfall prediction using Intensified LSTM based RNN.The rainfall dataset of the Hyderabad region was used for prediction.Minimum and Maximum Temperature, Wind Speed, Sunshine, Minimum and Maximum Relative Humidity, Evapotranspiration parameters were used for predicting rainfall.The performance of Intensified LSTM model compared with RNN, LSTM, ELM, Holt-Winters, ARIMA methods.The result of this study shows that Intensified LSTM gives better results as compared to other methods used.Basha, C. Z. et al.[16]in this study, deep learning approach has represented for rainfall prediction.Deep learning techniques such as MLP and Auto-Encoder NN were used for predicting rainfall.In this study, the CNN technique was used for taking input from past data.Performance of these techniques evaluated using MSE and RMSE.Table 1.Different AI and ML Techniques For Rainfall Prediction P. Kanchan, N. Kr.Shardoor ISSN (Online) : 2582-7006 International Conference on Artificial Intelligence (ICAI-2021) 4 Journal of Informatics Electrical and Electronics Engineering (JIEEE) A2Z Journals

Table 2 .
The data collected includes monthly rainfall measurements for 116 years.Keras neural network library has used for implementation.Keras is python based deep learning framework.It is a high-level API of TensorFlow, and it is run on top of TensorFlow.Adam optimizer has been used to train the deep neural network.Adam optimization is an extension of the stochastic gradient descent method to update network weights based on training data.Different combinations of input and hidden layers has examined for predicting rainfall.The performance of three techniques has evaluated with the help of accuracy matrices.As shown inTable 2. LSTM model (12-5-1) shows better performance with minimum Mean Absolute Percentage Error 79.0% and Root Mean Squared Error 135.4% as compared to MLP and Simple RNN for prediction.Prediction Performance