in

Spatiotemporal trends and machine learning-based prediction of temperature variability during the T. Aman rice-growing season in Bangladesh


Abstract

Climate change poses significant risks to food security, especially in agriculture-dependent countries like Bangladesh. This study analyzes temperature trends from 1961 to 2023 using data from the Bangladesh Meteorological Department (BMD) across three climatic regions: Barind, Coastal, and Haor. The Mann–Kendall test revealed statistically significant warming trends in both maximum and minimum temperatures, with the most pronounced increase in the Haor region. Moran’s analysis detected clear spatial clustering of high-risk zones, with Barind districts facing severe maximum temperature risks (> 40 °C) and Sylhet showing heightened minimum temperature risks. The MLP model achieved the lowest errors across ecosystems, with MSEs of 0.82 (Barind), 1.47 (Coastal), and 1.50 (Haor) for maximum temperature and with MSEs of 0.48 (Barind), 0.44 (Coastal), and 0.48 (Haor) for minimum temperature, outperforming SVM, CNN, LSTM, ANN, RF, and Ensemble models. This is the first region-specific application of machine learning models along with Mann–Kendall trend analysis, Moran’s I spatial statistics for rice production in Bangladesh which provides a multidimensional framework that is rarely applied in Bangladesh. These findings underscore the urgent need for region-specific climate adaptation strategies, as rising temperatures threaten rice production and agricultural resilience.

Similar content being viewed by others

Identification of influential weather parameters and seasonal drought prediction in Bangladesh using machine learning algorithm

Developing relationships and policy frameworks to address hazard-specific economic and non-economic loss and damage

Climate change scenario in Bangladesh: historical data analysis and future projection based on CMIP6 model

Introduction

Climate change and climate variability are among the major threats to social, economic, and ecological conditions worldwide1,2. According to the Intergovernmental Panel on Climate Change (IPCC, 2021), global warming is unequivocal, with widespread impacts on ecosystems, agriculture, and livelihoods. Climate variability arises from the constant changes between short-term weather deviations and long-run climate drifts3. Climate change has particularly devastating implications for global food security as it affects rainfall patterns, temperature, and relative humidity for an extended time.

The abovementioned factors are crucial in defining the specific region’s climate, and each of them has a major impact on the agricultural field productivity. Therefore, even the slightest changes in any of the factors can result in a significant decline in crop output4,5,6. Extreme temperature plays a fundamental role in various domains, such as ecosystem stability, agricultural production, water availability, and sustainable socioeconomic development. Recently, there has been growing concern about temperature anomalies that deviate significantly from the average in a warming world. The last few years have witnessed increasing attention to the differences concerning temperature extremes between regions, as these extremes significantly affect both natural ecosystems and human communities7,8,9. Rainfall is the most significant hydrological element, and it plays a vital role in relation to climate change. It influences food crops, harvesting, employment, and the environment. Flood and droughts, salinity, and temperature are in addition to rainfall projected to decrease rice and cereal output by eight and twenty-three per cent by 2050 from the base in 199010,11.

Bangladesh is one of the ten countries most vulnerable to the impacts of climatic extremes12. The immediate impacts of high and low extremes in Bangladesh, like those occurring elsewhere globally, largely result from increased daily temperatures, changes in rainfall patterns, and other climatic events13,14. Considering that Bangladesh is fundamentally an agricultural economy, with about 80% of the populace directly or indirectly dependent on agriculture, the consequences of climate variability and change on economic development and food security are particularly salient to the country15. Food security in Bangladesh will be threatened by lower agricultural yield, which is linked to climatic factors. Therefore, research is desperately needed to fully understand how much climate change is affecting Bangladesh and to support laws that would force the required steps to lessen its effects on agricultural output16.

Furthermore, it is commonly known that environmental factors, particularly rainfall, have a considerable influence on agricultural output17. Bangladesh has been severely impacted by the global and regional shifts in rainfall patterns brought about by climate change. The last 35 years have seen the nation go through unparalleled spells of rain and drought18. These variations have had unfavorable effects; for example, in 2007 a major flood that affected over 9 million people was caused by high rainfall17. In addition, natural disasters cost Bangladesh 111,289 metric tons in lost rice output in the 2019–2020 year15.

Moreover, it is predicted that from 2005 to 2050, Bangladesh’s overall rice output would decrease by 7.4% yearly due to temperature extremes19. Therefore, it is crucial to evaluate changes in the frequency, severity, and duration of severe temperature occurrences in addition to estimating changes in mean temperature trends20. Still, there is little knowledge on the features of climatic extremes at the regional level. Therefore, it is imperative to monitor spatiotemporal fluctuations regularly and methodically in temperature extremes, especially in areas like Bangladesh20,21

Like temperature and rainfall, relative humidity is another important element that affects crop productivity indirectly. High relative humidity reduces transpiration rates, which in turn decreases the upward movement of water and nutrients from the roots, ultimately lowering crop output. It also encourages disease and insect infestation. On the other hand, low humidity combined with sunny weather may lead to leaf wilting and in extreme cases, result in plant death due to water deprivation22. Therefore, it is crucial to assess whether there are trends in climatic parameters such as rainfall, temperature, and relative humidity, as well as patterns in their variability, to make accurate predictions.

Previous studies across Asia and beyond have highlighted significant changes in climatic variables and their implications for water resources, agriculture, and society. For example, a review of temperature trends in India stressed the importance of reliable detection methods23, while spatial and temporal shifts in mean and extreme rainfall and temperature across urban centers in Rajasthan were reported, with direct consequences for urban water management24. Similarly, climate change has already altered water availability and agricultural productivity in China, underlining the vulnerability of food security to climatic extremes25. In Europe, the importance of data homogeneity for deriving valid climatic trends has been demonstrated26,27, and change-point detection techniques continue to influence climate research28. Non-stationarity in U.S. flood peaks has also been revealed, highlighting risks for long-term hydrological planning29. Collectively, these studies emphasize that the choice of statistical technique, whether regression, non-parametric tests such as the Mann–Kendall (MK)30,31 or Sen’s slope estimator32, or homogeneity tests26,27,28, directly shapes how climatic trends are understood. The implications consistently point to increased climate risks for agriculture, water management, and disaster preparedness, thereby justifying the need for detailed region-specific analyses in countries like Bangladesh.

The Sen’s slope estimator is a widely applied non-parametric method for quantifying the magnitude of monotonic trends in climatic and hydrological variables32.In contrast to many statistical approaches that may be sensitive to serial correlation, time-series length, or seasonality, non-parametric techniques such as the Mann–Kendall test, Spearman’s rank correlation, and Sen’s slope estimator are widely applied for climate trend analysis due to their distribution-free nature and robustness. In this study, a novel trend analysis approach was also employed alongside the MK test to enhance the identification of trends33,34,35. In Bangladesh, limited research has been conducted utilizing innovative trend analysis to detect trends in climate variables.

Even though trend analysis is useful for understanding past and present climate changes, future projections are more useful for policymakers in developing strategies that consider expected changes in climate variables. Physical models require substantial computational effort and resources, and while they are powerful tools for simulating climate processes, their outputs are not free from limitations. Systematic biases, such as sea surface temperature errors in regions like the Eastern North Pacific, highlight the need for careful evaluation and bias-correction before using climate model projections in impact studies. However, there are drawbacks to statistical methods like autoregressive (AR), moving average (MA), autoregressive moving average (ARMA), and autoregressive integrated moving average (ARIMA). For example, MA models use past errors as explanatory variables, while AR models only rely on past values. It is only appropriate to use ARMA models with stationary time series data. On the other hand, the application of artificial intelligence (AI) models, more specifically, machine learning (ML) techniques in climate forecasting has recently drawn interest36,37. Unlike physical models, ML models perform very well by handling large and complex datasets with ease and without requiring a large amount of data38. These models perform well even when dealing with non-stationary time series data38. In a recent review, backpropagation-based models outperform neural network-based models for rainfall forecasting36. The multilayer Perceptron (MLP) technique is used in our work to forecast meteorological variables like temperature, RH and rainfall. MLP has been widely praised for its reliable and consistent results when used to anticipate various hydrological and meteorological events39,40,41,42,43,44,45,46,47,76. This study is unique for taking a novel approach to combining MLP models with other methods, such as Random Forest (RF), Neural Network, Artificial Neural Network (ANN), and Ensemble algorithm. We can estimate and predict climate variables like temperature, relative humidity, and rainfall with precision because of this thorough investigation.

Bangladesh Delta Plan 2100 (BDP-2100) identifies six climate-hotspot regions, of which the Barind, Coastal, and Haor areas are most critical for T. Aman rice production because of their vulnerability to temperature extremes, salinity intrusion, drought, and flash flooding48. These regions contribute significantly to national rice output and represent contrasting agro-ecological conditions where temperature variability directly affects phenology, yield, and food security. Other hotspot regions, such as the Hill Tracts or riverine zones, were excluded as their cropping systems and microclimates differ substantially from T. Aman production areas, making them less comparable for this study’s focus.

