Spatiotemporal analysis and predicting rainfall trends in a tropical monsoon-dominated country using MAKESENS and machine learning techniques

Spatiotemporal rainfall trend analysis as an indicator of climatic change provides critical information for improved water resource planning. However, the spatiotemporal changing behavior of rainfall is much less understood in a tropical monsoon-dominated country like Bangladesh. To this end, this research aims to analyze spatiotemporal variations in rainfall for the period 1980–2020 over Bangladesh at seasonal and monthly scales using MAKESENS, the Pettitt test, and innovative trend analysis. Multilayer Perception (MLP) neural network was used to predict the next 8 years' rainfall changes nationally in Bangladesh. To investigate the spatial pattern of rainfall trends, the inverse distance weighting model was adopted within the ArcGIS environment. Results show that mean annual rainfall is 2432.6 mm, of which 57.6% was recorded from July to August. The Mann–Kendall trend test reveals that 77% of stations are declining, and 23% have a rising trend in the monthly rainfall. More than 80% of stations face a declining trend from November to March and August. There is a declining trend for seasonal rainfall at 82% of stations during the pre-monsoon, 75% during the monsoon, and 100% during the post-monsoon. A significant decline trend was identified in the north-center during the pre-monsoon, the northern part during the monsoon, and the southern and northwestern portions during the post-monsoon season. Predicted rainfall by MLP till 2030 suggests that there will be little rain from November to February, and the maximum fluctuating rainfall will occur in 2025 and 2027–2029. The ECMWF ERA5 reanalysis data findings suggested that changing rainfall patterns in Bangladesh may have been driven by rising or reducing convective precipitation rates, low cloud cover, and inadequate vertically integrated moisture divergence. Given the shortage of water resources and the anticipated rise in water demand, the study's findings have some implications for managing water resources in Bangladesh.


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 north 87 .
Tropical cyclones and a humid, warm climate are common across Bangladesh, influenced by pre-monsoon, monsoon, and post-monsoon circulations 49 .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 mm 88 .
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 patterns 90 .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 approach 91 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 phases 92 .
Standard ratio approach: the weighting factor in the following equation (Eq. 1) is determined by the ratios between the targeted station and nearby stations: 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' test 93 is used to find outliers in the data.
Grubbs' test: The time series data are ordered ( x 1 , x 2 , x 3 , . . . . . ...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: (1) (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.
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-scores 94,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.
Durbin-Waston autocorrelation statistics If e t is the residual given by 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 autocorrelation 96 .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 handling 97 .Before trend analysis, the homogeneity must be checked; otherwise, the findings would show incorrect trends.In this current study, Alexandersson's standard regular homogeneity test 98,99 and Von Neumann's ratio test 100 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), Alexandersson 98 suggests the statistic T (k) compares the mean of the first "k" years of the record with that of the latter "n-k" years: where " X" = mean and "s" = standard deviation for an annual series X i (i is the year from 1 to n) with mean " X " and "s".
Again, z 1 and z 2 calculated from Eq. 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): When T 0 exceeds the dependent on sample size critical value, rejecting the null hypothesis 101 .Von Neumann's Ratio test: was developed by him in 1941 100 .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): 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 trends 107 .At a 95% confidence level, the trend test was performed for each station, and the Sens slope technique 108 was used to evaluate the trend's magnitude 105 .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.Kendall 109 established the MK test, first developed by Mann 110 , 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.
where, www.nature.com/scientificreports/y j is the yearly value for j year, and y i is the yearly value for i year (Eq.10).
In this case, 't' represents the range of any hypothetical tie of sample points.The 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.
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. 13 108 ; 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 changed 97 .This stud used the Pettitt test 112 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 years 113 .
Here, sgn(k i − k j ) is calculated from Eq. 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).
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 test 114 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 .
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 sizes 115 .This widely (10)   www.nature.com/scientificreports/used IAA 115,116 was proposed by Şen 117 .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 line 117,118 .The equation behind IAA 119 are (Eq.20): where, x and 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 test 120 .
Method for analyzing rainfall changes.Method for rainfall prediction.Multilayer Perception (MLP): is an inverse traditional prediction method in meteorology based on self-adaptive mechanisms 75 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 research 121 .The MLP is the most often used ANN design in hydrologic modelling 139 , used for short-term rainfall prediction [143][144][145] , also more than 15 years 27 .
Input attributes in the prediction model.Previous studies for rainfall prediction using multilayer perceptions used temperature, humidity, solar radiation, and wind speed as rainfall predictors [143][144][145] .The input attributes as the rainfall predictors are shown in Table 1.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-proje ct.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.mathw orks.com/ produ cts/ 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 model 137 .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.
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.Table 1.Rainfall parameters used in our study and their corresponding measurement units.Step in 95% range of prediction construction using bootstrap MLPs.The paired bootstrap approach 140 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: (1) The estimate of true regression y(X i ) can be calculated as follows (Eq.21): where, 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):  www.nature.com/scientificreports/ (3) According to , the variance of the noise can be estimated as follows 141 (Eq.23): A set of variances squared residuals r 2 (X i ) are calculated to estimate a model to fit the remaining residuals (Eq.24): Afterward, a new data set D r 2 can be built as follows (Eq. 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 variance 142 .
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.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 MLP 69 .First, all non-linear characteristics are extracted from the data using auto-encoders.Figure 4 depicts the suggested methodology's flow.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.
Input layer: There are 23 neurons ( X i , i = 1, 2, 3, . . .., 23.) in the input layer.In the input layer, the neurons are arranged in the manner shown in Eq. 28.
( www.nature.com/scientificreports/Hidden layer: There are 5 hidden layers altogether.Every neuron is related to every hidden layer.The hidden layer was calculated using (Eq.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): 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).

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).O i , and P i stand for the observed data, simulated data from the model, and observed mean, respectively.Correlation: are calculated as 144 (Eq.33).
where y o t and y c t represent the observed and calculated values at time t respectively, y o and 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.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 data 44 .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. 35 122 .
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 .
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).
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.9mm) and the lowest in Ishurdi (1466.4mm).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.59mm).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).
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 postmonsoon season had relatively little rainfall (Table 2).
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).
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.
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).
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 postmonsoon season.During the pre-monsoon and monsoon, roughly 82% and 75% of the monitoring stations exhibit a declining tendency in rainfall (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.
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.
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).www.nature.com/scientificreports/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.
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).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.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.
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).
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.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.
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.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 change 44 .This is the reason for an increase in yearly rainfall in summer monsoons noticed in the country's northeastern and southeastern parts 86 .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 rainfall 138 .Contrarily, the majority of the areas saw moderate to low mean convective precipitation rates, which to some degree reduced rainfall 147 .
Overall, the number of low clouds has grown throughout the country and neighbor regions 27 .The few cloud coverings will boost the atmosphere's condensing effect on surface solar radiation, which will reduce the trend in rainfall 124 .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.

