Machine Learning Algorithm-Based Prediction of Groundwater Table in Bogura District, Bangladesh.
1. IntroductionGroundwater is an important natural resource for various purposes, such as domestic, industrial, and irrigation. Unfortunately, the same groundwater resources, exploited by these industries, have been over-extracted in many regions of the world. The multiple effects of unsustainable GW use and management are increasingly becoming a paramount problem in the world, and particularly so in developing countries [1]. Overexploitation of groundwater is causing a reduction in the quantity and quality of the resource in many parts of the world [2, 3]. Reducing GWT has adverse effects on the environment, such as reduced well yields, land subsidence costs, increased groundwater pumping costs, and dry wells [4]. The solution to this problem lies in efficient management of water sources. One straightforward hydrogeological measure widely used to estimate the volume of groundwater is the groundwater level (GWL). Therefore, accurate and reliable GWL forecasts are essential for water resource planning and management [5, 6]. Accurate assessments of groundwater levels allow water managers, engineers, and other stakeholders to develop more efficient plans to reduce adverse effects such as pumping loss in residential water supply wells, land surface subsidence, and aquifer compaction [7].
Numerous methods, including numerical, software, and physical models, have been developed to forecast GWL [8, 9]. At the regional level, the physical-based methods yield results that are highly accurate when complex hydrogeological conditions are considered. Numerical models are based on the governing equations of groundwater flow. In fact, a number of academics have presented a number of software process models, including Hydro Geo Sphere, FEFLOW, and MODFLOW [10]. Out of the three approaches, physically based models are frequently the most popular for representing hydrological variables; yet, they have some practical drawbacks, such as requiring a lot of hydrogeological data [4]. Furthermore, the numerical models require a great deal of physical property and aquifer condition quantification, which is time-consuming and has practical constraints [11]. Machine learning and deep learning models are data-driven and discover the underlying processes and patterns found in historical records; therefore, they do not require this form of quantification [12]. Due to their ability to get beyond the drawbacks of physical models, machine learning methods have gained popularity over the past 20 years for forecasting GWL changes [13-15]. Machine learning has been utilized in the field of civil engineering for various purposes like compressive strength prediction [16], risk assessment [17], soil liquefaction prediction [18-20], ground water quality assessment [21], wind speed prediction [22, 23], soil compressive strength assessment [24], ground water level modeling [25]. Several machine learning techniques have been extensively utilized to predict GWL. Ramasamy et al. [26] assessed the GWT of the Chennai region employing widely recognized machine learning methodologies such as support vector machines (SVM), backpropagation, and adaptive neuro-fuzzy inference systems (ANFIS). The input parameters are latitude, longitude, and the depth of the water table. The SVM provides results that are acceptable when employing these parameters. Gaffoor et al. [27] investigate the effectiveness of deep learning and ensemble techniques for the prediction of groundwater levels in Southern Africa. GWT was accurately predicted by gradient-boosted decision tree (GBDT) and LSTM neural network (LSTM-NN) models, developed using two bore logs for different monitoring months. The results show that the prediction performance of the LSTM model is better than that of GBDT. Igwebuike et al. [28] performed a groundwater study for the South African setting in 2024. SimpleRNN, Long-Short Term Memory NN (LSTM-NN), and two machine learning techniques, namely, Random Forest (RF) and Support Vector Machine (SVM), were used in the study. Wei et al. [29] developed modified hybrid methods for the improvement of GWT forecasting. To forecast the GWL in East Azerbaijan Province, Iran, Nourani et al. [30] used a combination of ANN for their model. The study indicates that GWL in the province can be reliably predicted by a hybrid trained with the Levenberg-Marquardt (LM) optimization method. Sahoo et al. [31] built multi-linear regression (MLR) and artificial neural network (ANN) models to forecast GWL at several points in Japan. The results indicate ANN models were superior to an MLR model, and the two models can be applied for GWL prediction. Kalu et al. [32] designed a machine learning approach based on Deep Belief Network (DBN) to simulate monthly GWL changes in southern Africa. Findings are that the DBN is capable of predicting and simulating GWT very well. Kayhomayoon et al. [33] designed an ANFIS model for forecasting groundwater levels in the Northwestern Iranian underground reservoirs at Urmia.
The research indicated that the hybrid ANFIS model could well model and forecast GWLs, outperforming the classic ANFIS model when combined with the Ant Colony Optimization for Continuous Domains (ACOR). As a result, the application of data-driven ML and DL models for modeling and forecasting groundwater levels has not been optimally utilized worldwide. The goal of the study is to find effective machine learning models that can be used to predict and simulate GWL in the Bogura District. Bogra District is in Bangladesh and has GPS coordinates of 24[degrees] 51' 3.745" N and 89[degrees] 22' 11.001" E. The data was collected as a single-time measurement from 335 observation wells in Bangladesh's Bogura district. The compiled data set and feature scaling were first used to create GWT forecasting machine learning models. This research examines the produced models to determine which is the best model. Using kriging interpolation in the ArcGIS software, the predicted GWT fluctuation across the study area was presented.
2. Materials and Methods
The groundwater level prediction model follows a systematic pipeline for optimal performance. Initially, the authors collected data as a single-time measurement from 335 observation wells in Bangladesh's Bogura district. The dataset is made up of 335 points of groundwater latitude, longitude, and depth within Bogura. Table 1 gives an overview of the data collected.
The raw data, such as latitude and longitude, was further aggregated by identifying significant spatial information. The Correlation-based Feature Selection (CFS) technique was employed for selecting top features that were highly correlated with the class predictions. A train-test split was then used to separate the data into training and testing sets, ensuring an even distribution of the target variable. The authors used a number of machine-learning models, including Random Forest, and optimized the hyperparameters with the use of modern techniques such as PSO, GA, and SA. Lastly, performance measures including MSE, RMSE, [R.sup.2], and MAE were used to evaluate the model's predicted accuracy on the test set. Figure 1 provides a graphic summary of the complete procedure.
2.1. Feature engineering
Feature engineering is essential for enhancing groundwater level estimate algorithms' prediction capabilities. Informational patterns were extracted from the raw data using a variety of statistical and geographical adjustments. The goal of these changes is to improve the model's capacity to represent the geographic patterns, non-linear interactions, and spatial dependencies that affect groundwater table (GWT) variability.
2.1.1. Interaction features
To capture spatial dependencies between longitude and latitude, interaction terms were introduced (Equation 1) [34]. These features help in modeling the combined influence of geographical coordinates on groundwater levels.
[I.sub.LL] = L * [empty set], [I.sub.L+] = L + [empty set] (1)
where [I.sub.LL] represents the interaction term obtained by multiplying longitude (L) and latitude (0), while [I.sub.L+] is the additive combination of these coordinates. These features allow the model to capture potential correlations between geographical positioning and groundwater levels.
2.1.2. Polynomial features
Non-linear effects are often present in groundwater movement due to variations in terrain, geological formations, and hydrological conditions. To model these complexities, polynomial transformations were applied (Equation 2) [35].
[P.sub.L] = [L.sup.2], [P.sub.L[empty set]] = L * [[empty set].sup.2], [P.sub.[empty set]] = [[empty set].sup.2] (2)
Here, [P.sub.L] and [P.sub.[empty set]] represent squared terms of longitude and latitude, re spectively, which help in capturing quadratic variations. Additionally, [P.sub.L[empty set]] introduces a higher-order interaction, further enriching the model's ability to learn spatially complex relationships.
2.1.3. Distance-based features
The spatial positioning of an observation relative to a reference point can influence groundwater depth due to variations in altitude, proximity to water bodies, and subsurface structures. To incorporate this, the Euclidean distance from a central reference point was computed (Equation 3) [36].
[Please download the PDF to view the formula] (3)
where [bar.L] and [bar.[empty set]] are the mean longitude and latitude across all data points. This feature allows the model to account for localized variations in groundwater level by measuring how far a location deviates from the central reference. To ensure uniform scaling across distances, a normalized version of this feature was also introduced in Equation 4 [36].
[D.sub.norm] = [D-[D.sub.min]/[D.sub.max]-[D.sub.min]] (4)
This transformation rescales the distance feature into the range [0, 1], pre venting numerical instability and improving model convergence.
2.1.4. Geospatial transformations
Latitude and longitude exhibit periodic properties when representing spatial data. To preserve these cyclic patterns, trigonometric transformations were applied (Equation 5) [37].
[S.sub.L] = sin(L), [S.sub.[empty set]] = sin([empty set]), [C.sub.L] = cos(L), [C.sub.[empty set]] = cos([empty set]) (5)
where [S.sub.L] and [C.sub.L] represent the sine and cosine transformations of longi tude, and [S.sub.[empty set]], [C.sub.[empty set]] correspond to latitude. These transformations help in cap turing directional influences and prevent discontinuities in spatial coordinates.
2.1.5. Clustering-based features
Groundwater behavior can exhibit regional clustering due to similar geological formations, soil properties, or hydrological conditions. To group locations with similar groundwater patterns, K-means clustering was applied (Equation 6) [38].
[C.sub.i] = KMeans(L, [empty set], k) (6)
where [C.sub.i] is the cluster assignment for each location, and k represents the number of clusters (set to 5 in our case). The cluster ID was then used as a categorical feature, allowing the model to distinguish between different spatial regions.
2.1.6. Distance to nearest neighbor
Groundwater levels can be influenced by the density of nearby observations, as closely spaced locations may share similar hydrological properties. To quantify this, the distance to the nearest neighbor was computed using k-Nearest Neighbors (Equation 7) [38].
[Please download the PDF to view the formula] (7)
where [D.sub.NN] is the distance between location i and its most closely located observation j. This feature contributes to describing local spatial density and its effect on groundwater level variability.
2.1.7. GWT Categorization
To improve interpretability and categorization of groundwater depth, the value of G was discretized into bins according to its statistical distribution (Equation 8).
B = [[G.sub.min] - 0.01, [bar.G], [G.sub.max] + 0.01, [G.sub.max] + 1] (8)
where [bar.G] is the mean groundwater level, and the bins segment the data into three categories:
[Please download the PDF to view the mathematical expression]
This classification is useful for distinguishing between potential groundwater regimes in different areas and for guiding the development of models that can reproduce regional hydrological responses.
2.1.8. Parameter definitions
The notations employed in this section are given by: Longitude (L) and Latitude ([empty set]): These are the observation points' coordinate locations. The product ([I.sub.LL]) and sum ([I.sub.L+]) of such coordinates, termed interaction terms, aid in searching for spatial relationships. Non-linear changes of groundwater levels are described by polynomial terms ([P.sub.L], [P.sub.[empty set]], [P.sub.L[empty set]]). The Euclidean distance (D) represents the point away from the reference mean position, [bar.L], [bar.[empty set]]; with its normalized version (Dnorm), it ensures numerical stability. Trigonometric functions ([S.sub.L], [C.sub.L], [S.sub.[empty set]], [C.sub.[empty set]]) keep the cyclic nature of spatial data. The clustering feature ([C.sub.i]) aggregates locations with similar hydrological characteristics. The nearest neighbor distance ([D.sub.NN]) measures spatial density and contributes to the representation of local aquifer heterogeneity. Lastly, the discretized GW table categories ([G.sub.c]) make fluctuation of groundwater more intelligible. The motivation behind feature engineering is to help the model capture spatial and non-linear relationships for obtaining more accurate estimates of groundwater level. Through the introduction of interaction, polynomial, distance-based, geospatial, clustering, and categorical transformations, we increase the models' ability to do well under a variety of hydrological conditions. These constructed features allow for a more expressive representation of the data, which leads to better predictive accuracy.
2.2. Feature correlation and selection
Scientists analyze the relationship between each factor and the target to ensure that only the most significant factors are included in the prediction of one groundwater level. The use of the correlation analysis provides a new method to retain key features and exclude duplicate or weakly related ones, leading to a deeper discussion on the linear relationship between GWT and independent factors. In this analysis, the Pearson correlation coefficient for the feature is calculated in relation to the target value Y (GWT) [39].
[Please download the PDF to view the formula] (9)
where [Please download the PDF to view the mathematical expression] and [[mu].sub.[gamma]] are the means of [X.sub.i] and Y, respectively. A higher magnitude of absolute value [Please download the PDF to view the mathematical expression] implies that the attribute is more informative to predict GWT. However, if features are chosen using only correlation, some of them will be multicollinear, and this may result in poor predictive models. The authors use the Correlation-Based Feature Selection (CFS) algorithm [40] to select features in a systematic manner. This approach focuses on the features that have a stronger correlation to the target and a smaller correlation among them in order to remove redundancy. In the beginning, they set a threshold for Pearson's correlation of [tau] = 0.1 to exclude weakly correlated features. Furthermore, when two features have correlation values of at most [member of] = 0.001 away from each other, we keep only the feature with higher correlation with GWT. This method guarantees that the chosen features make a substantive contribution to the predictive model, which leads to an improvement in both performance and interpretability.
2.3. Proposed PSO-RF algorithm
Tuning hyperparameters is necessary to enhance the model's performance in machine learning algorithms. In this study, the hyperparameters of the RF model are optimized with PSO. The PSO, which is a population-based stochastic optimization algorithm, simulates the movement of particles in a multi-dimensional search space. The proposed PSO-RF method successfully discovers the best hyperparameter configurations to minimize errors over unmodeled data. The optimization of this study's hyperparameters concentrates on five critical parameters of the Random Forest model. These are the feature subset size, minimum samples per split, minimum samples per leaf, tree depth, and number of estimators. The minimum and maximum values of each parameter are set by practical limitations and model assumptions. By automatically striking a balance between exploration and exploitation within this parameter space, the PSO algorithm effectively explores this space, ensuring good performance with minimal operator intervention. Performance of the fine-tuned model is evaluated using MSE, RMSE, the coefficient of determination ([R.sup.2]), and MAE.
Algorithm 1: PSO-RF Hyperparameter Optimization Input: X (feature matrix), y (target variable), S (swarm size), I (maximum iterations) Output: Optimized Random Forest model 1 Split data into training ([X.sub.traln], [y.sub.traln]) and testing ([X.sub.test], [y.sub.test]) sets 2 Define hyperparameter bounds: 3 lb [left arrow] [lower bound values for each parameter], ub [left arrow] [upper bound values for each parameter] 4 Initialize swarm P of size S with random solutions within bounds 5 for i = 1 to I do 6 for each particle p [member of] P do 7 Decode p into RF hyperparameters 8 Train RF model on ([X.sub.train], [y.sub.train]) 9 Compute fitness as Mean Squared Error 10 [Please download the PDF to view the mathematical expression] 11 Update velocity and position based on PSO dynamics 12 end 13 end 14 Retrieve best hyperparameters minimizing MSE 15 Train final RF model with optimized parameters 16 Evaluate model using RMSE, [R.sup.2], and MAE 17 return Optimized RF model
2.4. Base line models
To evaluate the performance of the proposed PSO-RF model, the authors compare it against several advanced algorithms.
2.4.1. XGBoost
XGBoost is an efficient gradient boosting technique that successively constructs decision trees. The strategy is based on linearizing an objective function around the prior forecast and then adding a minor increment to minimize this goal (Equation 10) [41].
[Please download the PDF to view the formula] (10)
In this case, [[^.t].sub.p] stands for the expected values, r([z.sub.i]) is the regularisation factor for the k-th model element, which is used to prevent overfitting, and E indicates the error metrics (such as mean squared error).
2.4.2. Gradient boosting trees (GBT)
GBT builds trees sequentially to correct the errors of previous trees. The final output is predicted by Equation 11 [42].
[Please download the PDF to view the formula] (11)
Where [[gamma].sub.t] is the learning rate, [DT.sub.t](x) refers to the estimation generated by the t-th Decision Tree (DT), and T represents the overall count of trees within the ensemble.
2.4.3. Random forest (RF)
An ensemble technique called Random Forest constructs many decision trees and combines their forecasts. Each tree trains from a different set of training data, and the end forecast is the average (in regression) of all the predictions made by each tree. The mathematical framework is given by Equation 12 [43].
[Please download the PDF to view the formula] (12)
where T represent the overall number of trees in the forest, and [DT.sub.t](x) denote the forecast produced by the t-th decision tree.
2.4.4. Bagging regression
Another ensemble technique known as "Bagging" (Bootstrap Aggregating) combines the predictions of many models that have been trained on various bootstrapped subsets of the data. Equation 13 provides the subsequent prediction [44].
[Please download the PDF to view the formula] (13)
The forecast from the t-th model is denoted by [[^.y].sub.t], where T is the total number of models. Bagging averages predictions from many models to help minimise variation.
2.4.5. AdaBoost
AdaBoost (Adaptive Boosting) integrates weak learners to form a robust prediction model. AdaBoost trains each succeeding model to fix prior models' errors. Equation 14 calculates the final forecast [45].
[Please download the PDF to view the formula] (14)
where [[alpha].sub.t] is the weight allocated to the t-th model, [h.sub.t](x) represents the predicted value of the t-th weakest learner, and T signifies the overall number of models. AdaBoost modifies the weight of each model according to its performance, giving more weight to models that exhibit superior efficacy.
2.5. Optimization algorithms
Three optimization methods that are often used in hyperparameter optimization are covered in this section: PSO, GA, and SA.
2.5.1. PSO
PSO is a population-oriented optimization technique that draws inspiration from natural social behaviors. Particles' location and velocity are updated according to the swarm's global best position as well as their individual best positions. The position change is provided by equations 15 and 16 [46].
[Please download the PDF to view the formula] (15)
[x.sup.t+1.sub.n] = [x.sup.t.sub.n] + [v.sup.t+1.sub.n] (16)
where [x.sup.t.sub.n] and are the position and velocity of particle n, respectively, w is the inertia weight, acceleration constants are denoted by [c.sub.1], [c.sub.2], and random numbers are expressed as [r.sub.1], [r.sub.2]. The algorithm iterates until a stopping criterion is met.
2.5.2. GA
Genetic Algorithm (GA) is a method of evolutionary computation that replicates the mechanism of natural selection. It develops a population of solutions using selection, crossover, and mutation processes. The efficacy of a certain solution is assessed using a fitness function as delineated in Equation 17 [47].
f(x) = fitness of individual x (17)
Selection chooses parents proportionally to their fitness, crossover combines parent solutions in producing offspring, and mutation injects randomness. The algorithm evolves the population from one generation to the next.
2.5.3. Simulated annealing (SA)
SA is a stochastic optimization method that draws inspiration from the metallurgical annealing process. Equation 18 provides an acceptance probability function that determines whether the algorithm accepts new solutions [48].
[Please download the PDF to view the formula] (18)
In this context, [DELTA]E represents the change in the objective function, while T denotes the temperature. The temperature decreases in time as determined by a cooling schedule (Equation 19).
Where AE represents the alteration in the objective function, whereas T denotes the temperature. The temperature decreases over time following a cooling schedule (Equation 19) [48].
[T.sub.t+1] = [alpha][T.sub.t] (19)
where [alpha] is the cooling rate. SA gradually becomes more likely to accept only improving solutions as the temperature decreases.
2.6 Optimization setup
We configured hyperparameters of the RF model using predefined parameter ranges and control settings to ensure fair and reproducible comparisons. Five hyperparameters were considered: number of estimators (n_estimators), maximum depth (max_depth), minimum samples required to split a node (min_samples_split), minimum samples required at a leaf node (min_samples_leaf), and the number of features considered at each split (max_features). A common search space was applied across all optimization methods with lower bounds [1,1,1,1,1] and upper bounds [1000,30,30,20,F], where F denotes the total number of input features. For PSO, a swarm size of 50 particles and 200 optimization iterations were used. The GA employed a population size of 50 individuals, while SA was executed for a maximum of 200 iterations. All experiments were conducted using a fixed random seed of 42 to ensure reproducibility.
3. Results and discussion
3.1. Performance metrics
To evaluate the precision and dependability of the procedures, the authors utilize a number of well accepted criteria.
3.1.1. Root mean squared error (RMSE)
RMSE measures the average variance between the actual and predicted values in regression problems (Equation 20). It stands for the square root of the mean of the squared deviations between the actual data and the forecasts. The RMSE is lower for a good model [49].
[Please download the PDF to view the formula] (20)
The equation (20) indicates that [v.sub.n] and [[^.v].sub.n] are the actual and the estimated variables for each data point n, respectively, while t is the total number of patterns. RMSE is very sensitive to outliers and also puts more weight on bigger errors due to that squaring term.
3.1.2. Mean squared error (MSE)
The square deviation from the ground truth is calculated by MSE (Equation 21) between target values and output ones. It evaluates model accuracy, and the smaller MSE yields higher accuracy [50].
[Please download the PDF to view the formula] (21)
where n is the number of all observations; [a.sub.t] and [b.sub.t] are the actual value and estimated value for the t-th observation, respectively.
3.1.3. Mean absolute error (MAE)
A straightforward measurement for the prediction accuracy is achieved through the MAE, where predictions and true values are compared by averaging all absolute errors while considering all variances in a similar manner (Equation 22) [49].
[Please download the PDF to view the formula] (22)
In this context, z represents the total number of data points, [a.sub.e] denotes the actual value for the e-th data point, and [b.sub.e] refers to the estimated amount for the e-th data point. While RMSE does not show a difference between the two indicators, MAE would indicate which indicator is worse on average and is less sensitive to extreme values.
3.2. Feature correlation and selection results
Figure 2 shows the correlation matrix of the features in the dataset, which can help us understand how well different variables interact with each other. A graphical representation suggests that there are strong associations, especially with features derived from "Longitude (E)," such as "Longitude squared" and "Longitude Latitude squared." Furthermore, "Latitude (N)" and its close-running variables like "Latitude squared" are highly correlated, proving an obvious dependence on each other. Interaction features, e.g., "Longitude Latitude Interaction," do not have table lookups to any tables with longitude- or latitude-like variables, reinforcing the way that we stack effects of spatial relationships. The CFS algorithm was used by this work to choose the most useful features for prediction. This approach highlighted a subset of features with high predictive power and low redundancy. "cos Longitude," "Longitude Latitude Interaction," "cos Latitude," Cluster ID, and others are the selected features that were based on their strong contribution to model performance. These features correspond to a rich set of spatial and interaction terms that will help improve the model's predictive accuracy without too much multicollinearity.
3.3. Model evaluation
3.3.1. Model evaluation before parameter optimization
Machine learning model performances were assessed by several regression indicators: MSE, RMSE, [R.sup.2], and MAE in terms of training and test datasets. We present the results in Table 2 and discuss variations in generalization power and prediction accuracy across models. From the results, it is apparent that XGBoost and Gradient Boosting exhibited the smallest training errors, which may imply that they fitted too close to the training data. But their test errors are larger, which suggests overfitting. Random Forest and Bagging showed a relatively more balanced performance between training and test; for AdaBoost, the test accuracy was relatively lower. These preliminary observations will become a reference for future parameter adjustments to improve model generalization.
3.3.2. Model performance after hyperparameter optimization
After optimizing hyperparameters with RandomizedSearchCV, the best model achieved better performance than its default version. Table 3 shows the evaluation of metrics for more models after optimization. We see that, after tuning hyperparameters, XGBoost and gradient boosting have brought the balance between being trained further before getting to overfit.
XGBoost and Gradient Boosting both have higher test MSE, which means that optimization helps to reduce overfitting. Test results of the Random Forest model are also relatively high, indicating its stability. RF is superior not only in the estimation of GWT but also in other disciplines [51-52]. Though AdaBoost performed well in terms of training accuracy, its test performance was indicative of overfitting. These results indicate that hyperparameters have a substantial effect on model generalization.
3.4. Comparison of RF hyperparameter optimization methods
Three metaheuristic algorithms, including Genetic Algorithm (GA), Simulated Annealing (SA), and Particle Swarm Optimization (PSO), were utilized with the RF model to improve classification performance by tuning the hyperparameters. These optimized results are reported in Table 4. It can be seen that the PSO-RF model not only has the lowest test MSE of 0.42561 but also the highest test [R.sup.2] measure (0.84093), further showing its higher generalization capability than both GA-RF and SA-RF.
The results show that the PSO-RF model is better than both GA-RF and SA-RF regarding the test MSE (0.42561) and the test [R.sup.2] (0.84093), indicating its good generalization ability. SA-RF also performs well, outperforming GA-RF for all test metrics. Nevertheless, GA-RF has the poorest performance compared to the other two optimization methods. The PSO-RF model is recommended as the best one for this task, due to its high accuracy.
Hyperparameter optimization for RF is a non-convex, partially discrete search space with parameters like tree count, the depth of the tree, and features to select that are highly interrelated. GA based on stochastic operators (e.g., crossover, mutation) could cause sudden changes that affect the convergence behavior (especially in high-dimension or mixed-type problems). SA works well for local refinement but is based on a relatively sequential search and thus more likely to get stuck in local minima under a limited number of iterations. PSO, through its velocity-driven updates, facilitates smooth and coordinated exploration of this intricate search space, resulting in more stable and consistent convergence behavior. These characteristics underscore the suitability of PSO for efficiently navigating the hyperparameter space in the considered optimization task. As seen in Figures 3(a-f), the results will be presented as a map.
4. Conclusion
The objective of this study was to facilitate the prediction of water-table levels using three advanced hyperparameter optimization techniques: GA, SA, and PSO. We then employed these techniques to modify the hyperparameters of a random forest model that determined groundwater depth. We tested the optimized models using Test MSE, Test RMSE, Test [R.sup.2], and Test MAE. The observations indicate that the predictions become substantially better through the usage of these optimized methods. Among the three methods, PSO-RF achieved the best performance in terms of predictive power. The test MSE for PSO-RF was the smallest (0.42561), and the test [R.sup.2] was the best (0.84093). In other words, it is a sound model that will work well with new data. This might make particle swarm optimization a great way to make machine learning models that predict how much water is in the ground work well. It provides highly accurate results, especially for challenging regression problems in environmental studies. The two GA-RF and SA-RF models also performed well. The resulting Test MSE for GA-RF was 0.63832, and the Test [R.sup.2] was 0.76143. The test MSE of SA-RF was 0.44172, and the test [R.sup.2] scores were 0.83491. The PSO-based solution was superior to these models although they contributed to enhancing performance. This result supports the argument that PSO is more efficient in exploring solution space to find out the best hyperparameters, and hence, the model performs better. In fact, the reason the PSO-RF model is so successful is that Particle Swarm Optimization utilizes this rule of particles moving together to find the optimal solution immediately. Through optimization, the model becomes excellent at discovering complex patterns in groundwater data, which ensures that its predictions are highly accurate. The hyperparameter optimization also stops converging to an overfitted model, and we achieve better results for both testing and training. This paper highlights the importance of the hyperparameter tuning step for improving performance in predicting groundwater levels. The PSO-RF is a helpful tool for modeling the environment, especially when it comes to predicting groundwater levels. It's critical for monitoring the health of the environment and safeguarding water resources. It is concluded that the results are likely to indicate the potential of PSO-RF for other domains, such as flood forecasting or climate change modeling, in which this kind of environmental variable leads to outcomes. Hybrid optimization with the combination of PSO and techniques, such as Deep Reinforcement Learning, may lead to higher performance that necessitates them for future work. And there might be new environmental factors that can be added to the dataset, such as soil moisture content or patterns of rainfall or human activity, which could help the model make better predictions. It can also simulate and respond to evolving hydrologic regimes for flexible water management, e.g., for reservoir operation, pumping schedules, or irrigation scheduling in space and time supported by long-term impacts and risk analysis.
Funding
This research did not receive any specific grant from funding agencies in the public, commercial, or not-for-profit sectors.
Data availability
The data of the study are not publicly available, but the author may supply them upon reasonable request.
Author contributions
Md. Mahabub Rahman: Conceptualization, Software, Investigation, Supervision, Data curation, Formal analysis, Visualization, Writing--original draft, Writing--review & editing Md. Emran Biswas: Formal analysis, Methodology, Software, Validation; Visualization, Writing--original draft.
Conflicts of interest
The authors declare no conflicts of interest.
References
[1.] Konikow, L. F., & Kendy, E. (2005). Groundwater depletion: A global problem. Hydrogeology journal, 13(1), 317-320. https://doi.org/10.1007/s10040-004-0411-8
[2.] Yoon, H., Jun, S. C., Hyun, Y., Bae, G. O., & Lee, K. K. (2011). A comparative study of artificial neural networks and support vector machines for predicting groundwater levels in a coastal aquifer. Journal of Hydrology, 396(1-2), 128-138. https://doi.org/10.1016/j.jhydrol.2010.11.002
[3.] Ranjbar, A., & Mahjouri, N. (2020). Multi-objective freshwater management in coastal aquifers under uncertainty in hydraulic parameters. Natural Resources Research, 29(4), 2347-2368. https://doi.org/10.1007/s11053-019-09585-3
[4.] Adamowski, J., & Chan, H. F. (2011). A wavelet neural network conjunction model for groundwater level forecasting. Journal of Hydrology, 407(1-4), 28-40. https://doi.org/10.1016/j.jhydrol.2011.06.013
[5.] Koch, J., Berger, H., Henriksen, H. J., & Sonnenborg, T. O. (2019). Modelling of the shallow water table at high spatial resolution using random forests. Hydrology and Earth System Sciences, 23(11), 4603-4619. https://doi.org/10.5194/hess-23-4603-2019
[6.] Rahman, A. S., Hosono, T., Quilty, J. M., Das, J., & Basak, A. (2020). Multiscale groundwater level forecasting: Coupling new machine learning approaches with wavelet transforms. Advances in Water Resources, 141, 103595. https://doi.org/10.1016/j.advwatres.2020.103595
[7.] Prinos, S. T., Lietz, A. C., & Irvin, R. B. (2002). Design of a real-time ground-water level monitoring network and portrayal of hydrologic data in southern Florida (No. 2001-4275). US Geological Survey.
[8.] Barzegar, R., Fijani, E., Moghaddam, A. A., & Tziritis, E. (2017). Forecasting of groundwater level fluctuations using ensemble hybrid multi-wavelet neural network-based models. Science of the Total Environment, 599, 20-31. https://doi.org/10.1016/j.scitotenv.2017.04.189
[9.] Lee, S., Lee, K. K., & Yoon, H. (2019). Using artificial neural network models for groundwater level forecasting and assessment of the relative impacts of influencing factors. Hydrogeology Journal, 27(2), 567-579. https://doi.org/10.1007/s10040-018-1866
[10.] Roy, D. K., Biswas, S. K., Saha, K. K., & Murad, K. F. I. (2021). Groundwater level forecast via a discrete space-state modelling approach as a surrogate to complex groundwater simulation modelling. Water Resources Management, 35(6), 1653-1672. https://doi.org/10.1007/s11269-021-02787-6
[11.] Zhao, W. G., Wang, H., & Wang, Z. J. (2010). Groundwater level forecasting based on support vector machine. Appl. Mech. Mater, 44, 1365-1369.
[12.] Hsu, K. L., Gupta, H. V., & Sorooshian, S. (1995). Artificial neural network modeling of the rainfall-runoff process. Water resources research, 31(10), 2517-2530. https://doi.org/10.1029/95WR01955
[13.] Nourani, V., Baghanam, A. H., Adamowski, J., & Kisi, O. (2014). Applications of hybrid wavelet-artificial intelligence models in hydrology: a review. Journal of Hydrology, 514, 358-377. https://doi.org/10.1016/j.jhydrol.2014.03.057
[14.] Kumar, D., Roshni, T., Singh, A., Jha, M. K., & Samui, P. (2020). Predicting groundwater depth fluctuations using deep learning, extreme learning machine and Gaussian process: a comparative study. Earth Science Informatics, 13(4), 1237-1250. https://doi.org/10.1007/s12145-020-00508-y
[15.] Panahi, M., Sadhasivam, N., Pourghasemi, H. R., Rezaie, F., & Lee, S. (2020). Spatial prediction of groundwater potential mapping based on convolutional neural network (CNN) and support vector regression (SVR). Journal of Hydrology, 588, 125033. https://doi.org/10.1016/j.jhydrol.2020.125033
[16.] Sesugh, T., Onyia, M., & Fidelis, O. (2024). Predicting the compressive strength of self-compacting concrete using artificial intelligence techniques: A review. Turkish Journal of Engineering, 8(3), 537-550. https://doi.org/10.31127/tuje.1422225
[17.] Erdem, F. (2022). Risk assessment with the fuzzy logic method for Ankara OIZ environmental waste water treatment plant. Turkish Journal of Engineering, 6(4), 268 275. https://doi.org/10.31127/tuje.975623
[18.] Rahman, M. M., Hossain, M. B., & Sayed, A. (2025). Prediction of soil liquefaction using machine learning approaches. Engineering Transactions, 73(2), 1-22. https://doi.org/10.24423/engtrans.3360.2025
[19.] Sayed, A., & Rahman, M. M. (2025). M5 soft computing techniques for assessment of soil liquefaction. Journal of Rehabilitation in Civil Engineering, 13(3), 199-214. https://doi.org/10.22075/jrce.2025.34669.2134
[20.] Rahman, M. M., & Sayed, M. A. (2025). Application of cross validation approaches to examine soft computing systems for forecasting soil liquefaction. Big Data and Earth System, 1(3), 100038. https://doi.org/10.1016/j.bdes.2025.100038
[21.] Mogaraju, J. K. (2023). Application of machine learning algorithms in the investigation of groundwater quality parameters over YSR district, India. Turkish Journal of Engineering, 7(1), 64-72. https://doi.org/10.31127/tuje.1032314
[22.] Demirtop, A., & Sevli, O. (2024). Wind speed prediction using LSTM and ARIMA time series analysis models: A case study of Gelibolu. Turkish Journal of Engineering, 8(3), 524-536. https://doi.org/10.31127/tuje.1431629
[23.] Durap, A. (2025). Machine learning-based wind speed prediction using random forest: a cross validated analysis for renewable energy applications. Turkish Journal of Engineering, 9(3), 508-518. https://doi.org/10.31127/tuje.1624354
[24.] Uzer, A. U. (2024). Efficient prediction of compressive strength in geotechnical engineering using artificial neural networks. Turkish Journal of Engineering, 8(3), 457-468. https://doi.org/10.31127/tuje.1415931
[25.] Othman, M. M. (2023). Modeling of daily groundwater level using deep learning neural networks. Turkish Journal of Engineering, 7(4), 331-337. https://doi.org/10.31127/tuje.1169908
[26.] Ramasamy, V., Alotaibi, Y., Khalaf, O. I., Samui, P., & Jayabalan, J. (2022). Prediction of groundwater table for Chennai Region using soft computing techniques. Arabian Journal of Geosciences, 15(9), 827. https://doi.org/10.1007/s12517-022-09851-4
[27.] Gaffoor, Z., Pietersen, K., Jovanovic, N., Bagula, A., Kanyerere, T., Ajayi, O., & Wanangwa, G. (2022). A comparison of ensemble and deep learning algorithms to model groundwater levels in a data-scarce aquifer of Southern Africa. Hydrology, 9(7), 125. https://doi.org/10.3390/hydrology9070125
[28.] Igwebuike, N., Ajayi, M., Okolie, C., Kanyerere, T., & Halihan, T. (2025). Application of machine learning and deep learning for predicting groundwater levels in the West Coast Aquifer System, South Africa. Earth Science Informatics, 18(1), 6. https://doi.org/10.1007/s12145-024-01623-w
[29.] Wei, A., Chen, Y., Li, D., Zhang, X., Wu, T., & Li, H. (2022). Prediction of groundwater level using the hybrid model combining wavelet transform and machine learning algorithms. Earth Science Informatics, 15(3), 1951-1962. https://doi.org/10.1007/s12145-022-00853-0
[30.] Nourani, V., Ejlali, R. G., & Alami, M. T. (2011). Spatiotemporal groundwater level forecasting in coastal aquifers by hybrid artificial neural network-geostatistics model: a case study. Environmental Engineering Science, 28(3), 217-228. https://doi.org/10.1089/ees.2010.0174
[31.] Sahoo, S., Russo, T. A., Elliott, J., & Foster, I. (2017). Machine learning algorithms for modeling groundwater level changes in agricultural regions of the US. Water Resources Research, 53(5), 3878-3895. https://doi.org/10.1002/2016WR019933
[32.] Kalu, I., Ndehedehe, C. E., Okwuashi, O., Eyoh, A. E., & Ferreira, V. G. (2022). A new modelling framework to assess changes in groundwater level. Journal of Hydrology: Regional Studies, 43, 101185. https://doi.org/10.1016/j.ejrh.2022.101185
[33.] Kayhomayoon, Z., Babaeian, F., Ghordoyee Milan, S., Arya Azar, N., & Berndtsson, R. (2022). A combination of metaheuristic optimization algorithms and machine learning methods improves the prediction of groundwater level. Water, 14(5), 751. https://doi.org/10.3390/w14050751
[34.] Biswas, M. E., Hossain, M. D., Huh, E. N., & Sultana, T. (2025). Spatiotemporal Data-Driven Hourly Bike-Sharing Demand Prediction Using ApexBoost Regression. International Journal of Data Science and Analytics, 1-24. https://doi.org/10.1007/s41060-025-00820-0
[35.] Tian, D., Lang, Z. Q., Zhang, D., & Anumba, D. O. (2023). A filter-predictor polynomial feature based machine learning approach to predicting preterm birth from cervical electrical impedance spectroscopy. Biomedical Signal Processing and Control, 80, 104345. https://doi.org/10.1016/j.bspc.2022.104345
[36.] Liberti, L., & Lavor, C. (2017). Euclidean distance geometry. An Introduction.
[37.] Young, C. Y. (2017). Algebra and trigonometry. John Wiley & Sons.
[38.] Ikotun, A. M., Ezugwu, A. E., Abualigah, L., Abuhaija, B., & Heming, J. (2023). K-means clustering algorithms: A comprehensive review, variants analysis, and advances in the era of big data. Information Sciences, 622, 178-210. https://doi.org/10.1016/j.ins.2022.11.139
[39.] Benesty, J., Chen, J., Huang, Y., & Cohen, I. (2009). Pearson correlation coefficient. In Noise reduction in speech processing (pp. 1-4). Berlin, Heidelberg: Springer Berlin Heidelberg. https://doi.org/10.1007/978-3-642-00296-05
[40.] Biswas, M. E., Sultana, T., Mandal, A. K., Golam Morshed, M., & Hossain, M. D. (2024). Spatio-temporal feature engineering and selection-based flight arrival delay prediction using deep feedforward regression network. Electronics, 13(24), 4910. https://doi.org/10.3390/electronics13244910
[41.] Chen, T., & Guestrin, C. (2016, August). Xgboost: A scalable tree boosting system. In Proceedings of the 22nd acm sigkdd international conference on knowledge discovery and data mining (pp. 785-794). https://doi.org/10.1145/2939672.2939785.
[42.] Natekin, A., & Knoll, A. (2013). Gradient boosting machines, a tutorial. Frontiers in neurorobotics, 7, 21.
[43.] Rigatti, S. J. (2017). Random forest. Journal of insurance medicine, 47(1), 31-39.
[44.] Sutton, C. D. (2005). Classification and regression trees, bagging, and boosting. Handbook of statistics, 24, 303-329.
[45.] Schapire, R. E. (2013). Explaining adaboost. In Empirical inference: festschrift in honor of vladimir N. Vapnik (pp. 37-52). Berlin, Heidelberg: Springer Berlin Heidelberg.
[46.] Marini, F., & Walczak, B. (2015). Particle swarm optimization (PSO). A tutorial. Chemometrics and intelligent laboratory systems, 149, 153-165.
[47.] Coello, C. A. (2000). An updated survey of GA-based multiobjective optimization techniques. ACM Computing Surveys (CSUR), 32(2), 109-143.
[48.] Chopard, B., & Tomassini, M. (2026). Simulated annealing. In An introduction to metaheuristics for optimization (pp. 81-106). Singapore: Springer Nature Singapore. https://doi.org/10.1007/978-981-95-6216-9_5
[49.] Hodson, T. O. (2022). Root mean square error (RMSE) or mean absolute error (MAE): When to use them or not. Geoscientific Model Development Discussions, 2022, 1-10.
[50.] Koksoy, O. (2006). Multiresponse robust design: Mean square error (MSE) criterion. Applied Mathematics and Computation, 175(2), 1716-1729. https://doi.org/10.1016/j.amc.2005.09.016
[51.] Durap, A. (2024). Data-driven models for significant wave height forecasting: Comparative analysis of machine learning techniques. Results in Engineering, 24, 103573. https://doi.org/10.1016/j.rineng.2024.103573
[52.] Durap, A. (2025). Beachface steepness modulates erosion but not recovery: Multi-decadal spatiotemporal shoreline evidence across 390 transects. Journal of Sea Research, 102644. https://doi.org/10.1016/j.seares.2025.102644
Md. Mahabub Rahman (1) (iD), Md. Emran Biswas (*2) (iD)
(1) Hajee Mohammad Danesh Science and Technology University, Department of Civil Engineering, Bangladesh, mmr.civil@hstu.ac.bd
(2) Hajee Mohammad Danesh Science and Technology University, Department of Electronics and Communication Engineering, Bangladesh, emran.hstu1999@gmail.com
Cite this study: Rahman, M.M., & Biswas, M.E. (2026). Machine Learning Algorithm-Based Prediction of Groundwater Table in Bogura District, Bangladesh. Turkish Journal of Engineering, 10(3), 936-947.
Received: 22.10.2025
Revised: 09.02.2026
Accepted: 17.02.2026
Published:30.07.2026
https://doi.org/10.31127/tuje.1808553
Table 1. Summary statistics of the dataset Descriptive Longitude Latitude GWT (m) Statistics (E) degree (N) degree Mean 88.9885267 25.0214 2.689 Standard Error 0.27206502 0.19274 0.079 Median 89.3726 24.8407 3 Mode 89.3571 24.8443 3.05 StandardDeviation 4.9796075 3.52786 1.448 Sample Variance 24.796491 12.4458 2.096 Kurtosis 164.84707 334.456 -0.153 Skewness -12.876251 18.2807 0.242 Range 64.76786 64.8159 6.5
Table 2. Comparison of several models' performances prior to parameter tuning Model Train MSE Train RMSE Train [R.sup.2] Train MAE Random 0.13351 0.36539 0.95254 0.29355 Forest Bagging 0.21002 0.45828 0.92534 0.34257 XGBoost 0.00000 0.00077 1.00000 0.00056 Gradient 0.00082 0.02866 0.99971 0.02417 Boosting AdaBoost 0.08358 0.28910 0.97029 0.26020 Model Test MSE Test RMSE Test [R.sup.2] Test MAE Random 1.07698 1.03777 0.59749 0.99123 Forest Bagging 0.81304 0.90169 0.69613 0.82971 XGBoost 1.88307 1.37225 0.29621 1.33591 Gradient 1.69038 1.30015 0.36823 1.22713 Boosting AdaBoost 1.76525 1.32863 0.34025 1.25478
Table 3. Performance comparison of optimized models after hyperparameter tuning Model Train MSE Train RMSE Train [R.sup.2] Train MAE Random Forest 0.66155 0.81336 0.76482 0.61976 Bagging 0.51082 0.71472 0.81840 0.58740 XGBoost 0.38785 0.62278 0.86212 0.51961 Gradient Boosting 0.55314 0.74374 0.80336 0.58496 AdaBoost 0.08445 0.29061 0.96998 0.25558 Model Test MSE Test RMSE Test [R.sup.2] Test MAE Random Forest 0.49247 0.70176 0.81594 0.58311 Bagging 1.01466 1.00730 0.62078 0.85828 XGBoost 1.21355 1.10161 0.54644 0.89262 Gradient Boosting 0.78480 0.88589 0.70668 0.74164 AdaBoost 1.44583 1.20243 0.45963 1.10572
Table 4. Performance comparison of RF models optimized using GA, SA, and PSO Model Test MSE Test RMSE Test [R.sup.2] Test MAE GA-RF 0.63832 0.79895 0.76143 0.61412 SA-RF 0.44172 0.66462 0.83491 0.50922 PSO-RF 0.42561 0.65239 0.84093 0.49997 (Proposed) Model Train MSE Train RMSE Train [R.sup.2] Train MAE GA-RF 0.70559 0.84000 0.74916 0.68333 SA-RF 0.70277 0.83831 0.75017 0.68156 PSO-RF 0.71546 0.84585 0.74565 0.69477 (Proposed)
ORCID: https://orcid.org/0000-0003-1580-483X
ORCID: https://orcid.org/0009-0007-9331-7531
Printer friendly
Cite/link
Email
Feedback
| |
| Title Annotation: | Research Article |
|---|---|
| Author: | Rahman, Mahabub; Biswas, Emran |
| Publication: | Turkish Journal of Engineering (TUJE) |
| Article Type: | Report |
| Geographic Code: | 9BANG |
| Date: | Jul 1, 2026 |
| Words: | 7043 |
| Previous Article: | Real-Time Bolt Defect Detection with Artificial Intelligence in Industrial Quality Control Applications: Comparative Evaluation of YOLO Architectures. |
| Next Article: | A Structured Framework for Proficiency Calculation of Engineering Graduates. |
| Topics: | |

Printer friendly
Cite/link
Email
Feedback