Therefore, the current study aims to analyze the spatiotemporal trends of temperature variability during the T. Aman rice-growing season across Bangladesh and develop robust ML models to accurately predict temperature patterns, thereby supporting climate-resilient agricultural planning and decision-making. This study also aims to explore the spatiotemporal trends in monthly and seasonal minimum and maximum temperature in Bangladesh using the Sen’s slope estimator, and MK test. Furthermore, using MLP neural network, RF, Neural network, Artificial Neural Network (ANN) and Ensemble algorithm, the study attempts to forecast monthly and seasonal trends of the temperature in Bangladesh till 2030. The study also aims to evaluate the risk areas associated with changes in climatic patterns in Bangladesh by using Moran’s I. Additionally, techniques for analyzing change rates in data from a time series of climatic factors and variations will be employed, along with spatial mapping methods like Krigging and Inverse Distance Weighting (IDW).

Methods

Study area and data source

Bangladesh is in the northeastern region of South Asia, situated between latitudes 20°34′ and 26°38′ N, and longitudes 88°01′ and 92°41′ E. The study area comprised three distinct ecosystems—Barind, Coastal, and Haor—spanning 15 districts across Bangladesh. The Barind ecosystem includes the districts of Bogra, Pabna, Dinajpur, Rajshahi, Rangpur, and Sayedpur. The Coastal ecosystem encompasses Barisal, Bhola, Mongla, Khulna, Patuakhali, Sathkhira, and Khepupara. The Haor ecosystem covers Moulvibazar and Sylhet districts [Fig. 1]. Data was obtained from the BMD for these three ecosystems covering the period from 1961 to 2023. These datasets include Minimum and maximum temperature data from 35 meteorological stations across the three climatic hotspots (Coastal region, Barind region, and haor region) of Bangladesh, according to the Bangladesh Delta Plan (BDP)-2100. It should be noted that BMD has a total of 48 stations, including newly established ones, and stations with more than 15% of missing data were excluded to ensure accuracy.

Fig. 1