Discussion
Evaluation of historical rainfall trends is crucial in many fields, including water resource management, planning for sustainable agriculture, managing ecosystems, and the health sector 52 .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.9mm) and the lowest in Ishurdi (1466.4mm).From 1958 to 2007, the mean annual rainfall in  www.nature.com/scientificreports/Bangladesh was 1527 mm to 4193 mm, according to Shahid 62 .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 2007 39 .Compared with much older studies, rainfall during the dry season decreased from the 1950s to the 2010s while monsoon rainfall increased 43,49,60,123,124 .This fluctuation in rainfall distribution over a year significantly affects changing climatic conditions and agricultural production.The World Bank 125 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 Ahmed 48 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 Bank 125 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 Khairulmaini 124 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 premonsoon, monsoon, and post-monsoon periods, respectively, 82%, 75%, and 100%.Shahid and Khairulmaini 124  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.Shahid 39 , Endo et al. 40 , and Zannat et al. 41 showed a changing pattern in monsoon rainfall in Bangladesh, and it was increasingly reported by Sing 126 .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 results [129][130][131] .Those studies found significant positive trends at most weather stations during the post-monsoon and pre-monsoon 31,42,43,60,132 .However, this study observed that all weather stations have a declining trend in post-monsoon rainfall 146 .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 Methods 10,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 Bangladesh 124 , which shows an irregular pattern in rainfall trends in Bangladesh 49,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 rises 148 .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 countries 16,86,133 .This fluctuation is evident in the changing rainfall pattern over the year, promoting the meteorological drought 134 .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 Bangladesh 106,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 plan- ning significantly.Cropping types and patterns that have been developed may need to respond to variations in rainfall patterns.

( 3 )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/ produ cts); DEM data was derived from Shuttle Radar Topography Mission of USGS, (https:// earth explo rer.usgs.gov/).

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

Figure 3 .
Figure 3.The framework of bootstrap-MLPs based PI constructions.

Figure 4 .
Figure 4. Flow of proposed prediction methodology.
Change(%)overperiod = Average rainfall for post change point − Average rainfall for pre change point Average rainfall of pre change point × 100

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

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/ produ cts).

Figure 11 .
Figure 11.Weather station-wise innovative trend in annual rainfall.

Figure 12 .YearFigure 13 .
Figure 12.Decomposition of additive time series of monthly rainfall data from 1981 to 2020.

Figure 14 .
Figure 14.Evaluation of the model by testing set for 24 months.

Table 3 .
The trend in monthly rainfall over Bangladesh from 1981 to 2020 (P > 0.05).Trend of the monthly rainfall represented as a percentage of the rainfall monitoring stations.

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

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

Table 6 .
Evaluation of the performance of the proposed model.

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