Introduction

Bangladesh is a tropical monsoon-dominated nation with a humid climate characterized by substantial monsoon rainfall and less rainfall during the rest of the year. This country is primarily an agrarian economy, with around 80% (145 million) of its people involved in various agricultural pursuits, directly or indirectly1,2,3. As a result, the effects of climatic fluctuation and change on the country's economic expansion and food security are considerable4,5. Rainfall has great significance as a hydrologic parameter, is a vital feature of climate change, and significantly affects food production, harvesting, human resources, and the natural environment6. Relevant and essential rainfall information, such as daily, weekly, and monthly assessments, are required to maintain an adequate water management system7,8. The historical rainfall trend analysis can make predictions9. Rainfall predicting is a serious concern that has great importance in government and scientific research, plays a significant role in protecting human lives and resources10; and also contributes to water resource management, the production of hydroelectricity, warning of floods and droughts, and urban sewerage systems11,12.

Since the 1950s, the global climate system has seen unprecedented changes, and it is now undeniable that global warming impacts climate13. There are many different temporal and geographical scales at which precipitation variability as a component of climate change occurs. Worldwide studies have shown increasing rainfall variability on a global scale14,15, and the Indian Sub-continent, including India16 and Pakistan17,18. Many studies19,20,21 have examined the spatiotemporal patterns of rainfall in climatic zones across the world22,23,24,25. Some research has been conducted on the semi-regional scale of rainfall variability26,27,28,29. Throughout the past 100 years, the amount of rainfall on Earth has increased by around 2%14, but according to IPCC30, its growth has always been unequal in terms of time and space. Increases in rainfall have been found, in particular, in the Middle East, Central Asia31, Brazil region, the eastern part of America and Canada, and Northern Europe32,33, and Australia34. Ren et al. 35 observed for the annual average rainfall over the Tibetan Plateau in China, similar trends have been seen during the previous few decades, also the same pattern in India33,36, in northwest Pakistan17,18, and in the China-Pakistan Economic Corridor area37. However, the Yellow River Basin, China38, the Mediterranean region29, and Iran have all seen a decline in annual mean rainfall19. A significant upward trend in annual, monsoon, and pre-monsoon rainfalls has lately been found in Bangladesh, according to a growing number of earlier research39,40,41. In the past several decades, additional investigations have declined in the western and northwestregions7,42. Moreover, Hossain et al.43 noted an increasing trend in the mean annual rainfall in the southern coastline area of Bangladesh. Rahman and Islam44 assert a great deal of regional and temporal variation in rainfall. By 2100, monsoon rainfall will rise by 12%, while winter rainfall will reduce by 10% in Bangladesh, according to the Water Resources Planning Organization45,46. Moreover, Basak et al.47 predict a yield decline of between 3.3 and 24.2% and a 10 mm decrease in winter rainfall. According to certain studies, Bangladesh's seasons might see long-term variations in rainfall7,48,49.