Geographical Distribution of Study Regions in Bangladesh. The map was created using ArcGIS Desktop version 10.8 (Esri, Redlands, CA, USA; https://www.esri.com.

Full size image

Data Preprocessing

Missing data estimation

Missing data estimation is a critical procedure in meteorological research, particularly in the context of climate data analysis, where accurate and complete datasets are imperative for various applications. One commonly employed methodology for addressing missing data is the standard ratio approach, complemented by multiple imputations (MI) when confronted with data gaps49. The standard ratio approach operates on the premise of leveraging information from neighboring stations to infer missing values. This technique presupposes a degree of correlation between rainfall, temperature, and RH measurements at proximate stations, thereby facilitating the estimation of missing data based on available observations from adjacent areas. The initial step in the standard ratio approach involves the computation of a weighting factor derived from the ratios between rainfall, temperature, and RH measurements at the target station and those at its neighboring counterparts. This weighting factor is expressed as:

$${text{Weighting}},{text{factor}} = frac{{N_{s} }}{{N_{i} }}$$

Here, ({N}_{s}) denotes the average of the rainfall, temperature, and RH data presently available at the target station, ({N}_{i}) represents the average of the rainfall data at the ith neighboring station, and n signifies the total count of adjacent stations contributing to the computation. This methodology facilitates the estimation of missing data at the target station by applying the derived weighting factor to available observations from nearby stations. However, its efficacy may be constrained in scenarios where neighboring station data are inaccessible or when the correlation between stations is weak.

Outlier analysis

Outlier detection is a pivotal aspect of data analysis, particularly in meteorological studies where anomalous data points can significantly influence results.

Grubbs’ test and Box plot

Grubbs’ test is a widely utilized method for identifying outliers within a dataset. This statistical test is predicated on a two-sided hypothesis, wherein the null hypothesis posits the absence of outliers, while the alternative hypothesis suggests the presence of outliers either at the lowest or highest end of the data distribution50.

The formula for Grubbs’ test is represented as follows:

$$G = frac{{max left| {x_{i} – overline{x}} right|}}{s}$$

where, xi indicates the individual observation, (overline{x }) represents the average value of observations and s represents the sample standard deviation.

The critical value at significance level α for a sample of size n is given by:

$$G_{critical} = frac{{left( {n – 1} right)}}{sqrt n } . sqrt {frac{{t_{{frac{alpha }{2n}, n – 2}}^{2} }}{{n – 2 + t_{{frac{alpha }{2n}, n – 2}}^{2} }}}$$

where ({t}_{frac{alpha }{2n}, n-2}^{2}) is the critical value from the student’s t-distribution with n-2 degrees of freedom.

The decision rule is as follows: if G > Gcritical, the most extreme observation is considered an outlier; otherwise, no outlier is detected.

In addition to Grubbs’ test, outliers were also identified using the Box Plot method, which relies on quartile statistics. The distribution is summarized by the lower quartile (Q1), the median (Q2), and the upper quartile (Q3). The interquartile range (IQR) is defined as:

$${text{IQR}} = {text{Q}}_{{3}} {-}{text{Q}}_{{1}}$$

Potential outliers are determined using the following fences:

$${text{Lower}},{text{fence}} = {text{Q}}_{{1}} – {1}.{5} times {text{IQR}}$$
$${text{Upper}},{text{fence}} = {text{Q}}_{{3}} + {1}.{5} times {text{IQR}}$$

Observations lying below the lower fence or above the upper fence are classified as mild outliers. More extreme outliers can be identified using the thresholds,

$${text{Q}}_{{1}} – {3} times {text{IQR and Q}}_{{3}} + {3} times {text{IQR}}.$$

Assessment of autocorrelation

Durbin-Watson statistics

Furthermore, autocorrelation within climatic variables data is assessed through Durbin-Watson autocorrelation statistics51.

The most used formula for Durbin Watson autocorrelation statistics is given by,

$$d = frac{{mathop sum nolimits_{t = 2} (e_{t} – e_{t – 1} )^{2} }}{{mathop sum nolimits_{t = 1} e_{t}^{2} }}$$
$$where,{text{e}}_{{text{t}}} = residual,at,time,t$$

The Durbin-Watson statistics are calculated to ascertain the presence and direction of autocorrelation in the residuals ({text{e}}_{text{t}}) derived from the experimental observations. A Durbin-Watson statistic value of 2 indicates the absence of positive or negative autocorrelation, while values ranging from 0 to 4 are typically observed.

Normality test

Normality tests are indispensable in statistical analysis to assess whether a dataset follows a normal distribution, which is a fundamental assumption for many statistical techniques. Two commonly used methods for testing normality are the Q-Q (Quantile–Quantile) plot52. The Q-Q plot is a graphical technique that compares the quantiles of the dataset against those of a theoretical normal distribution. If the data points fall approximately along a diagonal line on the plot, it suggests that the dataset is normally distributed. However, deviations from this line indicate departures from normality. Specifically, if the points deviate systematically, such as bending upwards or downwards, it indicates skewness or kurtosis in the data, respectively.

Testing homogeneity

In climate research, ensuring the homogeneity of data is essential to mitigate the influence of measurement errors, instrument changes, and other environmental factors on the accuracy of trend analyses. In the present study, two standard tests were employed to assess homogeneity before trend analysis: Alexandersson’s standard regular homogeneity test53 and Von Neumann’s ratio test54. Alexandersson’s test is a widely recognized method for detecting structural breaks or shifts in data series, while Von Neumann’s ratio test evaluates the ratio of variances between consecutive segments of the dataset to identify significant deviations indicative of non-homogeneity. By implementing these tests, researchers can safeguard against erroneous trend conclusions, thus enhancing the reliability of findings in climate studies.

Standard normal homogeneity test (SNHT)

Standard Normal Homogeneity Test (SNHT)is a method utilized to detect abrupt shifts within time series data of meteorological and hydrological variables53. The test, proposed by Alexandersson, involves computing a statistic (text{T}(text{k})) that compares the means of the first “k” years with the means of the subsequent “n-k” years in the dataset.

$$Tleft( k right) = koverline{z}_{1}^{2} + left( {n – k} right)overline{z}_{2}^{2}$$

where, (k=text{1,2},3,dots dots dots , n).

If a structural break occurs at year “K,” the statistic (text{T}(text{k})) peaks around the vicinity of the break year, providing insight into the timing of the shift. The test statistic ({text{T}}_{0}) is defined based on this concept, where if ({text{T}}_{0}) surpasses the critical value, dependent on the sample size, the null hypothesis is rejected, indicating the presence of a structural break.

$$T_{0} = MaxTleft( k right), 1 < k < n$$

Von Neumann’s ratio test

The Von Neumann’s Ratio (VNR) test, proposed by Von Neumann54, is a non-parametric statistical test used to assess the randomness of a time series by examining the presence of first-order autocorrelation in the residuals. For a series Xi with mean (overline{X }), the test statistic N is defined as: (text{N}={sum }_{text{i}=1}{left({X}_{i}-{X}_{i+1}right)}^{2}/{{sum }_{i=1}left({X}_{i}-overline{X }right)}^{2})

Method for trend analysis

M–K test

The MK test serves as a robust and widely employed method for evaluating trends in hydrological and meteorological time series data, particularly when the data does not conform to a normal distribution31. This nonparametric test effectively discerns monotonic movements, including both expanding and diminishing trends, within the dataset. It is particularly advantageous in scenarios where data may contain missing values or lack adherence to specific statistical distributions. The test statistics are given by,

$$S = mathop sum limits_{j = 1}^{n – 1} mathop sum limits_{i = j + 1}^{n} signleft( {X_{i} – X_{j} } right)$$

where, (n) is the number of observations and the sign function is given by,

$$signleft( {X_{i} – X_{j} } right) = + 1 if X_{i} – X_{j} > 0$$
$$signleft( {X_{i} – X_{j} } right) = 0 if X_{i} – X_{j} = 0$$
$$signleft( {X_{i} – X_{j} } right) = – 1 if X_{i} – X_{j} < 0$$

When the sample size (n) exceeds 10, the MK test statistic (S) is considered to follow an asymptotically normal distribution. In this scenario, the expected value E(S) of the test statistic is equal to 0. To calculate the variance of S, V(S), which provides a measure of dispersion around the mean, the following formula is employed:

$$Vleft( S right) = frac{1}{18}left[ {nleft( {n – 1} right)left( {2n + 5} right) – mathop sum limits_{T} Tleft( {T – 1} right)left( {2T + 5} right)} right]$$

The calculation of S involves considerations of ties (T) within the data, facilitating the assessment of variance V(S) and subsequently the determination of the standard deviation Z. By comparing the Z value to critical values at a chosen significance level, typically 95%, researchers can make informed decisions regarding the acceptance or rejection of the null hypothesis, thereby identifying statistically significant trends in the dataset.

$$Z = frac{S – 1}{{surd Vleft( S right)}} if S > 0$$
$$Z = 0 if S = 0$$
$$Z = frac{S + 1}{{surd Vleft( S right)}} if S < 0$$

Sen’s slope estimator

Sen’s slope model, widely utilized for estimating the magnitude of time series patterns, offers robustness compared to traditional regression slopes, as it remains unaffected by outliers or incomplete data55. This method accurately estimates time series data by computing slopes for all pairs of ordinal time points and subsequently deriving the overall slope using the median of these individual slopes. Specifically, for N pairs of data, the slope estimate Qk is computed using the formula:

$$Q_{k} = frac{{X_{i} – X_{j} }}{i – j} for,k = 1,2,….N$$

Here, Xi and Xj represent data values at times i and j, respectively. The median of these N values of Qk constitutes Sen’s slope estimator, which is calculated based on whether N is odd or even. A positive Q value indicates an upward (increasing) trend in the time series, while a negative value signifies a downward (decreasing) trend. When N is odd,

$$Q_{median} = frac{{Q_{{left( {N + 1} right)}} }}{2}$$

If N is even,

$$Q_{median} = frac{{left[ {Q_{{left( {N + 1} right)}} + Q_{{left( {N + 1} right)/2}} } right]}}{2}$$

Spatial mapping method

In this study, the Inverse Distance Weighting (IDW) method was employed to interpolate the data and generate a spatial rainfall map56,57.

$$Fleft( {x_{i} ,y_{i} } right) = mathop sum limits_{i – 2}^{n} w_{i} f_{i}$$

The IDW interpolation follows the above Equation, where each scatter point is assigned a weight function ({w}_{i}), and ({f}_{i}) represents the specified function values at the scatter points. The total number of scatter points is denoted as ({n}_{i}). The conventional configuration of the weight function is computed using the following Equation,

$$W_{i} = frac{{h_{i}^{ – p} }}{{mathop sum nolimits_{j = 1}^{n} h_{j}^{ – p} }}$$

In this context, ({h}_{i}) represents the distance between the scatter point and the interpolation point. The power parameter p is a positive real number selected freely. Here, ((x,y)) denotes the coordinates of the interpolation point, while (({x}_{i},{y}_{i})) denotes the coordinates of the scatter point.

$$h_{i} = sqrt {left( {x – x_{i} } right)^{2} + left( {y – y_{i} } right)^{2} }$$

Method for risk area assessment: Moran’s I

Local Indicators of Spatial Association (LISA) include various localized statistical methods that analyze the relationships between individual locations and their neighbors to identify spatial clustering patterns. In this study, we use the local Moran’s ({I}_{i}), a decomposition of the global Moran’s I, to quantify spatial autocorrelation58,59. While the global Moran’s I provide an overall measure, the local Moran’s ({I}_{i}) assesses each observation’s relationship with its neighbors, classifying them based on the degree of spatial autocorrelation. The local Moran’s ({I}_{i}) is calculated using a weight matrix ({w}_{ij}) that defines the strength of the relationship between observation (i) and its neighboring observations (j). This standardized measure, like a z-score, identifies whether values are high or low relative to the mean, revealing patterns of clustering or dispersion. Additionally, the bivariate local Moran’s ({I}_{i}) extends this method by comparing different variables across time, thus facilitating the examination of temporal changes in spatial patterns.

For the ith region the local Moran’s I is defined as follows:

$$I_{i} = frac{{nleft( {Y_{i} – overline{Y}} right)}}{{mathop sum nolimits_{j} left( {Y_{j} – overline{Y}} right)^{2} }}mathop sum limits_{j} w_{ij} left( {Y_{i} – overline{Y}} right)$$

Note that the global Moran’s I is proportional to the sum of the local Moran’s I obtained for all region as follows:

$$I = frac{1}{{mathop sum nolimits_{i ne j} w_{ij} }}mathop sum limits_{i} I_{i}$$

Method for forecasting

Probabilistic and deterministic methods such as ARMA, ARIMA, and SARIMA have been widely applied for predicting hydrological and climatic datasets. These models assume linear relationships and are effective for capturing autoregressive and seasonal patterns; however, they may fail to adequately represent the non-linear interactions that are common in hydro-climatic systems. To overcome these challenges and enhance forecasting accuracy, this study explores the application of ML models, which are better equipped to capture non-linear relationships and complex patterns in hydro-climatic systems. Artificial intelligence (AI) models, particularly ANN, have gained popularity for addressing these limitations and solving environmental problems. As a non-linear black-box model, ANN mimics the structure and function of biological neural networks, consisting of interconnected neurons that process information to establish relationships between inputs and outputs. Using a feed-forward MLP algorithm, the model includes three layers: an input layer, one or more hidden layers, and an output layer. The number of neurons in the hidden layer was determined through trial and error. MLP is among the most widely used neural network architectures, particularly effective for classifying stationary patterns. It operates using the backpropagation algorithm, which minimizes errors and adjusts hidden layer parameters. Key features of MLP include non-linear processing elements (such as logistic or hyperbolic tangent functions) and extensive interconnectivity, where every element in one layer connects to all elements in the next layer.

Mathematical representation of the MLP model

Input Layer: The input vector in Fig. 2 is represented as ({varvec{X}}={left[{{varvec{x}}}_{1},{{varvec{x}}}_{2},boldsymbol{ }{{varvec{x}}}_{3},{{varvec{x}}}_{4}right]}^{{varvec{T}}}), where ({x}_{i}) represent the i-th input feature.

Fig. 2

Architecture of the Multi-Layer Perceptron (MLP) Model for Temperature Prediction.

Full size image

First Hidden Layer: The first hidden layer has five neurons. The transformation from the input layer to the first hidden layer can be described as:

$${{varvec{Z}}}^{left(1right)}={{varvec{W}}}^{(1)}{varvec{x}}+{{varvec{b}}}^{(1)}$$

where:

  • ({{varvec{W}}}^{(1)}) is a 5 × 4 weight matrix for the first hidden layer.

  • ({{varvec{b}}}^{(1)}) is a 5 × 1 bias vector for the first hidden layer.

  • ({{varvec{Z}}}^{left(1right)}) is the linear combination of inputs before applying the activation function.

The output of the first hidden layer after applying the activation function f(), typically the Rectified Linear Unit (ReLU), is given by:

$${{varvec{a}}}^{(1)}={varvec{f}}left({{varvec{z}}}^{(1)}right)={varvec{R}}{varvec{E}}{varvec{L}}{varvec{U}}left({{varvec{z}}}^{(1)}right)=mathbf{m}mathbf{a}mathbf{x}(0,boldsymbol{ }{{varvec{z}}}^{(1)})$$

Second Hidden Layer: The second hidden layer has three neurons, and the transformation from the first hidden layer to the second hidden layer is:

$${{varvec{Z}}}^{left(2right)}={{varvec{W}}}^{left(2right)}{{varvec{a}}}^{(1)}+{{varvec{b}}}^{(1)}$$

where:

  • ({{varvec{W}}}^{(2)}) is a 3 × 5 weight matrix for the second hidden layer.

  • ({{varvec{b}}}^{(2)}) is a 5 × 1 bias vector for the second hidden layer.

  • ({{varvec{Z}}}^{left(2right)}) is the linear combination of activations from the first hidden layer.

Applying the activation function f(·) to ({{varvec{Z}}}^{left(2right)}):

$${{varvec{a}}}^{(2)}={varvec{f}}left({{varvec{z}}}^{(2)}right)={varvec{R}}{varvec{E}}{varvec{L}}{varvec{U}}left({{varvec{z}}}^{(2)}right)=mathbf{m}mathbf{a}mathbf{x}(0,boldsymbol{ }{{varvec{z}}}^{(2)})$$

Output Layer: The output layer consists of a single neuron to predict the continuous target variable. The output is computed as:

  • ({{varvec{W}}}^{left(3right)}) is a 1 × 3 weight matrix for the output layer.

  • ({{varvec{b}}}^{(3)}) is a scalar bias for the output layer.

  • (hat{y}) represents the predicted output.

Several soft computing ML techniques are available for predicting and forecasting meteorological variables. Among these, the MLP based artificial neural network (ANN) has become widely popular among researchers. This popularity is due to the MLP’s computational simplicity and its ability to generate high-quality predictions. For instance, A study conducted in Poland introduced a stacked ML model that combines a MLP and a RF to forecast daily lake surface water temperature using daily air temperature as the input variable60. In the field of meteorology, ML approaches have been widely utilized for predicting weather variables. A study on the development of an enhanced bidirectional recurrent neural network (Bi-RNN) comparing the performance of four ML approaches, including Bi-RNN, MLP, and RF61. Artificial neural networks (ANNs), particularly MLPs, have been employed in numerous forecasting models. For example, a study used an MLP to forecast monthly relative humidity in Delhi, India62. Overall, the combination of ML algorithms like MLP, RF, ensemble and neural networks, along with feature selection methods has demonstrated significant promise in predicting meteorological variables and other outcomes based on various input variables. In this study, we used MLP, ANN, RF, support vector machine (SVM) and the ensemble algorithm for predicting minimum and maximum temperature. Additionally, we combined these models to enhance prediction accuracy. The flow of proposed prediction methodology can be found in Fig. 3.

Fig. 3

Flowchart of the Prediction Methodology Using Machine Learning Models.

Full size image

Convolutional neural networks (CNNs)

To identify local patterns and spatial–temporal relationships in temperature data, convolutional neural networks (CNNs) were used. CNNs employ convolutional layers in which hierarchical features are extracted by sliding filters (kernels) across the input. A non-linear activation (e.g., ReLU) and frequently a pooling step for dimensionality reduction come after each convolutional operation.

For a convolutional layer, the feature map at position (i,j) can be expressed as:

$$h_{i,j} = gleft( {sumlimits_{m = 1}^{M} {sumlimits_{n = 1}^{N} {w_{m,n} x_{i + m, j + n} + b} } } right)$$

where x is the input, wm,n are kernel weights, b is the bias term, and g() is the activation function. The extracted feature maps are passed through fully connected layers to generate the final temperature prediction.

Long short-term memory (LSTM)

Long Short-Term Memory (LSTM) networks were utilized for modeling sequential patterns in temperature data. Unlike traditional recurrent neural networks, LSTMs have memory cells and gating mechanisms (input, forget, and output gates) that govern how information is stored, updated, and transmitted between time steps. This makes LSTMs ideal for detecting long-term dependencies in time series data.

In this study, the LSTM was trained with lagged temperature readings (up to three years) and year, month, and day indicators as sequential inputs. Model hyperparameters, such as the number of hidden units, layers, learning rate, and batch size, were optimized for performance. The model was trained on normalized data and validated against an independent test set.

Model performance evaluation metric

To evaluate the performance of the model, four commonly used error metrics—MAE, MSE, RMSE, and MAPE were applied, as described below.

MSE: Mean Square Error (MSE) calculates the average of the squared differences between predicted and actual values63. By squaring the errors, MSE gives more weight to larger discrepancies, which means it is more sensitive to significant errors or outliers. This characteristic makes MSE useful when large errors are particularly undesirable and need to be penalized more. However, since the errors are squared, the resulting value is in squared units of the original data, making it less intuitive to interpret compared to MAE or RMSE.

$$MSE = frac{1}{N}sumlimits_{i = 1}^{N} {left| {y_{i} – hat{y}_{i} } right|}^{2}$$

MAE: Mean Absolute Error (MAE) measures the average magnitude of errors between predicted and actual values, without considering their direction63. It calculates the absolute differences between predictions and observations and then averages them over all data points. Since MAE treats all errors equally, it provides a straightforward and easily interpretable indication of the average prediction error in the same units as the data. However, it does not penalize larger errors more heavily, making it less sensitive to outliers compared to other metrics like MSE or RMSE.

$$MAE = frac{1}{N}sumlimits_{i = 1}^{N} {left| {y_{i} – hat{y}_{i} } right|}$$

MAPE: Mean Absolute Percentage Error (MAPE) expresses the average absolute errors as a percentage of the actual values, providing a scale-independent metric that facilitates comparison across different datasets63. By showing errors relative to the size of the observations, MAPE offers an intuitive understanding of the prediction accuracy in percentage terms. However, it can produce extremely large or undefined values when actual data points are zero or close to zero, making it sensitive to small denominators and less reliable in such cases.

$$MAPE = frac{1}{N}frac{{sumnolimits_{i = 1}^{N} {left| {y_{i} – hat{y}_{i} } right|} }}{{y_{i} }} times 100$$

RMSE: Root Mean Square Error (RMSE) is the square root of the Mean Square Error, offering an error metric that is in the same units as the original data63. Like MSE, it emphasizes larger errors due to the squaring of differences before averaging, but taking the square root brings the metric back to the original scale, making it easier to interpret. RMSE is widely used because of its sensitivity to large errors, making it an effective measure when significant prediction inaccuracies are particularly problematic.

$$RMSE = sqrt {frac{1}{N}sumlimits_{i = 1}^{N} {left| {y_{i} – hat{y}_{i} } right|}^{2} }$$

Result

Descriptive statistics of maximum and minimum temperatures in Bangladesh (1961–2023)

The descriptive analysis for maximum temperatures across ecosystems and regions reveals notable variations. Overall, the mean maximum temperature during the T.Aman season was 31.62 °C, with a standard deviation of 2.16 °C, ranging from 17.85 °C to 39.90 °C [Table 1]. Among ecosystems, Barind exhibited the highest mean maximum temperature (31.82 °C), followed by Coastal (31.67 °C) and Haor (31.62 °C) [Table 2]. The distribution was slightly left-skewed in all ecosystems, indicating a tendency for temperatures to cluster closer to the upper limit, as reflected by skewness values ranging between − 0.44 (overall) and − 0.35 (Barind).

Table 1 Descriptive statistics of maximum and minimum temperatures in Bangladesh (1961–2023).
Full size table
Table 2 Ecosystem-wise summary statistics of maximum and minimum temperatures.
Full size table

For minimum temperatures, the overall mean was 24.02 °C, with a standard deviation of 3.10 °C, spanning a range from 9.62 °C to 29.98 °C [Table 1]. The Coastal ecosystem recorded the highest mean minimum temperature (24.31 °C), followed by Barind (24.06 °C) and Haor (24.02 °C) [Table 2]. The data demonstrated negative skewness across all ecosystems, with values ranging from − 1.42 (Barind) to − 1.53 (Coastal), indicating a concentration of temperatures near the upper end of the range.

Trend analysis of temperature

Maximum temperature

The MK test and Sen’s slope analysis revealed significant positive trends in maximum temperature during the T.Aman season across the Barind, Coastal, and Haor ecosystems. The Barind ecosystem exhibited a moderate upward trend, with a z-value of 23.61 and Kendall’s tau of 0.16, while the Coastal ecosystem showed a similar positive trend with a z-value of 23.88 and Kendall’s tau of 0.16. The Haor ecosystem demonstrated the strongest increasing trend, reflected by a z-value of 25.68 and Kendall’s tau of 0.17. Correspondingly, Sen’s slope estimates quantified the rate of increase as 23.61, 23.88, and 25.68 units per period for the Barind, Coastal, and Haor ecosystems, respectively [Tables 3 and 4].

Table 3 Mann–Kendall test results for maximum and minimum temperature trends.
Full size table
Table 4 Sen’s Slope estimates for maximum and minimum temperature trends.
Full size table

The MK test and Sen’s slope analysis at the district level revealed significant positive trends in maximum temperatures during the T.Aman season across districts within the Barind, Coastal, and Haor ecosystems. In the Barind ecosystem, the highest trend was observed in Bogra, with a z-value of 24.99 and Kendall’s tau of 0.17, followed by Rajshahi (z-value: 24.63, tau: 0.17) and Pabna (z-value: 24.12, tau: 0.16). Sayedpur also exhibited a notable increasing trend with a z-value of 17.52 and tau of 0.15. However, Rangpur displayed a comparatively weaker trend with a z-value of 10.74 and tau of 0.07.

In the Coastal ecosystem, the district of Khepupara showed the strongest upward trend, with a z-value of 26.85 and Kendall’s tau of 0.19, followed by Pautuakhali (z-value: 24.64, tau: 0.17) and Barisal (z-value: 25.35, tau: 0.17). Bhola and Khulna exhibited moderate trends with z-values of 23.52 and 20.99, respectively. In contrast, Mongla (z-value: 13.24, tau: 0.11) and Sathkhira (z-value: 13.69, tau: 0.09) displayed relatively weaker upward trends.

For the Haor ecosystem, Sylhet recorded the strongest positive trend, with a z-value of 27.30 and Kendall’s tau of 0.18, while Moulvibazar demonstrated a moderate trend with a z-value of 17.78 and tau of 0.12. Sen’s slope analysis across all districts further confirmed the increasing rates of maximum temperature, with the steepest slopes observed in Khepupara (26.85) and Sylhet (27.30) [Supplementary tables S1 and S2].

Minimum temperature

The MK test and Sen’s slope analysis revealed positive trends in minimum temperatures during the T.Aman season across all three ecosystems: Barind, Coastal, and Haor. In the Barind ecosystem, the MK test yielded a z-value of 16.45 and Kendall’s tau of 0.11, indicating a moderate upward trend in minimum temperatures. Similarly, the Coastal ecosystem exhibited a stronger increasing trend with a z-value of 20.14 and tau of 0.13, reflecting a more pronounced rise in minimum temperatures. The Haor ecosystem also showed a positive trend, though slightly weaker than the Coastal ecosystem, with a z-value of 19.34 and tau of 0.13 [Tables 3 and 4].

The trend analysis for district-level minimum temperature during the T.Aman season, as indicated by the MK test and Sen’s slope test, reveals varying rates of change across districts in the Barind, Coastal, and Haor ecosystems. In the Barind ecosystem, the MK test z-values range from 5.62 (Sayedpur) to 14.11 (Bogra), with tau values reflecting moderate to weak upward trends, except for Sayedpur, which shows a weaker trend. In the Coastal ecosystem, the z-values range from 6.01 (Mongla) to 15.06 (Sathkhira), with tau values suggesting a moderate upward trend, particularly in districts like Sathkhira, Bhola, and Barisal, showing stronger increases in minimum temperature. The Haor ecosystem also shows variability, with the z-value for Sylhet reaching 20.17, indicating the strongest upward trend, while Moulovi Bazar presents a moderate trend with a z-value of 11.93. Overall, the trend analysis highlights a general but varied increase in minimum temperatures across these regions, with the Haor ecosystem exhibiting the most pronounced trend, especially in Sylhet [Supplementary tables S1 and S2].

Model performance evaluation for maximum temperature prediction

The evaluation of five ML models SVM, MLP, ANN, RF, and Ensemble across the Barind, Coastal, and Haor ecosystems identified the Multi-Layer Perceptron (MLP) model as the best-performing model in all regions. In the Barind ecosystem, the MLP model achieved the lowest MSE (0.82), MAE (0.69), MAPE (1.92), and RMSE (0.90), outperforming other models. Similarly, for the Haor ecosystem, MLP demonstrated superior accuracy with an MSE of 1.50, MAE of 0.91, MAPE of 2.74, and RMSE of 1.23. In the Coastal ecosystem, the MLP model consistently outperformed others, yielding an MSE of 1.47, MAE of 0.92, MAPE of 2.75, and RMSE of 1.21. While other models, such as SVM, ANN, CNN, LSTM, RF, and Ensemble, provided reasonable predictions, they exhibited higher error rates across all metrics, underscoring the MLP model’s superior capacity to accurately predict maximum temperatures in all three ecosystems during the T.Aman season [Table 5 and Fig. 4].

Table 5 Performance evaluation of machine learning models for maximum temperature prediction.
Full size table
Fig. 4

Model Performance of Predicted Maximum Temperature across different Ecosystems. (a) Barind, (b) Coastel and (c) Haor.

Full size image

The evaluation of five ML models SVM, MLP, ANN, RF, and Ensemble across the districts identified the Multi-Layer Perceptron (MLP) model as the best-performing model in all regions. The MLP consistently outperformed other models, showing the lowest errors across ecosystems. For instance, in the Coastal ecosystem, the MLP achieved an MSE of 0.98, an MAE of 0.73, a MAPE of 2.28, and an RMSE of 0.99. Similarly, in the Haor ecosystem, the MLP reported an MSE of 1.17, an MAE of 0.82, an MAPE of 2.64, and an RMSE of 1.08. Other models like SVM and RF generally exhibited higher error values, while ensemble models provided a balance between performance and robustness. These findings emphasize the MLP’s efficacy in capturing local-level variations with higher accuracy and lower prediction errors [Supplementary Tables S3–S17; Figures S1–S15].

Model performance evaluation for minimum temperature prediction

Across all three ecosystems, the Multi-Layer Perceptron (MLP) model emerged as the best-performing model for predicting minimum temperatures. In the Barind ecosystem, MLP had the lowest MSE (0.48), MAE (0.46), MAPE (1.78), and RMSE (0.69), outperforming other models. The Coastal ecosystem showed similar results, with MLP achieving the best performance, with an MSE of 0.44, MAE of 0.48, MAPE of 1.85, and RMSE of 0.66. In the Haor ecosystem, MLP again excelled, yielding the lowest MSE (0.48), MAE (0.47), MAPE (1.85), and RMSE (0.69). Although models such as SVM, ANN, CNN, LSTM, RF, and Ensemble also provided accurate predictions, MLP consistently provided the best overall fit across all ecosystems, demonstrating its superior ability to predict minimum temperatures in the T.Aman season [Table 6 and Fig. 5].

Table 6 Performance evaluation of machine learning models for minimum temperature prediction.
Full size table
Fig. 5

Model Performance of Predicted Minimum Temperature across Ecosystems. different Ecosystems. (a) Barind, (b) Coastel and (c) Haor.

Full size image

The best model evaluation for district-level predictions across the different ecosystems reveals that the Multi-Layer Perceptron (MLP) consistently outperforms other models in terms of error metrics such as MSE, MAE, MAPE, and RMSE. In most districts, the MLP demonstrates the lowest MSE and RMSE values, indicating better predictive accuracy. For instance, in districts within the Barind and Coastal ecosystems, the MLP model achieves MSE values as low as 0.63 and 0.52, respectively, with corresponding RMSE values of 0.80 and 0.72, suggesting superior model fit and generalization. Additionally, the MLP maintains relatively low MAE and MAPE values across most districts, reinforcing its consistent performance. While models like SVM and Ensemble also show competitive performance, especially in specific districts, MLP generally proves to be the best overall model for district-level prediction of minimum temperatures [Supplementary Tables S3–S17; Figures S1–S15].

tenfold cross validation is performed for each model to check the validity [Table 7]. The multilayer perceptron (MLP) consistently produced the most accurate predictions of minimum temperature. The mean error in Barind was 0.72 with a standard deviation of 0.11, in Haor it was 0.88 with a standard deviation of 0.08, and in the Coastal zone it was 0.58 with a standard deviation of 0.18. For maximum temperature, MLP again performed best in Barind with a mean error of 0.88 and a standard deviation of 0.07, and in the Coastal zone with a mean error of 1.01 and a standard deviation of 0.12. In Haor, however, the support vector machine (SVM) achieved the lowest error with a mean of 1.11 and a standard deviation of 0.33. Other models such as ANN, CNN, LSTM, and random forest generally produced higher errors with larger variability across all zones. Overall, MLP emerged as the most reliable model, with SVM showing an advantage only for maximum temperature in Haor.

Table 7 Cross validation result with standard deviation for both maximum and minimum temperature for checking model reliability.
Full size table

Assessment of risk area

Moran’s I analysis revealed distinct spatial patterns in temperature risk levels during the T.Aman season. For maximum temperature, all districts in the Barind region were categorized as severe risk (40 °C to < 42 °C), while the coastal region exhibited moderate risk across all districts (38 °C to < 40 °C). In the Haor region, Sylhet and Sunamganj fell under the moderate risk category (38 °C to < 40 °C), with the remaining districts classified as mild risk [Fig. 6].

Fig. 6

Risk classification of maximum temperature across study regions.

Full size image

For minimum temperature, Dinajpur, Rangpur, and Pabna in the Barind region were classified as very severe risk (temperatures below 4 °C), while other districts in the region showed severe risk. The coastal region uniformly exhibited moderate risk (6 °C to < 8 °C). In the Haor region, Sylhet was categorized as very severe risk, Moulvibazar as severe risk, and the remaining districts as moderate risk [Fig. 7]. All these categories were determined based on the official thresholds of the Bangladesh Meteorological Department (BMD, 2025)64.

Fig. 7

Risk classification of minimum temperature across study regions.

Full size image

Agricultural implications

The spatial risk patterns and temperature predictions from the MLP model provide actionable insights for agricultural planning and climate adaptation in Bangladesh. Farmers can use these findings to adjust sowing dates to avoid periods of extreme heat or cold, select rice cultivars with enhanced tolerance to temperature stress, and implement microclimate management practices such as shading, mulching, or agroforestry to buffer crops against thermal extremes. Regional planning authorities can utilize risk maps to target adaptation resources more effectively, including optimized irrigation scheduling, development of shelter belts, and allocation of extension services for climate-smart farming practices. Collectively, these strategies can help mitigate the adverse impacts of temperature variability, stabilize rice yields, and enhance the resilience of farming communities to climate change.

Discussion

Bangladesh has experienced significant shifts in temperature patterns from 1961 to 2023, with rising temperatures becoming a growing concern, especially during the T.Aman seasons. This analysis highlights regional disparities in climate change impacts on agriculture, water resources, and public health. The findings of the study found that during the T.Aman season, the overall mean maximum temperature is consistently 31.62 °C, while the mean minimum temperature is 24.02 °C, with significant variability observed across ecosystems and districts. The Barind and Coastal ecosystems stand out with relatively higher mean temperatures compared to other ecosystems. Districts such as Rajshahi and Rangpur tend to experience higher maximum temperatures, whereas Barisal and Bhola record lower minimum temperature extremes. Global Climate Model (GCM) projections suggest that winters globally will become warmer65, a pattern supported by this study. Historically, January and April were the coldest and hottest months in Bangladesh, respectively. However, recent findings indicate May has become the hottest month in the southwestern region, and January temperatures are gradually declining, likely due to ongoing climate change. Furthermore, this study aligns with previous studies emphasizing the influence of temperature variability on rice productivity, particularly in coastal areas where temperature impacts are more pronounced than rainfall anomalies66,67.

The Haor ecosystem demonstrated the strongest increasing trends in maximum temperature, while the Barind and Coastal ecosystems exhibited moderate upward trends. District-level analysis highlighted Sylhet in the Haor ecosystem and Khepupara in the Coastal ecosystem as experiencing the steepest increases. For minimum temperatures, the Coastal ecosystem exhibited the most pronounced upward trend, while the Haor ecosystem followed closely. Sylhet recorded the strongest district-level trend for minimum temperatures, emphasizing significant warming in the region. A gradual rise in temperature, particularly during the monsoon and winter seasons, has emerged as a concerning trend. Extreme heat can lead to crop wilting, sterility, and drought, while low temperatures can cause cold injuries and hinder plant growth and development68,69. The combination of rising temperatures and limited rainfall poses significant risks to agriculture, including drought and crop loss, which can further drive humans70,71.

The findings align with earlier predictions that temperature increases across Bangladesh are consistent with global warming trends72. Rice, a highly temperature-sensitive crop, is particularly vulnerable to these changes73. Contributing factors include population growth, deforestation, and greenhouse gas emissions74. Notably, the northern region, traditionally colder in winter due to its proximity to the Himalayan piedmont, may experience higher yields with increasing maximum temperatures, as warmer conditions could improve crop growth.

The MLP model consistently outperformed other ML models (SVM, ANN, RF, Ensemble) in predicting both maximum and minimum temperatures across ecosystems and districts. For maximum temperatures, MLP achieved the lowest errors across all ecosystems, with an MSE of 0.82, MAE of 0.69, MAPE of 1.92%, and RMSE of 0.90 in the Barind ecosystem. In the Coastal ecosystem, it yielded an MSE of 1.47, MAE of 0.92, MAPE of 2.75%, and RMSE of 1.21, while in the Haor ecosystem, the model showed superior accuracy with an MSE of 1.50, MAE of 0.91, MAPE of 2.74%, and RMSE of 1.23. Similarly, for minimum temperatures, MLP consistently outperformed the other models, achieving an MSE of 0.48, MAE of 0.46, MAPE of 1.78%, and RMSE of 0.69 in the Barind ecosystem, an MSE of 0.44, MAE of 0.48, MAPE of 1.85%, and RMSE of 0.66 in the Coastal ecosystem, and an MSE of 0.48, MAE of 0.47, MAPE of 1.85%, and RMSE of 0.69 in the Haor ecosystem. Several studies have highlighted the effectiveness of ML models, particularly Multi-Layer Perceptron (MLP), in predicting rainfall patterns. A study in Bangladesh demonstrated that the MLP model outperformed both statistical and other ML approaches in accurately predicting rainfall trends75. Similarly, a study in India evaluated various statistical and ML techniques and found that MLP-based models provided the most accurate predictions for rainfall forecasting62. In line with these findings, our study also revealed that the MLP model outperformed other approaches in rainfall prediction. The superior performance of MLP can be attributed to its ability to capture complex, non-linear relationships in temperature data. Unlike traditional statistical models, MLP can efficiently handle large datasets with high variability, making it particularly suitable for temperature prediction in diverse climatic conditions.

The findings of the study revealed significant spatial heterogeneity in temperature risks during the T.Aman season, directly impacting rice production and agricultural sustainability. The Barind region’s categorization under severe and very severe risk highlights its susceptibility to extreme temperatures, which could adversely affect rice yields and exacerbate water stress. Mitigation measures such as introducing heat-tolerant rice varieties and efficient irrigation practices are essential. In contrast, the coastal region’s moderate risk levels may allow for relatively stable rice production, potentially benefiting from temperature moderation due to proximity to large water bodies. The diverse risk patterns in the Haor region, particularly Sylhet’s very severe minimum temperature risk, emphasize the need for localized adaptive strategies, including cold-resistant rice varieties and timing adjustments for planting. These insights are critical for developing region-specific climate adaptation strategies to safeguard rice production and ensure agricultural resilience.

The study focuses on T. Aman rice because of its significant contribution to food security and the alignment of its growth period with peak temperature variability, making the findings particularly relevant. We acknowledge that crops with different phenology, such as Boro, Aus, or wheat, or regions with differing microclimates and management practices, may experience distinct responses to temperature trends. Nonetheless, the methodological framework employed—integrating spatio-temporal trend detection, machine learning-based prediction, and spatial risk mapping, is broadly applicable. With appropriate data, this approach can be extended to other crops, seasons, or regions, providing a valuable tool for guiding national-level agricultural adaptation strategies under climate change.

Limitations

We acknowledge several limitations in our trend detection and spatial analysis. The Mann–Kendall (MK) test assumes independence in the time series; the presence of autocorrelation can inflate Type I error rates, leading to false detection of trends. Additionally, the power of trend detection is influenced by sample length, variance, and the magnitude of the slope, with small slopes or high variance reducing confidence in detected trends. Non-parametric methods like MK and Sen’s slope estimator are effective for identifying monotonic trends but cannot capture nonlinear or non-monotonic climatic fluctuations. Furthermore, spatial interpolation using Inverse Distance Weighting (IDW) has inherent limitations in capturing local heterogeneity, which may affect the accuracy of spatial temperature variability patterns. The performance of machine learning models in this study is inherently dependent on the quality and quantity of the input data. Since the models were trained primarily on historical temperature records, their predictions may not fully account for future climatic anomalies or unprecedented extreme events, which could affect the accuracy and reliability of future temperature forecasts. It is important to note that the spatial interpolation methods employed, such as Inverse Distance Weighting (IDW), may not fully capture fine-scale temperature variations. Consequently, the precision of spatial risk assessments and the identification of localized climate impacts could be affected. Future studies may benefit from integrating higher-resolution datasets or advanced geostatistical techniques to improve spatial accuracy and better inform localized adaptation strategies.

Implications and recommendations

To address the challenges posed by rising temperatures and climate variability during the T.Aman season, targeted policy interventions are essential to safeguard rice production and agricultural sustainability in Bangladesh. Research and development should prioritize the introduction of heat-tolerant and cold-resistant rice varieties suited to the specific climatic conditions of vulnerable regions, such as the Barind and Haor ecosystems. In addition, adjusting planting dates to avoid periods of peak heat can further reduce crop stress and yield losses. Region-specific adaptive strategies, including efficient irrigation systems, water management, and crop calendar adjustments, should be implemented to mitigate the adverse impacts of extreme temperatures and water scarcity. For the Barind region, investments in drought-resistant rice varieties and advanced irrigation practices are crucial, while in coastal areas, promoting saline-tolerant varieties and improved drainage infrastructure can stabilize yields. Expansion of public awareness campaigns and farmer training programs on climate-smart agricultural practices will strengthen capacity at the grassroots level. Furthermore, incorporating advanced machine learning models like MLP into agricultural planning can enhance the accuracy of temperature and climate risk predictions, enabling policymakers to design proactive, region-specific interventions. Collectively, these measures can help maintain rice productivity, support food security, and improve resilience against climate-induced stress during the T.Aman season.

Conclusion

This study reinforces significant trends in maximum and minimum temperatures across Bangladesh during the T.Aman season, with notable variations across ecosystems and districts. The Multi-Layer Perceptron (MLP) model consistently outperformed other machine learning models, demonstrating robust predictive capability. However, the results should be interpreted with caution. Prediction uncertainties exist due to reliance on historical data, and spatial interpolation methods introduce approximations that may affect localized risk assessments. Consequently, the findings are most reliable for the studied regions and seasons, and extrapolation to other crops, seasons, or regions should be undertaken carefully. Despite these limitations, the study highlights the urgent need for climate adaptation strategies and advanced predictive modeling to mitigate the adverse impacts of rising temperatures, providing guidance for policymakers and researchers to enhance agricultural resilience and support sustainable development in Bangladesh.

Data availability

The data supporting the findings of this study are available upon reasonable request from the corresponding author.

References

  1. Dad, J. M., Muslim, M., Rashid, I. & Reshi, Z. A. Time series analysis of climate variability and trends in Kashmir Himalaya. Ecol. Indic. 126, 107690 (2021).

    Article 

    Google Scholar 

  2. Rahaman, M. H. et al. State of art of review on climate variability and water resources: bridging knowledge gaps and the way forward. Water Resour. 49, 699–710 (2022).

    Article 

    Google Scholar 

  3. Masroor, M. et al. Exploring climate variability and its impact on drought occurrence: Evidence from Godavari Middle Sub-Basin India. Weather Clim Extrem. 30, 100277 (2020).

    Article 

    Google Scholar 

  4. Wheeler, T. & Von Braun, J. Climate change impacts on global food security. Science 2013(341), 508–513 (1979).

    Google Scholar 

  5. Raj, S., Roodbar, S., Brinkley, C. & Wolfe, D. W. Food security and climate change: Differences in impacts and adaptation strategies for rural communities in the global South and North. Front. Sustain. Food Syst. 5, 691191 (2022).

    Article 

    Google Scholar 

  6. Zhao, C. et al. Temperature increase reduces global yields of major crops in four independent estimates. Proc. Natl. Acad. Sci. 114, 9326–9331 (2017).

    Article 
    ADS 
    PubMed 
    PubMed Central 

    Google Scholar 

  7. Islam, A. R. M. T. et al. Spatiotemporal nexus between vegetation change and extreme climatic indices and their possible causes of change. J Environ. Manage. 289, 112505 (2021).

    Article 
    PubMed 

    Google Scholar 

  8. Guo, E. et al. Spatiotemporal variations of extreme climate events in northeast china during 1960–2014. Ecol. Indic. 96, 669–683 (2019).

    Article 

    Google Scholar 

  9. Sun, Y. et al. Rapid increase in the risk of extreme summer heat in Eastern China. Nat. Climate Change 4, 1082–1085 (2014).

    Article 
    ADS 

    Google Scholar 

  10. Cancelliere, A., Mauro, G. D., Bonaccorso, B. & Rossi, G. Drought forecasting using the standardized precipitation index. Water Resources Manage. 21(5), 801–819 (2007).

    Article 

    Google Scholar 

  11. Nury, A. H., Hasan, K., Mohammed Erfan, K. & Chandra Dey, D. Analysis of spatially and temporally varying precipitation in Bangladesh. Asian J. Water Environ. Pollut. 13, 15–27 (2016).

    Article 

    Google Scholar 

  12. Das, S. Extreme rainfall estimation at ungauged locations: information that needs to be included in low-lying monsoon climate regions like Bangladesh. J Hydrol (Amst) 601, 126616 (2021).

    Article 

    Google Scholar 

  13. Das, S. & Islam, A. R. M. T. Assessment of temporal changes in frequency characteristics of annual maximum rainfall of daily duration over Bangladesh. Theor Appl Climatol 153, 323–334 (2023).

    Article 
    ADS 

    Google Scholar 

  14. Sultana, R., Irfanullah, H. M., Selim, S. A. & Budrudzaman, M. Vulnerability and Ecosystem-Based Adaptation in the Farming Communities of Droughtprone Northwest Bangladesh. Environ.Chall. 11, 100707 (2023).

    Article 

    Google Scholar 

  15. Implementation of the Global Strategy in Bangladesh Available online: https://www.fao.org/home/404 (accessed on 18 January 2025).

  16. Ferrand, E.A. Rainwater Harvesting as an Effective Climate Change Adaptation Strategy in Rural and Urban Settings. Managing Water Resources under Climate Uncertainty: Examples from Asia, Europe, Latin America, and Australia, 405–420 (2015)

  17. Amare, M., Jensen, N. D., Shiferaw, B. & Cissé, J. D. Rainfall shocks and agricultural productivity: Implication for rural household consumption. Agric Syst 166, 79–89 (2018).

    Article 

    Google Scholar 

  18. Gemmer, M., Fischer, T., Jiang, T., Su, B. & Liu, L. L. Trends in precipitation extremes in the Zhujiang River Basin, South China. J. Clim. 24, 750–761 (2011).

    Article 
    ADS 

    Google Scholar 

  19. Sarker, M. A. R., Alam, K. & Gow, J. Exploring the relationship between climate change and rice yield in Bangladesh: An analysis of time series data. Agric Syst 112, 11–16 (2012).

    Article 

    Google Scholar 

  20. Alexander, L.V., Zhang, X., Peterson, T.C., Caesar, J., Gleason, B., Klein Tank, A.M.G., Haylock, M., Collins, D., Trewin, B., Rahimzadeh, F. Global Observed Changes in Daily Climate Extremes of Temperature and Precipitation. Journal of Geophysical Research: Atmospheres (2006)

  21. Moberg, A. & Jones, P. D. Trends in indices for extremes in daily temperature and precipitation in Central and Western Europe, 1901–99. Int. J. Climatol. 25, 1149–1171 (2005).

    Article 

    Google Scholar 

  22. Tho, K. E., Brisco-McCann, E., Wiriyajitsomboon, P. & Hausbeck, M. K. Effects of temperature, relative humidity, and plant age on bacterial disease of onion plants. Plant Health Prog. 20, 200–206 (2019).

    Article 

    Google Scholar 

  23. Sonali, P. & Kumar, D. N. Review of trend detection methods and their application to detect temperature changes in India. J. Hydrol. (Amst) 476, 212–227 (2013).

    Article 
    ADS 

    Google Scholar 

  24. Pingale, S. M., Khare, D., Jat, M. K. & Adamowski, J. Spatial and temporal trends of mean and extreme rainfall and temperature for the 33 Urban centers of the arid and semi-arid State of Rajasthan. India. Atmos Res 138, 73–90 (2014).

    Article 

    Google Scholar 

  25. Piao, S. et al. The impacts of climate change on water resources and agriculture in China. Nature 467, 43–51 (2010).

    Article 
    ADS 
    PubMed 

    Google Scholar 

  26. Alexandersson, H. & Moberg, A. Homogenization of Swedish Temperature Data. Part I: Homogeneity test for linear trends. Int. J. Climatol. 17, 25–34 (1997).

    3.0.CO;2-J” data-track-item_id=”10.1002/(SICI)1097-0088(199701)17:1<25::AID-JOC103>3.0.CO;2-J” data-track-value=”article reference” data-track-action=”article reference” href=”https://doi.org/10.1002%2F%28SICI%291097-0088%28199701%2917%3A1%3C25%3A%3AAID-JOC103%3E3.0.CO%3B2-J” aria-label=”Article reference 26″ data-doi=”10.1002/(SICI)1097-0088(199701)17:1<25::AID-JOC103>3.0.CO;2-J”>Article 

    Google Scholar 

  27. Buishand, T. A. Some methods for testing the homogeneity of rainfall records. J. Hydrol. (Amst) 58, 11–27 (1982).

    Article 
    ADS 

    Google Scholar 

  28. Pettitt, A. N. A non-parametric approach to the change-point problem. J. R Stat. Soc. Ser. C Appl. Stat. 28, 126–135 (1979).

    Google Scholar 

  29. Villarini, G.; Serinaldi, F.; Smith, J.A.; Krajewski, W.F. On the Stationarity of Annual Flood Peaks in the Continental United States during the 20th Century. Water Resour Res (2009)

  30. Lane, B. Statistical Methods in Hydrology; Iowa state press, Iowa, (2002)

  31. Cooper, M. A non-parametric test for increasing trend. Educ Psychol Meas 35, 303–306 (1975).

    Article 

    Google Scholar 

  32. Sen, P. K. Estimates of the regression coefficient based on Kendall’s Tau. J Am Stat Assoc 63, 1379–1389 (1968).

    Article 
    MathSciNet 

    Google Scholar 

  33. Wu, H. & Qian, H. Innovative trend analysis of annual and seasonal rainfall and extreme values in Shaanxi, China, since the 1950s. Int. J. Climatol. 37, 2582–2592 (2017).

    Article 

    Google Scholar 

  34. Şen, Z. Trend identification simulation and application. J. Hydrol. Eng. 19, 635–642 (2014).

    Article 

    Google Scholar 

  35. Şen, Z. Innovative trend analysis methodology. J. Hydrol. Eng. 17, 1042–1046 (2012).

    Article 

    Google Scholar 

  36. Darji, M.P., Dabhi, V.K., Prajapati, H.B. Rainfall Forecasting Using Neural Network: A Survey. In Proceedings of the 2015 international conference on advances in computer engineering and applications; IEEE; 706–713 (2015)

  37. Pal, S. & Talukdar, S. Modelling seasonal flow regime and environmental flow in Punarbhaba River of India and Bangladesh. J. Clean. Prod. 252, 119724 (2020).

    Article 

    Google Scholar 

  38. Chakraverty, S. & Gupta, P. Comparison of neural network configurations in the long-range forecast of southwest monsoon rainfall over India. Neural Comput. Appl. 17, 187–192 (2008).

    Article 

    Google Scholar 

  39. Şahin, M., Kaya, Y. & Uyar, M. Comparison of ANN and MLR Models for Estimating Solar Radiation in Turkey Using NOAA/AVHRR Data. Adv. Space Res. 51, 891–904 (2013).

    Article 
    ADS 

    Google Scholar 

  40. Liu, Q., Zou, Y., Liu, X. & Linge, N. A survey on rainfall forecasting using artificial neural network. Int. J. Embed. Syst. 11, 240–249 (2019).

    Article 

    Google Scholar 

  41. Hossain, I., Rasel, H. M., Imteaz, M. A. & Mekanik, F. Long-term seasonal rainfall forecasting using linear and non-linear modelling approaches: A case study for Western Australia. Meteorol. Atmos. Phys. 132, 131–141 (2020).

    Article 
    ADS 

    Google Scholar 

  42. Samantaray, S., Tripathy, O., Sahoo, A., Ghose, D.K. Rainfall Forecasting through ANN and SVM in Bolangir Watershed, India. In Proceedings of the Smart Intelligent Computing and Applications: Proceedings of the Third International Conference on Smart Computing and Informatics, Volume 1; Springer; 767–774 (2020)

  43. Alam, W. et al. Improved ARIMAX modal based on ANN and SVM approaches for forecasting rice yield using weather variables. Indian J. Agric. Sci 88, 1909–1913 (2018).

    Article 

    Google Scholar 

  44. Arabeyyat, O., Shatnawi, N., Matouq, M. Nonlinear Multivariate Rainfall Prediction in Jordan Using NARX-ANN Model with GIS Techniques. Jordan Journal of Civil Engineering (2018)

  45. Kala, A., Vaidyanathan, S.G. Prediction of Rainfall Using Artificial Neural Network. In Proceedings of the 2018 International Conference on Inventive Research in Computing Applications (ICIRCA); IEEE; 339–342. (2018)

  46. Sihananto, A.N., Mahmudy, W.F. Rainfall Forecasting Using Backpropagation Neural Network. Journal of Information Technology and Computer Science (2017)

  47. Iqbal, M. An Introduction to Solar Radiation; Elsevier, (2012)

  48. Bangladesh Delta Plan 2100 Overview. Bangladesh Delta Plan 2100 (BDP-2100). Available at:https://www.bdp2100kp.gov.bd/BDP2100/Overview.(Accessed: 18 September 2025).

  49. Van Buuren, S. Multiple imputation of discrete and continuous data by fully conditional specification. Stat. Methods Med. Res. 16, 219–242 (2007).

    Article 
    MathSciNet 
    PubMed 

    Google Scholar 

  50. Grubbs, F.E. Sample Criteria for Testing Outlying Observations; University of Michigan, (1949)

  51. Neuhäuser, M., Test, M. International Encyclopedia of Statistical Science. Canada: Springer Berlin Heidelberg 1656–1658 (2011)

  52. Nelson, L. S. The Anderson-darling test for normality. J. Qual. Technol. 30, 298–299 (1998).

    Article 

    Google Scholar 

  53. Alexandersson, H. A homogeneity test applied to precipitation data. J. Climatol. 6, 661–675 (1986).

    Article 

    Google Scholar 

  54. Von Neumann, J. Distribution of the ratio of the mean square successive difference to the variance. Ann. Math. Stat. 12, 367–395 (1941).

    Article 
    MathSciNet 

    Google Scholar 

  55. Partal, T. & Kahya, E. Trend analysis in Turkish precipitation data. Hydrol.Process. Int. J. 20, 2011–2026 (2006).

    Article 
    ADS 

    Google Scholar 

  56. Adhikary, S. K., Muttil, N. & Yilmaz, A. G. Cokriging for enhanced spatial interpolation of rainfall in two Australian catchments. Hydrol. Process. 31, 2143–2161 (2017).

    Article 
    ADS 

    Google Scholar 

  57. Amini, M. A., Torkan, G., Eslamian, S., Zareian, M. J. & Adamowski, J. F. Analysis of deterministic and geostatistical interpolation techniques for mapping meteorological variables at large watershed scales. Acta Geophys. 67, 191–203 (2019).

    Article 
    ADS 

    Google Scholar 

  58. Anselin, L. Local indicators of spatial association: LISA. Geogr. Anal 27, 93–115 (1995).

    Article 

    Google Scholar 

  59. Bone, C., Wulder, M. A., White, J. C., Robertson, C. & Nelson, T. A. A GIS-based risk rating of forest insect outbreaks using aerial overview surveys and the Local Moran’s I Statistic. Appl. Geogr. 40, 161–170 (2013).

    Article 

    Google Scholar 

  60. Di Nunno, F., Zhu, S., Ptak, M., Sojka, M. & Granata, F. A stacked machine learning model for multi-step ahead prediction of lake surface water temperature. Sci. Total Environ. 890, 164323 (2023).

    Article 
    PubMed 

    Google Scholar 

  61. Karbasi, M. et al. Development of an enhanced bidirectional recurrent neural network combined with time-varying filter-based empirical mode decomposition to forecast weekly reference evapotranspiration. Agric Water Manag 290, 108604 (2023).

    Article 

    Google Scholar 

  62. Praveen, B. et al. Analyzing trend and forecasting of rainfall changes in India using non-parametrical and machine learning approaches. Sci.Rep. 10(1), 10342 (2020).

    Article 
    ADS 
    PubMed 
    PubMed Central 

    Google Scholar 

  63. Cifuentes, J., Marulanda, G., Bello, A. & Reneses, J. Air temperature forecasting using machine learning techniques: A review. Energies 13(16), 4215 (2020).

    Article 

    Google Scholar 

  64. Bangladesh Meteorological Department (BMD). Weather Forecast Portal, 2025. Available at: https://live6.bmd.gov.bd/p/Weather-Forecast

  65. Turral, H., Burke, J., Faurès, J.-M. Climate Change, Water and Food Security. (2011)

  66. Rahman, M. A., Kang, S., Nagabhatla, N. & Macnee, R. Impacts of temperature and rainfall variation on rice productivity in major ecosystems of Bangladesh. Agric. Food Secur. 6, 1–11 (2017).

    Article 

    Google Scholar 

  67. Shahadat, M.K., Mondal, H.S., Moushi, O.M., Hossain, M.B. Influence of Temperature and Rainfall Variability on T. Aman Rice Production in South-Western Coastal Area of Bangladesh. In: Proceedings of the 2019 10th International Conference on Computing, Communication and Networking Technologies (ICCCNT); IEEE, 1–5. (2019)

  68. Khalil, U., Ali, S., Rizwan, M., Rahman, K.U., Ata-Ul-Karim, S.T., Najeeb, U., Ahmad, M.N., Adrees, M., Sarwar, M., Hussain, S.M. Role of Mineral Nutrients in Plant Growth under Extreme Temperatures. Plant Nutrients and Abiotic Stress Tolerance 499–524 (2018)

  69. Atayee, A. R. & Noori, M. S. Alleviation of cold stress in vegetable crops. J. Sci. Agric. 4, 38–44 (2020).

    Google Scholar 

  70. Al-Mamun, A. et al. Identification of meteorological drought prone area in bangladesh using standardized precipitation index. J. Earth Sci. Clim. Change 9, 2 (2018).

    Google Scholar 

  71. Parrish, R. et al. A critical analysis of the drivers of human migration patterns in the presence of climate change: A new conceptual model. Int. J. Environ. Res. Public Health 17, 6036 (2020).

    Article 
    PubMed 
    PubMed Central 

    Google Scholar 

  72. Agrawala, S., Ota, T., Ahmed, A.U., Smith, J., Van Aalst, M. Development and Climate Change in Bangladesh: Focus on Coastal Flooding and the Sundarbans; OECD Paris, (2003)

  73. Hussain, S., Khaliq, A., Ali, B., Hussain, H.A., Qadir, T., Hussain, S. Temperature Extremes: Impact on Rice Growth and Development. Plant abiotic stress tolerance: agronomic, molecular and biotechnological approaches 153–171 (2019)

  74. Mizanur Rahman, M., Rakib Hossain, M., Nazrul Islam, M. Climate Change Impact on Sundarbans: Challenges for Mitigation Strategies. In Springer Climate; Springer Science and Business Media B.V. 47–64 (2021)

  75. Monir, M. M. et al. Spatiotemporal analysis and predicting rainfall trends in a tropical monsoon-dominated country using makesens and machine learning techniques. Sci. Rep. 13, 13933 (2023).

    Article 
    ADS 
    PubMed 
    PubMed Central 

    Google Scholar 

  76. Li, D., Xie, H. & Xiong, L. Temporal change analysis based on data characteristics and nonparametric test. Water Resour. Manage 28, 227–240 (2014).

    Article 

    Google Scholar 

Download references

Acknowledgements

We gratefully acknowledge all the scientists who contributed to this study. We also extend our sincere thanks to the PARTNER Project – BRRI Part and the BRRI Agromet Laboratory for their invaluable support and assistance throughout the research.

Funding

We would like to thank PARTNER Project – BRRI Part and the BRRI Agromet Laboratory for funding this research.

Author information

Authors and Affiliations

Authors

Contributions

Niaz Md. Farhat Rahman (NMFR): Conceived and designed the study, conducted statistical analyses, prepared visualizations, and drafted the full manuscript. Md. Asadullah (MA): Curated and formatted datasets for analysis and contributed to the statistical analysis process. Md. Sabbir Hossain (MSH): Contributed to writing some parts of the manuscript. Md. Jamal Uddin (MJU): Provided guidance on statistical modeling and analysis and contributed to manuscript refinement. Nazmul Haque (NH): conducted data analysis, prepared the figures, and drafted the manuscript. Md. Bazlur Rashid (MBR): Compiled and organized all relevant datasets. Md. Rafiqul Islam (MRI): Contributed to manuscript review and critical revisions. Abul Bashar Md. Zahid Hossain (ABMZH): Contributed to manuscript review and critical revisions. Md. Azizul Baten (MAB): Supervised the research project and provided overall guidance throughout the study.

Corresponding author

Correspondence to
Niaz Md.Farhat Rahman.

Ethics declarations

Competing interests

The authors declare no competing interests.

Additional information

Publisher’s note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Supplementary Information

Below is the link to the electronic supplementary material.

Supplementary Material 1

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License, which permits any non-commercial use, sharing, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if you modified the licensed material. You do not have permission under this licence to share adapted material derived from this article or parts of it. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.

Reprints and permissions

About this article

Cite this article

Rahman, N.M., Asadullah, M., Hossain, M.S. et al. Spatiotemporal trends and machine learning-based prediction of temperature variability during the T. Aman rice-growing season in Bangladesh.
Sci Rep 15, 44883 (2025). https://doi.org/10.1038/s41598-025-28804-x

Download citation

  • Received:

  • Accepted:

  • Published:

  • Version of record:

  • DOI: https://doi.org/10.1038/s41598-025-28804-x

Keywords

  • Minimum temperature
  • Maximum temperature
  • MLP
  • ANN
  • Machine learning


Source: Ecology - nature.com

A study on energy consumption analysis and prediction of electric bus at intersections considering driving behavior

Spatio-temporal variation and dynamic scenario simulation of ecological risk in a typical artificial Oasis in Northwestern China

Back to Top