Rainfall prediction using machine learning models in Anantapuramu District, Andhra Pradesh
Abstract
Rainfall is a critical determinant of agricultural productivity and water resource management in India, where approximately 60% of cultivated land relies on monsoon rains.In 2024, India recorded an average annual rainfall of 1190 mm.However, Andhra Pradesh experienced slightly below-average precipitation, receiving only 920 mm.The situation was particularly concerning in the Anantapuramu District a semiarid and drought-prone region where the annual rainfall was limited to just 470 mm.In such vulnerable areas, timely and accurate rainfall forecasting is essential for strategic planning and sustainable agricultural practices.This study aims to forecast monthly rainfall in the Anantapuramu district using historical data from 1988 to 2024.Three models were employed for comparison: the ARIMA (Autoregressive Integrated Moving Average) model, suitable for linear time series forecasting; the Artificial Neural Network (ANN), capable of modeling non-linear dependencies; and the Wavelet-ANN model, which combines wavelet decomposition with ANN to capture both time-frequency and non-linear patterns in the data.Model performance was evaluated using Root Mean Squared Error (RMSE) as the key metric.Among the three, the ANN model exhibited the lowest RMSE value, indicating superior prediction accuracy.These results highlight the effectiveness of ANN in improving rainfall forecasting, which is crucial for enhancing agricultural resilience and mitigating climate-related risks in drought-prone regions like Anantapuramu.
Full Text
Tables and figures are in the full-text PDF.
Introduction
Rainfall is vital in India's agriculture and water resource management, where nearly 60% of the farmland depends on monsoon rains. In 2024, India received an average annual rainfall of 1190mm. Andhra Pradesh experienced slightly below-average rainfall, recording 920 mm. The situation was more concerning in Anantapuramu district, one of the most drought-prone and semi-arid regions in the state, which received only about 470 mm of rainfall. In such droughtprone regions, timely and accurate rainfall prediction becomes essential. For forecasting rainfall, there are several models, but ARIMA plays a crucial role in identifying linear trends in time series data and might miss out some hidden patterns in the data. For finding the complex patterns that are hidden in the data usage of ANN was done in this study and Wavelet-ANN (Artificial Neural Network) was also used for rainfall prediction as it is a powerful modeling technique that combines the time-frequency analysis power of wavelets with the nonlinear learning ability of ANN. This research explored the use of ARIMA, ANN and wavelet modeling for advanced rainfall prediction in Anantapuramu, emphasizing its potential to transform agricultural practices and improve the livelihoods of farmers. Through a detailed analysis of recent climatic data and modeling techniques, we aim to demonstrate the efficacy of wavelet models in addressing the unique challenges faced by this drought-prone region.
Materials and Methods
The monthly rainfall data of the Anantapuramu district of Andhra Pradesh is collected from two sources: from January 1988 to December 2020, the data was obtained from ICRISAT (International Crops Research Institute for the Semi-Arid Tropics), and from January 2021 to December 2024, it was sourced from official government websites such as APWRIMS (https://apwrims.ap.gov.in/).
Training
ANNs are trained using a dataset by adjusting the weights and biases through a process called back propagation, minimizing the difference between predicted and actual outputs.
Formula
For a single-layer feed forward ANN, the output Y can be computed as:
Where, Y is the output of the neuron. 𝑋 𝑖 are the input features. 𝑤 𝑖 are the weights associated with the inputs. 𝑏 is the bias term.
𝑓 is the activation function (e.g., sigmoid, ReLU).
Wavelet Transform Approach
To conduct the wavelet transform, we utilized the Discrete Wavelet Transform (DWT) instead of the Maximal Overlap Discrete Wavelet Transform (MODWT). The DWT was chosen for its straightforward implementation and its ability to facilitate the analysis of the signal across discrete scales.
Implementation
The wavelet transform was performed using the `wt. Filter` function in R, with the following parameters set: Filter: Filter="la8" MODWT: modwt=FALSE Level of Decomposition: level=1
This setup enabled the initial decomposition of the time series data into two main components, the approximation coefficients, which capture low-frequency trends, and the detail coefficients, which reflect high-frequency variations.
Wavelet-ANN:
This approach involves breaking down the time series into various frequency components using the wavelet transform, training separate artificial neural networks on each of these components, and then reassembling the forecasted series through an inverse wavelet transform. This method allows for capturing both linear and nonlinear patterns, thereby enhancing accuracy.
Performance Evaluation Metrics:
To evaluate the models, the following performance metrics were used.
Root Mean Square Error (RMSE):
Measures the square root of the average squared differences between actual and predicted values.
Where, y i and y i ̂are the actual and predicted values of response variable, respectively.
Mean Absolute Error (MAE):
Calculates the mean of absolute differences between predicted and actual values.
Formula
Mean squared error (MSE)
The mean square error (MSE) is the average of the sum of squared error values and is given as,
Where, 𝑌 𝑖 is the actual value, 𝑌 ̂𝑖 is the predicted value and N is the number of observations The descriptive statistics for monthly rainfall in Anantapuramu district were summarized, revealing a mean rainfall of 49.99 mm. However, the median was merely 18 mm, and the mode was 0 mm, indicating that many months experienced little to no rainfall. This disparity, coupled with a positive skewness of 1.8793, suggested a right-skewed distribution, where a few months of high rainfall affected the average significantly. The kurtosis value of 3.90 indicated a leptokurtic distribution, signifying that extreme rainfall events were more frequent than expected. The standard deviation was calculated at 67.98 mm, and the variance was determined to be 4621.64 mm², reflecting a high variability in rainfall.
Results and Discussions
The range between the minimum of 0 mm and the maximum of 395. Further, the ANN model was applied which used past rainfall observations as input with a lag of 12 periods (p=12) to capture temporal dependencies. It features a hidden layer with 10 neurons to model nonlinear relationships and is trained over 22 repetitions to improve performance and minimize over fitting. The architecture is structured as 12-10-1, adjusting 141 weights for optimal forecast accuracy. Additionally, a Wavelet-Artificial Neural Network (Wavelet-ANN) model was employed to enhance forecast accuracy by capturing both short-term fluctuations and long-term trends in the rainfall data. The evaluation of three forecasting models presented in Table 2 demonstrates the performance metrics of ARIMA (5, 0, 1), ANN (12,10)
Conclusion
This study evaluated the performance of various models like ARIMA, ANN, and Wavelet ANN for predicting rainfall in Anantapuram district in Andhra Pradesh. Among the models analyzed, the Artificial Neural Network (ANN) model demonstrated superior accuracy, outperforming the other models based on the performance metrics such as RMSE, MAE and MSE. Diagnostic checks revealed no significant autocorrelation in the residuals of ANN, indicating a good fit. However, the presence of significant nonlinear dependencies in the residuals suggests that while ANN effectively captures much of the underlined structure in the data, sum complex nonlinear patterns may still remain unexplained. Despite this the ANN model remains the most robust and reliable approach for rainfall prediction in Anantapuram District, Andhra Pradesh.
References
- Ajmera TK, Rastogi AK. Artificial neural network application on estimation of aquifer transmissivity. Journal of Spatial Hydrology. 2008;8(2):15-31.
- Bhattacharya B, Price RK, Solomatine DP. Machine learning approach to modeling sediment transport. Journal of Hydrologic Engineering. 2007;133(4):440450.
- Cigizoglu HK. Forecasting of meteorological data by artificial neural networks. In: Advances in Soft Computing: Proceedings of the Sixth International Conference on Neural Networks and Soft Computing, 2002.
- Dabral PP, Murry MZ. Modelling and forecasting of rainfall time series using SARIMA. Environmental Processes. 2017;4:399-419.
- Farajzadeh J, Alizadeh F. A hybrid linear-nonlinear approach to predict the monthly rainfall over the Urmia Lake watershed using wavelet-SARIMAX-LSSVM conjugated model. Journal of Hydroinformatics. 2018;20(1):246-262.
- Fausett L. Fundamentals of neural networks. Englewood Cliffs, NJ: Prentice Hall, 1994.
- Gomes E, Progenio M, Holanda P. Modeling with artificial neural networks to estimate daily precipitation in the Legal Amazon, 2023. Available from: 10.21203/rs.3.rs-3822672/v1.
- Gürsoy Ö, Engin SN. A wavelet neural network approach to predict daily river discharge using meteorological data. Measurement and Control. 2019;52(5-6):599-607.
- Hema Sekhar P, Poola K, Raja Sekhar K, Bhupathi Naidu M. Modelling and prediction of coastal Andhra rainfall using ARIMA and ANN models. International Journal of Statistics and Applications. 2020;5(6):104-110.
- Hussein E, Ghaziasgar M, Thron C, Vaccari M, Jafta Y. Rainfall prediction using machine learning models: Literature survey. 2022. Available from: DOI 10.1007/978-3-030-92245-0_4.
- Mishra CS, P, S, M R, N, K V. Probability analysis and rainfall forecasting using ARIMA model. MAUSAM. 2023;74(4):1081-1092.
- Narasimhareddy K, James A, Gautam S. Rainfall variability in Rayalaseema region of Andhra Pradesh. International Journal of Current Microbiology and Applied Sciences. 2020;9(12):124-131.
- Pandey OP, Somvanshi VK, Agrawal PK, Kalanker NV, Prakash MR. Modelling and prediction of rainfall using artificial neural network and ARIMA techniques. Journal of Indian Geophysical Union. 2006;10(2):141-151.
- Poulton MM. Neural network as an intelligence amplification tool: A review of applications. Geophysics. 2002;67(3):979-993.
- Paul RK, Paul AK, Bhar LM. Wavelet-based combination approach for modeling sub-divisional rainfall in India. Theoretical and Applied Climatology. 2020;139(3):949-963.
- Shoaib M, Shamseldin AY, Melville BW. Comparative study of different wavelet-based neural network models for rainfall-runoff modeling. Journal of Hydrology. 2014;515:47-58.
- Singh B, Rajpurohit D, Vasishth A, Singh J. Probability analysis for estimation of annual one day maximum rainfall of Jhalarapatan area of Rajasthan. Plant Archives. 2012;12:1093-1100.
- Singh VP, Chowdhury PK. Comparing some methods of estimating mean area rainfall. Water Resources Bulletin. 1986;22(2):275-282.
How this paper connects to the literature. Drag to explore, click any node to open that paper.
