Rainfall Analysis and Forecasting Using Deep Learn
Rainfall Analysis and Forecasting Using Deep Learn
Keywords
Rainfall Prediction, Deep Learning, ANN, RNN, Long Short-Term Memory
1. Introduction
Rainfall Prediction will always help to make decisions on agriculture, fisheries, forestry, tourism, etc. Monsoon plays a signif-
icant 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
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-
lection and analysis of weather and climate data. Rainfall is computed based on various attributes, like Temperature, Humid-
ity, Atmospheric Pressure, Evaporation, Sunshine, and Rainfall Amount(mm)–Hourly, Monthly, Annual, etc. Nowadays, artifi-
cial 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-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.
2. Literature Survey
Dash, Y. et al. [1] has used three artificial intelligence approaches like K-Nearest Neighbor (KNN), Extreme Learning Machine
(ELM), and Artificial Neural Network (ANN), for seasonal forecasting of the monsoon. These three techniques were used for
predicting rainfall for the Kerala subdivision. The author found that the Extreme Learning Machine shows better performs as
compared to KNN and ANN. ELM structure (8-25-1) gives better predictive accuracy with minimal Mean Absolute Percentage
Error for both summer monsoon (June-September) and post-monsoon(October-December).
Kashiwao, T., et al. [2] proposed a model to predict local rainfall in the region of Japan. Data were collected from the Ja-
pan Meteorological Agency(JMA). The proposed model automatically collected meteorological data of temperature, atmos-
pheric pressure, vapor pressure, amount of precipitation, wind velocity, and humidity. Two methods, such as Multi-layer Per-
ceptron (MLP) and Radial Basis Function Network(RBFN), were used for rainfall prediction. The result of this study showed that
the MLP model was superior to that of the RBFN model for rainfall prediction.
Nurcahyo, S. et al. [3] conducted research on the weather forecast of rainfall over Kemayaran Jakarta. The system was
built using a combined hybrid Genetic Algorithm(GA) and Partially Connected Feedforward Neural Network(PCFNN) to predict
rainfall for 7 days ahead in Kemayaran Jakarta. Rainfall was predicted with 81.52 % accuracy.
Dash, Y. et al. [4] in this study, artificial Intelligent (AI) Methods such as Extreme Learning Machine (ELM) and Single Layer
Feed-Forward Network (SLFM) were used to predict Summer Monsoon in Kerala. Results of this study showed that ELM shows
better results as compared to SLFM. The performance of these techniques was evaluated based on Mean Absolute Error and
Root Mean Squared Error.
Dutta, P. S. et al. [5] proposed a model using data mining techniques for monthly rainfall prediction over Assam. Statisti-
cal technique - Multiple Linear Regression was used for prediction. The performance of the proposed model was measured in
adjusted R-squared. 63% accuracy obtained using the given model.
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-
ta in previous years according to crop season like Rabi, Kharif, Zaid was considered for future prediction of rainfall. Linear Re-
gression model was used for the early prediction of Rainfall.
A. kala et al. [8] in this 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 pre-
dicting 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 pro-
duces 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 Percep-
tron-Feedforward Neural Network (MLP-FFN). The proposed model predicted rainfall with 89.54% accuracy.
Sulaiman, 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. Per-
formance 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 Recur-
rent 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 tech-
niques such as MLP and Auto-Encoder NN were used for predicting rainfall. In this study, the CNN technique was used for tak-
ing input from past data. Performance of these techniques evaluated using MSE and RMSE.
Kashiwao, T., 2000-2012 MLP, Back-propagation, Temperature, Humidity, Total hit rate,
et al. (2017) (Japan) Random Optimization , Atmospheric Pressure, Hit rate of precipitation, and Hit rate of
[2] RBFN Amount of Precipitation, non-precipitation,
Vapor Pressure, and Overlooking rate, Swing and miss rate,
Wind Velocity Caching rate,
Confusion Matrix
Nurcahyo, S. 2007-2012 Hybrid Genetic Algorithm, Air Pressure, Tempera- Mean Absolute Percentage Error (MAPE)
et al. (Kemayoran Jakarta- PCFNN ture, Humidity, Wind Testing
(2014) [3] Indonesian) Speed, Length of Sun
Shines , Rainfall Intensity
Dutta, P. S. 2007-2012 Multiple Linear Regression Max Temperature, Min Adjusted R-squared
et al. (Assam) Temperature, Mean Sea
(2014) [5] Level, and Wind Speed
Haidar, A. Jan 1909-Dec 2012 Deep Convolution Neural Rainfall, Minimum Tem- MAE, RMSE, r, NSE
et al. (eastern Australia- Network (CNN), Mul- perature, Maximum
(2018) [6] Innisfail) ti-Layered Perceptron Temperature
(MLP)
Chatterjee, S. 1989-1995 HNN, K-mean Clustering, Maximum Temperature, F-measure, Accuracy, Precision, Recall
et al. ( Southern part of MLP-FFN Minimum Temperature
(2018) [11] West Bengal India) Minimum and Maximum
Pressure, Minimum and
Maximum Vapor Quan-
tity, Minimum Relative
Humidity, Maximum
Relative Humidity,
Poornima, S. 1980-2014 Intensified LSTM, ARIMA, Max Temperature, Min Accuracy, RMSE, loss, LR: Learning rate of
et al. (Hyderabad) RNN, LSTM, ELM, Temperature, Wind network, No. of epochs
(2019) [15] Holt-Winters Speed, Sunshine, Mini-
mum and Maximum
Relative Humidity, Evap-
otranspiration, Rainfall
3. Methodology
A rainfall prediction model illustrated in the Figure 1. A rainfall dataset has collected in the first step.
3.1. Dataset
The Rainfall dataset has downloaded from the data.gov.in website. 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.
Where Y represents normalized data, y is the actual value of rainfall data to be normalized, y min represents minimum
value of rainfall data, y max represents max value of rainfall data respectively.
4. Techniques
Algorithm
Training dataset {(x1, t1), (x2, t2), .... (xn, tn)} given as input.
Return Output with trained ANN.
1. The first step is to initialize the weight in the network.
2. Repeat
For several epochs:
Process training data(Xn)
Calculate output(O)
Compare target output(T) with predicted output(O)
Calculate error(target output - calculated output) at the output layer.
BackPropogate error and update the weights in the network.
end
3. Until desired output obtained
4. return (Trained ANN)
Forget Gate determines which information is no longer required and will be thrown away from the block. Forget gate(f t)
takes the output of the old state and the input and multiply it with respective weights, and output is passed it through
the sigmoid activation to cell state.
ft = 𝜎(wf xt + uf ht-1 + bf) (5)
Input Gate determines which input values are to be written to the memory state. The input gate(i t) takes input from the
previous timestamps and the new input and passes it through sigmoid activation. The v alue of it then multiply with c' t
and result of this is then add to the cell state.
it = 𝜎(wi xt + ui ht-1 + bi) (6)
c't = 𝑡𝑎𝑛ℎ(wcxt + ucht-1 + bc) (7)
In the next step the value of new cell state 'c t' is obtained by first multiplying 'ct-1' i.e. old cell state by forget gate(f t), and
then by adding 'i t*c't'.
ct = ft * ct-1 + it * c't (8)
Output Gate(ot) determines which output is to be generated based on the current internal cell state.
ot = 𝜎(woxt + uoht-1 + bo) (9)
After calculating the values of o t result of the output gate is multiplied with the cell state and passes through tanh acti-
vation.
ht = ot * + tanh(ct) (10)
5. Performance Measures
The Mean Absolute Percentage Error (MAPE%) and Root Mean Square Error (RMSE%) have used for evaluating the perfor-
mance of the built model. The accuracy metrics used to measure the results of the techniques are presented in Equation 11
1
RMSE = √ ∑𝑛𝑖=1( 𝐴𝑖 − 𝑃𝑖 )2 (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.
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.
The average monthly rainfall for all years (From 1940-2017) of the Karnataka Subdivision is shown in Figure 5. In which Jun,
July, August month have the highest rainfall, September, October, May month has moderate rainfall, and January, Feb, Mar,
Apr, Nov, Dec month has the lowest rainfall.
As shown in figure 6. FNN gives 109.6% mean absolute percentage error, RNN gives 99.5% error and LSTM prediction model
gives 79.0% error.
7. Conclusion
In this study deep learning techniques are used for predicting monthly rainfall over Karnataka subdivision. The results show
that the LSTM optimized deep learning technique shows better predictive outcomes. The results of the ANN and RNN model
were compared with the performance of LSTM. The performance of these three techniques has evaluated with the help of
accuracy matrices. The LSTM model shows better performance with minimum Mean Absolute Percentage Error (0.79), and
Root Mean Squared Error (1.35) for prediction.
References
[1] Dash, Y., Mishra, S. K., & Panigrahi, B. K. (2018). Rainfall prediction for the Kerala state of India using artificial intelligence ap-
proaches. Computers & Electrical Engineering, 70, 66-73.
[2] Kashiwao, T., Nakayama, K., Ando, S., Ikeda, K., Lee, M., & Bahadori, A. (2017). A neural network-based local rainfall prediction sys-
tem using meteorological data on the Internet: A case study using data from the Japan Meteorological Agency. Applied Soft Com-
puting, 56, 317-330.
[3] Nurcahyo, S., & Nhita, F. (2014, May). Rainfall prediction in kemayoran jakarta using hybrid genetic algorithm (ga) and partially
connected feedforward neural network (pcfnn). In 2014 2nd International Conference on Information and Communication Tech-
nology (ICoICT) (pp. 166-171). IEEE.
[4] Dash, Y., Mishra, S. K., & Panigrahi, B. K. (2017, July). Rainfall prediction of a maritime state (Kerala), India using SLFN and ELM
techniques. In 2017 International Conference on Intelligent Computing, Instrumentation and Control Technologies (ICICICT) (pp.
1714-1718). IEEE.
[5] Dutta, P. S., & Tahbilder, H. (2014). Prediction of rainfall using data mining technique over Assam. Indian Journal of Computer Sci-
ence and Engineering (IJCSE), 5(2), 85-90.
[6] Haidar, A., & Verma, B. (2018). Monthly rainfall forecasting using one-dimensional deep convolutional neural network. IEEE Ac-
cess, 6, 69053-69063.
[7] Thirumalai, C., Harsha, K. S., Deepak, M. L., & Krishna, K. C. (2017, May). Heuristic prediction of rainfall using machine learning
techniques. In 2017 International Conference on Trends in Electronics and Informatics (ICEI) (pp. 1114-1117). IEEE.
[8] A. Kala and S. G. Vaidyanathan, "Prediction of Rainfall Using Artificial Neural Network," 2018 International Conference on Inventive
Research in Computing Applications (ICIRCA), pp. 339-342.
[9] Qiu, M., Zhao, P., Zhang, K., Huang, J., Shi, X., Wang, X., & Chu, W. (2017, November). A short-term rainfall prediction model using
multi-task convolutional neural networks. In 2017 IEEE International Conference on Data Mining (ICDM) (pp. 395-404). IEEE.
[10] Rasel, R. I., Sultana, N., & Meesad, P. (2017, July). An application of data mining and machine learning for weather forecasting.
In International Conference on Computing and Information Technology (pp. 169-178). Springer, Cham.
[11] Chatterjee, S., Datta, B., Sen, S., Dey, N., & Debnath, N. C. (2018, January). Rainfall prediction using hybrid neural network ap-
proach. In 2018 2nd International Conference on Recent Advances in Signal Processing, Telecommunications & Computing (SigTel-
Com) (pp. 67-72). IEEE.
[12] Sulaiman, J., & Wahab, S. H. (2018). Heavy rainfall forecasting model using artificial neural network for flood prone area. In IT Con-
vergence and Security 2017 (pp. 68-76). Springer, Singapore.
[13] Kumar, R. S., & Ramesh, C. (2016, August). A study on prediction of rainfall using datamining technique. In 2016 International Con-
ference on Inventive Computation Technologies (ICICT) (Vol. 3, pp. 1-9). IEEE.
[14] Parmar, A., Mistree, K., & Sompura, M. (2017, March). Machine learning techniques for rainfall prediction: A Review.
In International Conference on Innovations in information Embedded and Communication Systems.
[15] Poornima, S., & Pushpalatha, M. (2019). Prediction of rainfall using intensified LSTM based recurrent neural network with weighted
linear units. Atmosphere, 10(11), 668.
[16] Basha, C. Z., Bhavana, N., Bhavya, P., & Sowmya, V. (2020, July). Rainfall Prediction using Machine Learning & Deep Learning Tech-
niques. In 2020 International Conference on Electronics and Sustainable Communication Systems (ICESC) (pp. 92-97). IEEE.
[17] https://en.wikipedia.org/wiki/2019_Indian_floods
[18] Singhal, P., Sharma, P., & Hazela, B. (2019). End-to-end message authentication using CoAP over IoT. In International Conference on
Innovative Computing and Communications (pp. 279-288). Springer, Singapore.
[19] Singhal, P., Sharma, P., & Rizvi, S. (2019). Thwarting Sybil Attack by CAM Method in WSN using Cooja Simulator Frame-
work. International Journal of Engineering & Technology, 8(1.5), 116-125.
[20] Singhal, P., Sharma, P., & Arora, D. (2018). An approach towards preventing iot based sybil attack based on contiki framework
through cooja simulator. International Journal of Engineering & Technology, 7(2.8), 261-267.
[21] Molla, T., Khan, B., & Singh, P. (2018). A comprehensive analysis of smart home energy management system optimization tech-
niques. Journal of Autonomous Intelligence, 1(1), 15-21.
[22] P. Singhal, P. Singh and A. Vidyarthi (2020) Interpretation and localization of Thorax diseases using DCNN in Chest X-Ray. Jour-
nal of Informatics Electrical and Electronics Engineering,1(1), 1, 1-7
[23] M. Vinny, P. Singh (2020) Review on the Artificial Brain Technology: BlueBrain. Journal of Informatics Electrical and Electronics
Engineering,1(1), 3, 1-11
[24] A. Sahani, P. Singh and A. Kumar (2020) Introduction to Blockchain. Journal of Informatics Electrical and Electronics Engineering, 1(1),
4, 1-9
[25] M. Misra, P. Singh (2020) Energy Optimization for Smart Housing Systems. Journal of Informatics Electrical and Electronics Engineer-
ing,1(1), 5, 1-6.
[26] K. Chane, F.M. Gebru, B. Khan (2021) Short Term Load Forecasting of Distribution Feeder Using Artificial Neural Network
Technique. Journal of Informatics Electrical and Electronics Engineering, Vol. 02, Iss. 01,S. No. 002, pp. 1-22, 2021