Recent years have seen several studies done on rainfall trends around the world17,26,29,31,50,51,52, and in Bangladesh40,42,43,53,54. Most of the studies used the Simple linear trend55, the Mann–Kendall test33,40, the Mann–Kendall and Spearman’s rho tests17,46, Spearman’s rank test23, Pre-Whitening approach57 to detect the rainfall trend. However, combining the Mann–Kendall test and Sen’s Slope estimator (MAKESENS) technique is best for detecting rainfall trends27,58,59. The present study used the Mann–Kendall test and Sen’s slope estimator technique to identify the trend in rainfall. The previous studies focused on several parts of Bangladesh, such as the northern part 42, the South-West coast43,53, eastern Sylhet region56, but this present study was conducted over Bangladesh, exploring rainfall data from 28 weather stations. Previous studies examined fewer weather station data (for example, 12 weather station data used by Endo et al.40, 15 weather stations by Rahman et al. in 201746, and 17 weather stations by Shahid in 2010 60. Few recent types of research have utilized various time frames for various stations54. The previous studies analyzed the rainfall trend for some parts of the year, including the monsoon season39,55,61, the pre-monsoon and monsoon seasons40, and the pre-monsoon and post-monsoon seasons62. However, this study examined yearly rainfall trends with pre-monsoon, monsoon, and post-monsoon seasons. Most previous studies were conducted on annual and seasonalscales26,50. Few studies have analyzed monthly rainfall trends23. However, in Bangladesh, no comprehensive study focuses on monthly rainfall. Also, no previous studies have assessed spatiotemporal rainfall trends in Bangladesh like other studies worldwide36,63. To fill this gap, this present study spatiotemporally examined rainfall trends on a monthly and seasonal scale. The majority of previous research on rainfall predicting has used Linear Regression64, Adaptive Neuro-Fuzzy Inference System (ANFIS)65, Genetic Algorithm (GA)66, Mann Kendall test, Deep Learning Approach, Feed Forward Neural Network (FFNN), Empirical and Dynamical Methods, and Autoregressive Integrated Moving Average (ARIMA)10,11,46,67,68,69,70. Some innovative strategies have been widely used in recent years: wavelet transforms, couple-wavelet neural networks71, genetic algorithms, and uncertainty analysis for rainfall prediction9. Different studies focus on rainfall prediction in Bangladesh using different machine learning models as ARIMA46,72, Weather Research and Forecast (WRF) model73, regression analysis74. These studies are focused on seasonal rainfall, not monthly rainfall. Rainfall usually fluctuates yearly and at various times due to seasonal variations. In time series research, the rainfall amount graph shows fluctuations13. Predicting rainfall is challenging because of rainfall's multidimensional and nonlinear characteristics6,10,11. These approaches predict rain based on its trend nature. Previous studies predict rainfall for 10–15 years based on time series rainfall data27,70. Artificial Neural Networks (ANN) is an inverse traditional meteorological prediction method based on self-adaptive mechanisms75. ANN can predict rainfall with its fluctuated nature76. For a powerful weather predict purpose, artificial neural networks are employed 77. Though few studies used ANN techniques for predicting rainfall, they focus on only seasonal rainfall11,27,78. Banik et al.11 used the ANN technique for predicting rainfall in Bangladesh, but only for monsoon rainfall. The multilayer perceptron (MLP), trained using the BP technique, is the most often used ANN design in hydrologic modelling139. To fill this gap, the present study used the multi-layer perception (MLP) model of the ANN technique to predict monthly and seasonal (pre-monsoon, monsoon, and post-monsoon) rainfall in Bangladesh. ANN's MLP model can handle both low peak and high rainfall values as well as extremely non-linear rainfall data79,80. The use of MLP-based ANN for rainfall prediction yields consistent results10,81,82,83. For more than 48 inputs, the MLP model produces more accurate results84,85. The MLP model of ANN is widely used for predicting rainfall for more than 15 years27.

Based on the aforementioned discussion, the peculiarities of Bangladesh's spatial distribution and temporal rainfall have not yet been the subject of any study. The fundamental limitation is insufficient coverage by meteorological stations or lack of a variety of data sources of the earlier research. Although several studies7,49,62,86 have previously analyzed the regional-level variations in rainfall in Bangladesh over the last decades, no extensive study has been carried out to identify the trend analysis across Bangladesh. For the various regions of Bangladesh, the earlier research solely considered the MK test and change point detection methods employing Pettitt's test. This research also considers a thorough statistical investigation of climate change from the perspective of rainfall patterns. Historical rainfall trend analysis and predicting are critical in many disciplines, including water resource and ecosystem management, and sustainable agriculture planning52. However, the spatiotemporal shifting behavior of rainfall is considerably less accessible in Bangladesh as a tropical monsoon-dominated nation. The current study is, therefore, a step forward in terms of the sub-climatic zones, extended time frame, good data sources, handling missing datasets, quality control through outlier detection, autocorrelation identification and testing homogeneity, and innovative trend analysis with change point detection. This study focused on investigating spatiotemporal analysis and predicting rainfall trends on a seasonal scale across Bangladesh to address this problem. Therefore, the present study aims (a) to identify the spatiotemporal trend in monthly, seasonal, and annual rainfall in Bangladesh using the MAKESENS; (b) to predict monthly and seasonal rainfall till 2030 in Bangladesh using the MLP neural network; (c) to explore the causes of changes in rainfall pattern over Bangladesh. The uniqueness of our study is that it is the first to be conducted in Bangladesh, where we analyzed the spatiotemporal trends and predict in monthly and seasonal (pre-monsoon, monsoon, and post-monsoon) rainfall for a maximum (of 28) weather stations across the country. The prediction of future rainfall patterns for the country is the most distinctive feature of this research, and it will be highly beneficial for managing the country's water resources since rainfall is a crucial hydrological component.

Materials and methods

The study area's hydrological and geological background

Bangladesh is situated in the northeastern region of South Asia, with its standard location lying from 20°34′ to 26°38′ N latitude and from 88°01′ to 92°41′ E longitude (Fig. 1). While the Bay of Bengal is located in the south, the spectacular Mountains can be seen to the north87.

Figure 1
figure 1

The location map of Bangladesh and the spatial distribution of the weather monitoring station, prepared by the authors using ArcGIS software version 10.5, (https://www.esri.com/en-us/arcgis/products); DEM data was derived from Shuttle Radar Topography Mission of USGS, (https://earthexplorer.usgs.gov/).

Tropical cyclones and a humid, warm climate are common across Bangladesh, influenced by pre-monsoon, monsoon, and post-monsoon circulations49. Bangladesh's historical climate has had annual temperatures ranging from 15 to 34 °C, with an average temperature of roughly 26 °C. Bangladesh is a highly rainy nation, with an average annual rainfall of 2200 mm88.

Sources of data and quality checks

We collect rainfall data (1981–2022) from the Bangladesh Meteorological Department (BMD) (http://live.bmd.gov.bd/bn/). Despite Bangladesh having 38 weather monitoring stations, we only consider the rainfall data from 28 of them as they consistently recorded rain over the study period. The selected weather monitoring stations are Bhola, Barisal, Cox’s Bazar, Feni, Khepupara, M. Court, Patuakhali, Rangamati, Sandwip, Sitakunda, Chittagong, Teknaf, Sylhet, Srimongal, Rangpur, Dinajpur, Bogra, Ishurdi, Rajshahi, Jessore, Khulna, Satkhira, Comilla, Chandpur, Dhaka, Faridpur, Madaripur, Mymensingh (Fig. 1). The maximum and minimum temperature, relative humidity, solar radiation, and wind speed data from 1981 to 2020 collect from the Bangladesh Agriculture Research Council (BARC) (http://www.barc.gov.bd/).

This study analyzes rainfall trends in Bangladesh on a monthly and seasonal scale. Bangladesh has three dominant seasons; these are (a) the Pre-monsoon (March–May), (b) the Monsoon (June–October), and (c) the Post-monsoon (November–February)89. The daily rainfall data have been converted to monthly mean rainfall data. Before assessing changes in rainfall, the data must undergo quality control since unreliable outliers might alter trend patterns90. The standard ratio method was used for estimating the missing rainfall data and clustered into three seasons. Multiple Imputation is used to handle outliers that have been detected. Using Durbin-Waston statistics, we examine autocorrelation in rainfall data, and the trend-free pre-whitening (TFPW) method was used to delete the correlation for the trend test. To accurately depict the natural fluctuations in rainfall, we test homogeneity before the trend test.

Missing data estimation

Using a typical ratio to balance the rainfall, the standard ratio approach91 calculates the missing data from neighboring stations. Multiple imputations (MI) are utilized for the missing numbers for which there is no accessible nearby station data. To obtain statistically accurate estimates for missing data, MI, a statistical procedure, comprises three phases92.

Standard ratio approach: the weighting factor in the following equation (Eq. 1) is determined by the ratios between the targeted station and nearby stations:

$$\mathrm{Y }=\frac{1}{n}\sum_{i-1}^{n}\frac{{N}_{s}}{{N}_{i}}{X}_{i}$$
(1)

where \({N}_{s}\) = average of the rainfall data currently available at the target station, \({N}_{i}\) = average of the rainfall data currently available at the ith neighboring station, and the total number of adjacent stations is n.

Outliers detection

The two-sided test's null hypothesis is that there are no outliers in the sample, whereas the alternate hypothesis is that either the lowest or highest number is an outlier. Grubbs' test93 is used to find outliers in the data.

Grubbs’ test: The time series data are ordered (\({x}_{1}, {x}_{2}, {x}_{3}, \dots \dots ..{x}_{n}\)) in ascending order, with \({x}_{1}\) denoting the lowest and \({x}_{n}\) is highest values of data points. The following t-statistic (Eq. 2) is used to check for outliers in the \({x}_{1}\) and \({x}_{n}\) points:

$${T}_{1} = \frac{\overline{x }-{x}_{1}}{s} \, \mathrm{and }{T}_{n}=\frac{{x}_{n} -\overline{x}}{s }$$
(2)

where \({T}_{1}\) is the lowest point t-statistics and \({T}_{n}\) for the highest points, X represents the time series' mean, while s represents its standard deviation. The observed value of Grubbs' statistic \({T}_{Obs}\) for a two-sided test is calculated using Eq. 3.

$${T}_{Obs}=\mathrm{max}\left({T}_{1}, {T}_{n}\right)$$
(3)

When \({T}_{Obs}\) > \({T}_{Crit}\), the Grubbs’ statistic \({T}_{Crit}\) is a critical value, and the null hypothesis is rejected significantly. In this study, the value is assumed to be 5%. The normalized z-scores94,95, are also computed and shown to visualize probable outliers and suspicious data. Any number beyond the predetermined range (− 1.96 and + 1.96) for a 5% significance level is considered suspicious, even if it might not be an outlier.

Autocorrelation identification

Autocorrelation in rainfall data was observed through the Durbin-Waston autocorrelation statistics.

Durbin-Waston statistics: Eq. 4 provides the commonly used formula for Durbin-Waston autocorrelation statistics96.

Durbin-Waston autocorrelation statistics

$$\mathrm{d}=\frac{\sum_{t=2}^{T}{({e}_{t}-{e}_{t-1})}^{2}}{\sum_{t=1}^{T}{e}_{t}^{2}}$$
(4)

If \({e}_{t}\) is the residual given by

$${e}_{t}={P}_{{e}_{t-1}}+ {V}_{t}$$

The experimental observation number, in this case, is T. The range of Durbin-Waston statistics values was 0–4. Only a value of 2 indicates the absence of positive or negative autocorrelation96. According to Ahmad et al.17, the correlation for trend tests was removed using the TFPW method.

Testing homogeneity

Climate data are inhomogeneous for measurement error, changes in the instrument's surrounding areas, and improper human handling97. Before trend analysis, the homogeneity must be checked; otherwise, the findings would show incorrect trends. In this current study, Alexandersson’s standard regular homogeneity test98,99 and Von Neumann’s ratio test100 were used for the homogeneity test.

Alexandersson’s standard regular homogeneity test: is used to look for abrupt shifts in the time series of meteorological and hydrologic information. According to the following equation (Eq. 5), Alexandersson98 suggests the statistic T (k) compares the mean of the first "k" years of the record with that of the latter "n-k" years:

$$T \left(k\right)= k{\overline{z} }_{1}^{2}+\left(n-k\right){\overline{z} }_{2}^{2} \,\text{for k }= 1, 2, 3, \dots ...,\mathrm{ n}$$
(5)

where “\(\overline{X }\)” = mean and “s” = standard deviation for an annual series \({X}_{i}\) (i is the year from 1 to n) with mean “\(\overline{X }\)” and “s”.

Again, \({\overline{z} }_{1}\) and \({\overline{z} }_{2}\) calculated from Eq. 6

$${\overline{z} }_{1}=\frac{1}{k}\sum_{i=1}^{k}\frac{({X}_{i}-\overline{X })}{s}\text{ and }{\overline{z} }_{2}=\frac{1}{(n-k)}\sum_{i=k+1}^{k}\frac{({X}_{i}-\overline{X })}{s}$$
(6)

If a break occurs at year "K", T(k) reaches a maximum quite close to the year k = K. The test statistic \({T}_{0}\) has the following definition (Eq. 7):

$${T}_{0}=\mathrm{max}T\left(k\right), 1<k<n$$
(7)

When \({T}_{0}\) exceeds the dependent on sample size critical value, rejecting the null hypothesis101.

Von Neumann’s Ratio test: was developed by him in 1941100. For an annual series \({X}_{i}\) (i is the year) with mean "X," The ratio of the successive mean squares is what is referred to as "N" given as (Eq. 8):

$$N= \sum_{i=1}^{n-1}({X}_{i}-{X}_{i+1}{)}^{2}/\sum_{i=1}^{n}({X}_{i}-\overline{X }{)}^{2}$$
(8)

The value of N typically falls short of the predicted value when the series is interrupted. The values of N may exceed two if there is a temporary fluctuation in the mean. This test cannot pinpoint the precise location of the break year.

Method for trend analysis

The non-parametric Mann-Kendal (MK)51,102 test was used to find trends in rainfall. The MK test is frequently used to determine trends (if analysis occurs in meteorological data series)50,60,103,104,105,106. MK test is less sensitive to outline and suitable for detecting rainfall trends and has been applied to explore seasonal and annual rainfall trends107. At a 95% confidence level, the trend test was performed for each station, and the Sens slope technique108 was used to evaluate the trend's magnitude105. Data were checked by the tests’ parameters before performing the MK test to find precipitation patterns across the time series from chosen stations.

M–K test

Kendall109 established the MK test, first developed by Mann110, as a nonparametric test for trend identification and a test statistic. A two-tailed MK test is frequently used to determine if an outcome value tends to rise or fall over time.

The MK test treats \({y}_{i}\) and \({y}_{j}\) as two subsets of the time series of the n data, where i and j refer to years. j refers to one added year with i.

As a result, the MK Statistic (S) specified in Eqs. (9), (10), and (11) are as follows58,102.

$$\mathrm{S}=\sum_{j=1}^{n-1}\sum_{j=i+1}^{n}\mathrm{sign}({y}_{j}-{y}_{i})$$
(9)

where,

$$\mathrm{Sign }\left({y}_{j}-{y}_{i}\right)=\left\{\begin{array}{c}1\, if \,{y}_{j}-{y}_{i}>0\\ 0\, if \,{y}_{j}-{y}_{i}=0\\ -1 \,if\, {y}_{j}-{y}_{i}<0\end{array}\right\}$$
(10)

\({\mathrm{y}}_{\mathrm{j}}\) is the yearly value for j year, and \({\mathrm{y}}_{\mathrm{i}}\) is the yearly value for i year (Eq. 10).

$$\mathrm{Var }\left(\mathrm{S}\right)=\frac{\left[\mathrm{n}\left(\mathrm{n}-1\right)\left(2\mathrm{n}+5\right)- \sum_{\mathrm{t}}\mathrm{t}\left(\mathrm{t}-1\right)\left(2\mathrm{t}+5\right)\right]}{18}$$
(11)

In this case, ‘t’ represents the range of any hypothetical tie of sample points. The \(\sum t\) indicates the total of all ties. As a result, the sample size is more than ten, and Eq. 12 estimates the regular standard input 'Z' value.

$$\mathrm{Z}=\left\{\begin{array}{c}\frac{S-1}{\sqrt{Var(S)}} \,if \,S>0\\ 0 \, if \,S=0\\ \frac{S+1}{\sqrt{Var(S)}} \, if \, S<0\end{array}\right\}$$
(12)

The upward (growing) trend is therefore shown by positive values of “Z,” whereas the downward (decreasing) trend is shown by negative values of “Z”111. The significance threshold for the current study was α = 0.05, which had a 95% confidence level.

Sen’s slope estimator

Sen's slope estimator begins by calculating the slope (\({T}_{i})\) of each data pair using Eq. 13108;

$${\mathrm{T}}_{\mathrm{i}}=\frac{{\mathrm{X}}_{\mathrm{j}}-{\mathrm{X}}_{\mathrm{k}}}{\mathrm{j}-\mathrm{k}}$$
(13)

here, i = year = 1, 2, 3, …n.Where \({X}_{j}\) and \({X}_{k}\) stand for the variables' respective times (j > k). In the examination of historical time series, \({T}_{i}\)>0 denotes an upward and \({T}_{i}\)<0 denotes a downward trend.

Method for change point detection

Any trend detection research would be lacking without mentioning when the trend changed97. This stud used the Pettitt test112 and Cumulative Sum test to investigate if any weather stations of annual rainfall include any abruptly changing transition points.

Pettit test: The resulting test statistics are stated in Eq. 14 when the duration of the study period is denoted by t and the shift occurs at m years113.

$${U}_{t, m}=\sum_{i=1}^{m}\sum_{t+1}^{t}sgn({k}_{i}-{k}_{j})$$
(14)

Here, \(sgn({k}_{i}-{k}_{j})\) is calculated from Eq. 15

$$sgn\left({k}_{i}-{k}_{j}\right)=\left\{\begin{array}{ccc}1& if \, ({K}_{i}-{K}_{j})& >1\\ 0& if\, ({K}_{i}-{K}_{j}) & =0\\ -1& if \, ({K}_{i}-{K}_{j})& <1\end{array}\right\}$$
(15)

All randomly generated variables from 1 to m are used to determine \({U}_{t, m}\). Where the test statistic's magnitude is located \({U}_{t, m}\) is largest, the bulk of unique change points are identified (Eq. 16). When \({U}_{t, m}\) is at its highest, the likelihood of a shifting year is assessed (Eq. 17).

$${Z}_{T}=Max{U}_{t, m} 1\le t\le m$$
(16)
$$P=1-exp\left(\frac{-6{Z}_{T}^{2}}{{K}^{2}+{K}^{3}}\right)$$
(17)

The null hypothesis is considered to be rejected if the p-value falls below the significance level.

Cumulative Sum (CUSUM) test: The distribution-free CUSUM test114 determines if variations in the means between two portions of a series are different for an indefinite period. The maximal CUSUM value of the k serves as the test statistic, \({V}_{k}\). Equation 18 is used for calculating \({V}_{k}.\)

$${V}_{k}= \sum_{i=1}^{k}sign({x}_{i}-{x}_{median})$$
(18)

where, k = 1, 2, 3, ….. , n, and \(sign({x}_{i}-{x}_{median})\) is given as Eq. 19.

$$sign\left({x}_{i}-{x}_{median}\right)= \left\{\begin{array}{ccc}-1& if ({x}_{i}-{x}_{median})& <0\\ 0& if ({x}_{i}-{x}_{median})& =0\\ 1& if ({x}_{i}-{x}_{median})& >0\end{array}\right\}$$
(19)

Innovative trend analysis (IAA) methods

The most significant benefit of the IAA over the MK test is that it not requires any presumptions such as non-linearity, serial correlation, and sample sizes115. This widely used IAA115,116 was proposed by Şen117. As for IAA the rainfall data classified into two periods: these are (a) 1981–2000, (b) 2001–2020. First period represents as \({X}_{i}\) (X-axis), and the second period \({Y}_{i}\) (Y-axis). The data shows a stable trend when it is displayed along the 1:1 line. A rising trend was observed when data was plotted above the 1:1 line, and a declining trend was observed when data was plotted under the 1:1 line117,118.

The equation behind IAA119 are (Eq. 20):

$$s= \frac{1}{n}\sum_{i=1}^{n}\frac{10(\overline{y }-\overline{x })}{n}$$
(20)

where, \(\overline{x }\) and \(\overline{y }\) = arithmetic average of \({X}_{i}\) and \({Y}_{i}\) series. n = number of observations. A rising trend is represented by a positive s value, and a descending trend is represented by a negative s value. After that, the indication is multiplied by 10 to compare with the MK test120.

Method for analyzing rainfall changes

The impact of changes in atmospheric circulation on rainfall trend patterns has been measured. Using the Pettit test for the period 1981–2020 in Bangladesh, we first discovered a big shift in the yearly mean rainfall that occurred recently and noted that the change point occurred after 2000. Using the European Centre for Medium Range Weather Forecasts (ECMWF) ERA5 reanalysis data, the two periods before and after the modifications’ respective changes in circulation are then calculated by deducting 1981–2000 from 2001 to 2020.

Method for rainfall prediction

Multilayer Perception (MLP): is an inverse traditional prediction method in meteorology based on self-adaptive mechanisms75 comprised of input, output, and hidden layers. These three layers (Fig. 4) are used for short-term, mid-term, and long-term predicting of meteorological research121. The MLP is the most often used ANN design in hydrologic modelling139, used for short-term rainfall prediction143,144,145, also more than 15 years27.

Input attributes in the prediction model

Previous studies for rainfall prediction using multilayer perceptions used temperature, humidity, solar radiation, and wind speed as rainfall predictors143,144,145. The input attributes as the rainfall predictors are shown in Table 1.

Table 1 Rainfall parameters used in our study and their corresponding measurement units.

We split the entire rainfall dataset into training and testing datasets for the current investigation. After normalizing the data, we used the Multi-layer Perceptron neural network to predict the monthly rainfall using the R software version 4.2.2 (https://www.r-project.org/). We have compiled the rainfall data for Bangladesh from 28 stations. The next step after collecting the normalized data is to train the model using the input data in Matlab version 9.9 (https://www.mathworks.com/products/matlab.html). Only 70% of the input data are used by the algorithm for training. Only 336 of the 480 samples are used for training, and these are chosen at random from the data set. The average monthly rainfall data from 1981 to 2020 are used as an input in this prerdiction method. The output layer consists the predict monthly rainfall. We validate the predicted monthly rainfall of 24 month (2021–2022) with the actual rainfall.

Evaluating the skill score of MLP

We have evaluated the skill score of MLP using K-fold cross validation technique in Python version 3.10.12 (https://www.python.org/). The K-fold cross-validation approach is highly beneficial for analyzing the attributes and variance of the input dataset for an MLP model137. The K-fold cross validation model run over the monthly rainfall of Bangladesh from 1981 to 2020. The cross-validation function and multiple metric evaluation are shown in Fig. 2. Two arrays make up each fold: one is connected to the training set, and the other is related to the test set. Testing and validation consume 30% (144 samples) of the input data.

Figure 2
figure 2

The function of K-fold cross-validation technique and accuracy level of MLP.

To find the optimum MLP model for predicting rainfall, we repeatedly applied the model to the same precipitation datasets. Five evaluations of the model are performed, with each evaluation utilizing a different fold as the validation set. The accuracies for all data from the five arrays are observed 0.894, 0.955, 0.927, 0.819, and 0.887 respectively against the 1.00. The mean accuracy is 0.894, it means 89.4%. The skill score of this MLP model from K-fold cross-validation is more than 89%. Since the MLP model performed well between 1981 and 2020, we may extend its results to the year 2030.

Additionally, we used Root Mean Square Error (RMSE) and correlation methods to assess how well MLP performed in terms of prediction.

Step in 95% range of prediction construction using bootstrap MLPs

The paired bootstrap approach140 was used to calculate model uncertainty in regression models. This study carries an ensemble of more than 1000 model runs using the bootstrapping technique to get the 95% range of the predictions. As shown in Fig. 3, the following is a description of how Prediction Intervals (PI) based on the bootstrap-MLPs approach is constructed:

Figure 3
figure 3

The framework of bootstrap-MLPs based PI constructions.

Step1: Split the original data set \(D= {\left\{\left({X}_{i}, {P}_{i}\right)\right\}}_{i=1}^{N}\) into training \({D}_{train} = {\left\{\left({X}_{i}, {P}_{i}\right)\right\}}_{i=1}^{{N}_{train}}\) and testing \({D}_{test} = {\left\{\left({X}_{i}, {P}_{i}\right)\right\}}_{i=1}^{{N}_{test}}\). Generate B training data sets which are each constructed using pairs bootstrapping method based on the initial training data set \({D}_{train} = {\left\{\left({X}_{i}, {P}_{i}\right)\right\}}_{i=1}^{{N}_{train}}\). Train B MLPs using B bootstrapped training data sets.

Step2: Estimate the true regression \(\widehat{y}({X}_{i})\), model uncertainty , and noise .

(1) The estimate of true regression \(\widehat{y}({X}_{i})\) can be calculated as follows (Eq. 21):

$$\widehat{y}\left({X}_{i}\right)=\frac{1}{B}\sum_{b=1}^{B}{\widehat{y}}_{b}({X}_{i})$$
(21)

where, \({\widehat{y}}_{b}({X}_{i})\) is the prediction value generated by the b thMLP.

(2) The estimate of the variance in the MLP model uncertainty can be obtained from (Eq. 22):

(22)

(3) According to , the variance of the noise can be estimated as follows141 (Eq. 23):

(23)

A set of variances squared residuals \({r}^{2}{(X}_{i})\) are calculated to estimate a model to fit the remaining residuals (Eq. 24):

(24)

Afterward, a new data set \({D}_{{r}^{2}}\) can be built as follows (Eq. 25):

$${D}_{{r}^{2}}=({X}_{i, {r}^{2}}({X}_{i})), i =1, ..... , N$$
(25)

Based on \({D}_{{r}^{2}}\), a separate MLP model can be trained to estimate the variance of the noise . An exponential activation function should be adopted in the new neural network model to ensure a positive variance142.

Step 3 Construct PIs with (1 − a) × 100% Prediction Interval Nominal Confidence (PINC) using the upper and lower boundary of the PI.

In this study, we calculate 80% and 95% intervals. The predicted errors have a normal distribution. A total of 95% and 80% prediction intervals for the h -step prediction is respectively in Eqs. 26 and 27.

(26)
(27)

here, is an estimate of the standard deviation of the h -step prediction distribution.

Multi-layer perceptron strategy

This study used the MLP deep learning approach to predict rainfall. To predict time series, auto-encoders conduct feature extraction in MLP69. First, all non-linear characteristics are extracted from the data using auto-encoders. Figure 4 depicts the suggested methodology's flow.

Figure 4
figure 4

Flow of proposed prediction methodology.

This auto -encoder consists of three layers: Input Layer, Hidden Layer, and Output Layer. Hidden layers performing intermediary computations are shown in Multi-layer Perceptron (MLP) Fig. 5.

Figure 5
figure 5

Input, hidden, and output layers in multilayer perceptron neural network.

Input layer: There are 23 neurons (\({X}_{i}, i=1, 2, 3,\dots .,23.)\) in the input layer. In the input layer, the neurons are arranged in the manner shown in Eq. 28.

$$ a_{(j - 10)}^{1} 1,\,a_{(j - 9)}^{1} 1,\,a_{(j - 8)}^{1} 1,\,a_{(j - 7)}^{1} 1,\,a_{(j - 6)}^{1} 1,\,a_{(j - 5)}^{1} 1,\,a_{(j - 4)}^{1} 1,\,a_{(j - 3)}^{1} 1,\,a_{(j - 2)}^{1} 1,\,a_{(j - 1)}^{1} 1,\,a_{j}^{1} 1,a_{(j - 11)}^{1} 2,\,a_{(j - 10)}^{1} 2,\,a_{(j - 9)}^{1} 2,\,a_{(j - 8)}^{1} 2,\,a_{(j - 7)}^{1} 2,\,a_{(j - 6)}^{1} 2,\,a_{(j - 5)}^{1} 2,\,a_{(j - 4)}^{1} 2,\,a_{(j - 3)}^{1} 2,\,a_{(j - 2)}^{1} 2,\,a_{(j - 1)}^{1} 2,\,a_{j}^{1} 2 $$
(28)

Hidden layer: There are 5 hidden layers altogether. Every neuron is related to every hidden layer. The hidden layer was calculated using (Eq. 29).

$${Y}_{k}= \int {\sum }_{i}{X}_{i}\times {W}_{jk}+{B}_{k}$$
(29)

Here, \({W}_{jk}\) is the weight connecting the i th input layer neuron to the k th neuron of hidden layer. \({B}_{k}\) is the bias adden to k th neuron of hidden layer.

Output layer: In the output layer, there is just one neuron, and its value is calculated using (Eq. 30):

$$Z= \int {\sum }_{m}{Y}_{m}\times {W}_{m}+B$$
(30)

Accuracy measurement

RMSE: The optimal model has a minimal root mean square error (RMSE), which calculates the standard deviation of the random components in the data (Eq. 31).

$$\mathrm{RMSE }= \sqrt{\sum_{t=1}^{n}\frac{{\left[{y}_{t}\left(obs\right)-{y}_{t}(pred)\right]}^{2}}{n}}$$
(31)

PBIAS: The percent of bias is the average tendency for the predicted output to differ from the observed data either more or less. Low PBIAS values (Eq. 32) imply accurate model simulations; the ideal value is 0.0. The index of agreement, which ranges from 0 (no correlation) to 1, assesses the level of model prediction inaccuracy (perfect fit).

$$\mathrm{PBIAS }(\mathrm{\%}) =\frac{\sum_{\mathrm{i}=1}^{\mathrm{N}}({\mathrm{O}}_{\mathrm{i}}-{\mathrm{P}}_{\mathrm{i}})-100}{\sum_{\mathrm{i}=1}^{\mathrm{N}}{\mathrm{O}}_{\mathrm{i}}}$$
(32)

\({O}_{i}\), and \({P}_{i}\) stand for the observed data, simulated data from the model, and observed mean, respectively.

Correlation: are calculated as144 (Eq. 33).

$$R = \frac{\sum_{i=1}^{N}({y}_{t}^{o}-\overline{{y }^{o}})({y}_{t}^{c}-\overline{{y }^{c}})}{\sqrt{\sum_{t=1}^{N}\left[{(y}_{t}^{o}-\overline{{y }^{o}}{)}^{2}\right]\left[{(y}_{t}^{c}-\overline{{y }^{c}}{)}^{2}\right]}}$$
(33)

where \({y}_{t}^{o}\) and \({y}_{t}^{c}\) represent the observed and calculated values at time t respectively, \(\overline{{y }^{o}}\) and \(\overline{{y }^{c}}\) yc represents the mean of the observed and calculated values.

Calculation method for change rates in data from a time series of rainfall

The straightforward statistical approach of percentage change is used to identify the yearly and seasonal rainfall change rates for the pre-change and post-change sites. This technique is pretty straightforward, yet it does its job quite well. Equation 34 is used to compute it.

$$Change\left(\%\right)over period= \left(\frac{Average\, rainfall \,for \,post\, change \,point-Average \,rainfall \,for\, pre \, change \,point}{Average\, rainfall\, of\, pre\, change \,point}\right)\times 100$$
(34)

Methods for rainfall variations

Post-monsoon and monsoon precipitation and moisture divergence for the period 1980–2020 were obtained on 1.25° × 1.25° grids from the European Centre for Medium-Range Weather Forecasts (ECMWF), ERA-5 (http://apps.ecmwf.int/ datasets/data/interim-full-daily). The most current ocean-atmospheric changes reanalysis datasets available from 1980 onwards are in the ERA5-Interim. To evaluate the impact of cloud cover on rainfall variation, a low cloud cover dataset was also constructed from the ECMWF ERA5 data44. The impact of changes in atmospheric circulation on rainfall trend patterns has been measured. First, using the Pettit test for the years 1980 to 2020 in Bangladesh, we found a recent significant change point in the annual mean rainfall and noted that the change point occurred after 2001. Then, using the ECMWF ERA5 reanalysis data, the difference in circulation between the two eras before and after the adjustments is quantified by subtracting 1980–2001 from 2002 to 2020. The spatial maps were created using the GrAd software.

Spatial mapping method

In this work, the Inverse Distance Weighting method was used to interpolate the data to create a spatial rainfall map.

IDW: The IDW interpolation is based on Eq. 35122.

$$F \left(x, y\right)=\sum_{i-2}^{n}{w}_{i}{f}_{i}$$
(35)

When each scatter point is given a weight function \({w}_{i}\). and \({f}_{i}\) are the specified function values at the scatter points. The collection's overall total of scatter points is n.

The weight function's traditional configuration is calculated from Eq. 36 similar as Monir et al.102.

$${{\varvec{W}}}_{{\varvec{i}}}=\frac{{{\varvec{h}}}_{{\varvec{i}}}^{-{\varvec{p}}}}{\sum_{{\varvec{j}}=1}^{{\varvec{n}}}{{\varvec{h}}}_{{\varvec{j}}}^{-{\varvec{p}}}}$$
(36)

Here \({h}_{i}\) is the distance between the scatter and interpolation points. The power parameter, p, is a freely selected positive real value (Eq. 37).

$$\text{Interpolation point }{h}_{i}=\sqrt{{(x-{x}_{i})}^{2}+ {(y-{y}_{i})}^{2}}$$
(37)

where (x, y) stands for the interpolation point's coordinates. and (\({x}_{i},{y}_{i})\) for the coordinates of the scatter point’s coordinate.

Results

Rainfall pattern in Bangladesh

The average annual rainfall in Bangladesh was observed at 2432.6 mm in this study period. The highest average annual rainfall was observed in Teknaf (4212.9 mm) and the lowest in Ishurdi (1466.4 mm). On average, 442.8 mm of rainfall occurs in the pre-monsoon, 1905.3 mm during the monsoon, and 84.5 mm in the post-monsoon.

In Bangladesh, according to data on average rainfall from 1981 to 2020, June to September had the most rainfall (Fig. 6). July recorded the highest average rainfall (520.59 mm). November through February have the least rain (Fig. 6). June, July, August, and September were observed, respectively, 19.2%, 21.7%, 16.7%, and 13.5% of annual rainfall. On the other hand, 1.5% rainfall was recorded in November, 0.4% in December, 0.3% in January, and 1.0% in February (Fig. 6).

Figure 6
figure 6

Monthly mean rainfall (1981–2022) in Bangladesh.

Results on average seasonal rainfall (1981–2020) in Bangladesh are presented in Table 2. Among the 28 monitoring stations, the average pre-monsoon season rainfall is from 279 mm (Satkhira, which is situated in Bangladesh's southwest) to 1076.1 mm (The northeastern region's Sylhet station) (Fig. 1). The most rainfall during the monsoon season (3754.5 mm) was recorded in Teknaf. The lowest rainfall was recorded in Ishurdi (1133.1 mm). During the post-monsoon, the highest rainfall (120.9 mm) was in Cox's Bazar, and the lowest (40.8 mm) was in Rangpur. Compared to earlier seasons, where the monsoon faced excellent rainfall, the post-monsoon season had relatively little rainfall (Table 2).

Table 2 Average seasonal rainfall (1981–2020) in Bangladesh.

Figure 7 shows the spatial distribution of average seasonal rainfall (1981–2020) over Bangladesh. Pre-monsoon rainfall varies, being lowest in the west and most significant in the northeast (Fig. 7a). The northeast and southern regions had the maximum rainfall during the monsoon season (Fig. 7b).

Figure 7
figure 7

Spatial distribution of average seasonal rainfall (1981–2020) in Bangladesh: (a) pre-monsoon rainfall, (b) monsoon rainfall, and (c) post-monsoon rainfall, prepared by the authors using ArcGIS software version 10.5, (https://www.esri.com/en-us/arcgis/products).

In contrast, the northern region has the least rainfall during the post-monsoon season (Fig. 7c). The seasonal changes affect the geographic variation of Bangladesh's average rainfall (Fig. 7).

Monthly rainfall trends

The MK Z values for monthly rainfall (1981–2020) over Bangladesh with a 95% confidence level are presented in Table 3. The negative values represent a decline in rainfall, where Z < − 1 represents the significant negative trend. Similarly, the positive values represent a rising trend in rainfall, and when the value of Z is more than 1, this is a significant rising trend.

Table 3 The trend in monthly rainfall over Bangladesh from 1981 to 2020 (P > 0.05).

According to the MK Z value, a significant amount of monitoring stations has a declining trend in rainfall for all of the months. Figure 8 shows that February observed a declining trend for all monitoring stations. More than 80% of monitoring stations face a declining trend for January, March, August, November, and December. April, May, June, and September observed 60–80% monitoring stations for a declining trend. Also, more than 50% of monitoring stations face a significant declining trend for February and April. On the other hand, only 2 months (July and October) have observed a rising trend for more than 50% of monitoring stations. A significant rising trend (28.6%) was found only for October (Fig. 8).

Figure 8
figure 8

Trend of the monthly rainfall represented as a percentage of the rainfall monitoring stations.

Trends in seasonal rainfall

Over the years 1981 to 2020, the seasonal rainfall MK trend value and projected Sen's slope value are shown in Table 4. All of the monitoring stations have a declining trend for the post-monsoon season. During the pre-monsoon and monsoon, roughly 82% and 75% of the monitoring stations exhibit a declining tendency in rainfall (Table 4).

Table 4 MK trend and estimated Sen’s slope for seasonal rainfall from 1981 to 2020.

During the pre-monsoon, monsoon, and post-monsoon, approximately 43%, 29%, and 82% of monitoring stations have a significant declining trend (Z < − 1) (Table 4). However, just 8% of the monitoring stations that monitored the monsoon saw a discernible growing trend (Table 4).

During the pre-monsoon, the central part of Bangladesh observed a rapid decline in rainfall. There is an upward tendency in the northern (Rangpur), western (Sylhet), eastern (Rajshahi), and far southern (Cox's Bazar) regions. The rest of the areas have a moderate decline in pre-monsoon rainfall (Fig. 9a). For the monsoon season, the rainfall trend varies a little rising in the southern part to declining in northern Bangladesh (Fig. 9b). All of Bangladesh observed a decline in post-monsoon rainfall (Fig. 9c). There is a significant decline rate in the northern (Rangpur), eastern (Rajshahi), and far southern (Cox's Bazar) regions. In contrast, this area significantly rose during the pre-monsoon season (Fig. 9a,c). This is a clear example of the rain delay.

Figure 9
figure 9

Spatial distribution of seasonal rainfall trends over Bangladesh from 1981 to 2020: (a) pre-monsoon rainfall trend, (b) monsoon rainfall trend, and (c) post-monsoon rainfall trend, prepared by the authors using ArcGIS software version 10.5, (https://www.esri.com/en-us/arcgis/products).

Changepoint wise annual variation

On the datasets of seasonal rainfall's pre- and post-change points in each of the weather monitoring stations, we conducted the MK test. MK Z values for pre and post-change points are presented in Table 5.

Table 5 Trend for pre- and post-change points.

There was a significant negative trend observed in the post-change point than the pre-change point. Rainfall declined after the change point in the northern and northwestern regions and raised in the center to the southeastern part of Bangladesh (Fig. 10).

Figure 10
figure 10

Spatial trend in annual rainfall for pre and post-duration of change point: (a) annual rainfall trend, (b) rainfall trend in pre-change point, and (c) rainfall trend in post-change point, prepared by the authors using ArcGIS software version 10.5, (https://www.esri.com/en-us/arcgis/products).

Slope in innovation trend

The innovation trend in annual rainfall observed that there are 86% of weather stations has a declining slope and 14% have a rising slope. Figure 11 shows the weather station-wise innovative trend in annual rainfall.

Figure 11
figure 11

Weather station-wise innovative trend in annual rainfall.

Predicting rainfall in Bangladesh

The traditional predicting method in meteorology, the MLP neural network model is used to predict overall monthly and seasonal rainfall for Bangladesh. Single data set for Bangladesh’s rainfall is produced from the observed 28 station data. Figure 12 shows the decomposition of monthly rainfall data from 1981 to 2020 in an additive time series. The observed values are displayed at the top of this decomposition, while the randomly selected data set is displayed at the bottom. The center of this additive time series decomposition shows the seasonal pattern of this data collection and its tendencies (Fig. 12).

Figure 12
figure 12

Decomposition of additive time series of monthly rainfall data from 1981 to 2020.

The time series plot of different rainfall indicators is shown in Fig. 13. The time series of maximum and minimum temperature, relative humidity, solar radiation, and wind speed are shown along with rainfall in Fig. 13.

Figure 13
figure 13

Time series plot of rainfall indicators in this prediction model.

RMSE and correlation (R), two fundamental scoring measures, are used to assess the suggested model. Using a testing dataset, we assess the proposed model's prediction abilities, and the results are shown in Table 6 below. The results show that the suggested model works well since it reduces all kinds of mistakes.

Table 6 Evaluation of the performance of the proposed model.

The outcomes of the proposed MLP-based rainfall prediction model for forecasting rainfall for the ensuing 24 months are shown in Fig. 14. The outcomes demonstrate that the suggested technique has an accuracy of more than 90% for estimating average rainfall (in mm). On the graph, the blue line shows the amount of average rainfall predicted by the suggested model, while the brown line reflects the actual amount of average rainfall. The suggested model may thus be used to forecast rainfall over the next eight years (till 2030).

Figure 14
figure 14

Evaluation of the model by testing set for 24 months.

The predicted monthly rainfall till 2030 with 95% confidence levels using the MLP technique is shown in Fig. 15. There was a very minimal error in predicted rainfall, the RMSE was less than 12 mm.

Figure 15
figure 15

Predicted monthly rainfall for Bangladesh to 2030.

Though this predicted data set contained rainfall below the baseline (< 0 mm) for a few months, we counted it as no rainfall (0 mm). The predicted monthly rainfall is presented in Table 7.

Table 7 The range of predicted monthly rainfall in Bangladesh till 2030 (95% confidence level).

A significant fluctuation in predicted monthly rainfall is observed from 2021 to 2030. There will be no rain in December and January. It will not rain for a significant number of years for November and February. So, Bangladesh will suffer water scarcity during dry periods till 2030 (November to February). Predicted maximum rainfall for March, April, May, June, July, August, September, and October are observed in 2029, 2026, 2026, 2027, 2027, 2026, 2027, and 2028. The predicted result indicates that there will be much higher rainfall from 2026 to 2029 (Table 7). On the other hand, predicted minimum rainfall for March, April, May, June, July, August, September, and October are observed respectively in 2024, 2024, 2030, 2024, 2025, 2024, 2023, and 2026 (Table 7). The predicted result suggests that comparatively lower rainfall will occur in the first and last quarter of the study period.

The predicted monthly rainfall, converted into seasonal rainfall, is presented in Table 8.

Table 8 Bangladesh’s predicted average seasonal rainfall till 2030.

The maximum predicted rainfall for pre-monsoon, monsoon, and post-monsoon seasons is observed in 2028, 2027, and 2029. On the other hand, the lowest rainfall for these seasons is observed in 2023, 2023, and 2030 respectively.

Reasons for rainfall change

Most areas of Bangladesh experience moderate to heavy convective precipitation; however, when convective rainfall rates were low, more water vapor from the Bay of Bengal was transported to the land surface, which is unfavorable for the production of raindrops (Fig. 16). The mid-central and northeastern parts of the nation saw a drop in mean rainfall during the monsoon season as a result (Fig. 16). The country covers a trivial region with elevated geopotential height change and transports fewer moisture vapors from the Bay of Bengal to the local land masses, responsible for rainfall change44. This is the reason for an increase in yearly rainfall in summer monsoons noticed in the country's northeastern and southeastern parts86. Throughout the nation, the southeasterly breeze was intensified, reducing the intrusions of colder air and decreasing rainfall throughout Bangladesh in the post-monsoon season. The development of the anticyclonic circulation reduces the power of the southeast wind, which in turn strengthen the summer monsoon season and rise warmer air into Bangladesh and ultimately causes an increase in rainfall138. Contrarily, the majority of the areas saw moderate to low mean convective precipitation rates, which to some degree reduced rainfall147. Overall, the number of low clouds has grown throughout the country and neighbor regions27. The few cloud coverings will boost the atmosphere's condensing effect on surface solar radiation, which will reduce the trend in rainfall124. The country as a whole saw a high mean total precipitation rate, except for the west, which caused an inconsistent downdraft pattern and increased the number of clear sky days over the most recent research period (1980–2020). The vast majority of Bangladesh's regions showed a lessening vertically integrated moisture divergence that was brought on by a considerable decrease in rainfall.

Figure 16
figure 16

Spatial variations of differences (A) Low cloud Cover, (B) Mean vertically Integrated Moisture Divergence, (C) Convective Precipitation in monsoon season, (D) Mean convective precipitation rate, (E) Convective rainfall rate in post-monsoon season, (F) Mean total precipitation rate between the recent phase of 2002–2020 and 1980–2001, prepared by the authors using GrADS version 2.2.1 (http://cola.gmu.edu/grads/downloads.php).

Discussion

Evaluation of historical rainfall trends is crucial in many fields, including water resource management, planning for sustainable agriculture, managing ecosystems, and the health sector52. The variability of rainfall trends on monthly and seasonally was thoroughly investigated using the rainfall data from 40 years from 28 observation stations. The statistical analysis reveals that from 1981 to 2020, the highest average annual rainfall was observed in Teknaf (4212.9 mm) and the lowest in Ishurdi (1466.4 mm). From 1958 to 2007, the mean annual rainfall in Bangladesh was 1527 mm to 4193 mm, according to Shahid62. For monthly rainfall, the maximum average rainfall recorded in July was 461.9 mm (21.7% of annual rainfall). 57.6% rainfall was observed from July to August. However, 50% of rainfall was recorded from 1958 to 200739. Compared with much older studies, rainfall during the dry season decreased from the 1950s to the 2010s while monsoon rainfall increased43,49,60,123,124. This fluctuation in rainfall distribution over a year significantly affects changing climatic conditions and agricultural production. The World Bank125 observed it at 2200 mm in the last 30 years, though the present study followed the average annual rainfall in Bangladesh at 2432.6 mm in the previous 40 years. Yousuf and Ahmed48 also observed average annual rainfall in Bangladesh (1948–2011) was 2456.38 mm. It is obvious that from the 1940s to the present, Bangladesh's yearly rainfall average gradually dropped. Throughout the study period, the average rainfall varied from 279 to 1076 mm before the monsoon, 1133 to 3754 mm during the monsoon, and 40 to 120 mm after the monsoon. Minimal different results were observed by the World Bank125 from 1991 to 2020. Rainfall was found to vary in Bangladesh; Islam et al.49 observed that most of the annual rainfall in Bangladesh was recorded in the southern and eastern parts. The southern area has the most significant value of the precipitation concentration index (LCI)44. Shahid and Khairulmaini124 also predict that the southern part will remain slightly subject to normal rainfall conditions. Similarly, the rainfall is higher in the southeast, according to the present study, though it is lower in northwest Bangladesh.

According to the MK Z value, over 80% of monitoring stations face a declining trend for January, February, March, August, November, and December. April, May, June, and September observed 60% to 80% monitoring stations for a declining trend. Almost 77% of stations have a declining tendency, and 23% have a rising trend for monthly rainfall. No previous comprehensive studies focus on the monthly rainfall trend in Bangladesh. In Indian Sub-Continent, Praveen et al.27 found a similar result, a significant negative trend for overall annual rainfall. In this current study, the month of May–July have a mixed pattern of rising and declining trends. Rahman et al.46 observed a mixed pattern of Long-term monthly negative and positive trends from February to September. According to this study, the number of monitoring stations has a marked dropping tendency throughout the pre-monsoon, monsoon, and post-monsoon periods, respectively, 82%, 75%, and 100%. Shahid and Khairulmaini124 also note a falling trend in the precipitation concentration at most locations. Endo et al.40 also found that the frequency of days with light precipitation rises throughout the pre-monsoon season. Shahid39, Endo et al.40, and Zannat et al.41 showed a changing pattern in monsoon rainfall in Bangladesh, and it was increasingly reported by Sing126. Spatiotemporal variation in monsoon rainfall in Bangladesh is also affected by EI-Nino/Southern Oscillation (ENSO)127,128. The findings from far older studies that looked at rainfall trends in Bangladesh between the 1950s and the 2000s are shown different results129,130,131. Those studies found significant positive trends at most weather stations during the post-monsoon and pre-monsoon31,42,43,60,132. However, this study observed that all weather stations have a declining trend in post-monsoon rainfall146. Mullick et al.57 observed that the average rainfall indicates a rising tendency in Bangladesh, except in the winter. However, this present study found only 18% of weather stations in pre-monsoon and 25% of weather stations in the monsoon season, which has a rising trend in rainfall. The trend in annual rainfall is significantly declining after the change point. According to an innovative trend test, 86% of monitoring stations have a declining tendency. Only 14% of stations have a rising trend. The overall trend of rainfall, especially the post-monsoon rainfall in Bangladesh, is declining.

The majority of previous research on rainfall predicting has used Linear Regression, Adaptive Neuro-Fuzzy Inference System (ANFIS), Genetic Algorithm (GA), Mann Kendall test, Deep Learning Approach, Feed Forward Neural Network (FFNN), and Empirical and Dynamical Methods10,11,68,70. These methods never predict the actual scenario of future rainfall. We used the Multilayer perception neural network technique to predict the rainfall not only seasonal scale but also monthly rainfall. Banik et al.11 used the ANN method to predict rainfall, but only during the monsoon season in Bangladesh. A significant fluctuation in predicted monthly rainfall is observed from 2021 to 2030. The maximum predicted rainfall for pre-monsoon, monsoon, and post-monsoon seasons is observed in 2028, 2027, and 2029.

On the other hand, the lowest rainfall for pre-monsoon, monsoon, and post-monsoon seasons will occur in 2023, 2023, and 2030 respectively. Only some studies concluded that there would be no significant trends in Bangladesh124, which shows an irregular pattern in rainfall trends in Bangladesh49,72. In the present study, the predicted results also show anirregular pattern in future rainfall in Bangladesh. Also, Praveen et al.27 predict the upcoming 15 years of rainfall over India in 2020, exhibiting a significant decline in rainfall. An assessment of long-term water availability at various spatiotemporal weighting scales is required as the likelihood of adverse effects of changing climate on water resources rises148. To mitigate the potential impacts of climate change, this research is anticipated to provide insight into the management and development of Bangladesh's agricultural and water resources.

Statistical findings indicate that most rainfall occurs in the monsoon season, of which more than half of annual rainfall occurs from June to August. The pre-monsoon and post-monsoon have very little rainfall. Rainfall is become higher during the monsoon and becomes lower during the post-monsoon. According to a trend test, Bangladesh's rainfall decreases during the post-monsoon season overall while increasing in some areas during the pre-monsoon. According to this phenomenon, Monsson rains appear to occur earlier than expected in a calendar year. Identical changes in monsoon rainfall patterns were also observed in neighboring countries16,86,133. This fluctuation is evident in the changing rainfall pattern over the year, promoting the meteorological drought134. Bangladesh's southern and eastern parts observed healthy rainfall across all seasons, while less rainfall was observed in the western part. Very little rainfall was observed in northern Bangladesh during the post-monsoon. If this process continues in the northern and western parts of Bangladesh, these areas will become drought in recent future. However, groundwater drought already affects northwestern Bangladesh106,135,136. The trend test for monthly rainfall shows that more than 80% station's rainfall declined from November to March and August. Contrary, only the month of July and October have a rising trend for more than 50% of monitoring stations. Bangladesh has a declining trend in rainfall during the post-monsoon; only some areas of northern and southern parts have a rising trend for the pre-monsoon and monsoon, respectively. The post-monsoon rainfall declined over Bangladesh, while pre-monsoon and monsoon rainfall rose for some areas. The predicted result shows the fluctuating rainfall pattern in the upcoming years. Bangladesh's weather sites offer a declining tendency during post-monsoon, and the predicted rainfall fluctuates, which is strong evidence of climate change. Any shortage in rainfall may impact agriculture and groundwater resources. Because agricultural practice depends on water supply, it comes from rainfall or underground sources. Although, the long-term changes in the rainfall pattern are primarily associated with changes in sea surface temperature (SST) and land-surface processes. The atmospheric process is more of a response to the changes in the SST and other slowly varying parameters. This is one of the main limitations of this study and deserves further investigation.

Conclusion

This study uses a monthly and seasonal rainfall dataset to investigate Bangladesh's historical rainfall pattern and projection. The Mann–Kendall, innovative trend analysis, and Sen's Slope Estimator were performed to detect trends in historical rainfall in Bangladesh. A multilayer perception neural network was used to predict future rainfall patterns, and the causes of rainfall changes are also explored in the present study. The following key conclusions are drawn from the current study:

  • Rainfall has a declining trend for the post-monsoon season all over Bangladesh, and it also declines for more than 75% of areas for the other two seasons (pre-monsoon and monsoon). Above 80% of monitoring stations have a declining trend from November to March, particularly August, while more than 50% have a rising trend during July and October. This fluctuation indicates a substantial change in rainfall patterns, especially monsoon rainfall.

  • According to the predictions, future rainfall in Bangladesh will likely follow an erratic pattern. During the prediction period (till 2030), there will be no rain in December and January.

  • An increasing/decreasing convective precipitation rate, enhanced low cloud cover, and insufficient moisture divergence in the Bay of Bengal being transported to the northwest direction may have greatly influenced changes in rainfall in Bangladesh, according to large-scale ocean-atmospheric changes derived from the ECMWF ERA5 reanalysis data

  • This study encountered missing data for several locations across several years, impacting the trend analysis because estimated data can only partially replace actual data. However, further studies are necessary to identify the factors behind the rainfall pattern and will use earth and atmospheric factors with rainfall data to predict rainfall.

  • This study's findings are predicted to impact Bangladesh's water resource management and agricultural planning significantly. Cropping types and patterns that have been developed may need to respond to variations in rainfall patterns.