Abstract
This paper investigates the performance of five supervised machine learning algorithms, including support vector machine (SVM), logistic regression (LogR), decision tree (DT), multiple perceptron neural network (MLP-NN), and K-nearest neighbours (KNN) for predicting the water quality index (WQI) and water quality class (WQC) in the coastal aquifer of the Gaza Strip. A total of 2,448 samples of groundwater were collected from the coastal aquifer of the Gaza Strip, and various physical and chemical parameters were measured to calculate the WQI based on weight. The prediction accuracy was evaluated using five error measures. The results showed that MLP-NN outperformed other models in terms of accuracy with an R value of 0.9945–0.9948, compared with 0.9897–0.9880 for SVM, 0.9784–0.9800 for LogR, 0.9464–0.9247 for KNN, and 0.9301–0.9064 for DT. SVM classification showed that 78.32% of the study area fell under poor to unsuitable water categories, while the north part of the region had good to excellent water quality. Total dissolved solids (TDS) was the most important parameter in WQI predictions while and were the least important. MLP-NN and SVM were the most accurate models for the WQI prediction and classification in the Gaza coastal aquifer.
HIGHLIGHTS
Machine learning (ML) algorithms are used for predicting water quality index.
Prediction performance of LogR, DT, KNN, SVM, and MLP-NN are compared.
MLP-NN and SVM-based prediction and quality classification models performed better than other ML-developed models.
Gaza coastal aquifer is experiencing a severe deterioration in water quality, as it is currently unsafe for drinking purposes without adequate treatment.
Graphical Abstract
INTRODUCTION
Water is one of the greatest significant sources found on the Earth's surface and is vital for the sustainability of all life; however, it is a source under persistent risk of contamination by life itself. Rapid urbanisation and industrialisation have deteriorated water quality at a worrying rating, giving rise to many serious illnesses. The poor quality of water consequences is known to be one of the main reasons for the increase in traumatic illnesses (Ahmed et al. 2019). The Gaza Strip is going through a serious crisis of depleting accessible fresh water due to the over-pumping of groundwater, the only resource used for domestic purposes, agriculture, and small industries. The problem has been worsened over time by seawater intrusion into the coastal aquifer and infiltration of poorly treated wastewater into the coastal aquifer (Aish et al. 2015). Water is a vital factor for social and economic growth as well as the sustainability of the environment. Most people in the Gaza Strip live in a catastrophic situation that needs imperative and thoughtful measures to recover the water situation in terms of quantity and quality. The groundwater in the coastal aquifer of the Gaza Strip is almost saline, except for some fresh water in the form of shallow water lenses. Therefore, the amount of drinkable groundwater is very much less and is found only in a small number of regions in the Gaza Strip, for example, Beit Lahiya. To secure fresh water for drinking and agricultural purposes in the Gaza Strip has become a vital and strategic objective for the Palestinian Water Authority (PWA) to accomplish (El Sheikh et al. 2003). Domestic and agricultural water quality has almost completely deteriorated. The assessment and survey of groundwater quality are vital for the optimal applied management system of groundwater resources (Kawo & Karuppannan 2018; Li et al. 2018; Egbueri 2020; Islam et al. 2020a). The increasing growth of people is directly related to the rising demand for potable water (Islam et al. 2017; Rahman et al. 2020). This excessive demand has made researchers more to work and do research in order to develop new methods for predicting water quality (Uddin et al. 2021). Since it is an important factor in the water cycle and drinking water resources, groundwater has been shown to be a global problem under significant global stress (Ahmed et al. 2019; Saha et al. 2020). Thus, the assessment of water quality globally has become of great importance in recent years. Horton (1965) intended the first water quality index (WQI) for the purpose of updating some standards that cover water into a single number to determine the water quality general status. Subsequently, several indicators have been established (Mukate et al. 2019; Hossain & Patra 2020; Islam et al. 2020b). The physiochemical and biological variables involved in estimating the WQI must be reasonably selected to obtain logical results (Abbasi, T. & Abbasi, S. A. 2012). Several WQIs have been implemented by numerous investigators to evaluate the appropriateness of drinking water from underground water wells, wetlands and the water quality of rivers (Islam et al. 2017, 2019, 2021). Though, the worsening of water quality could be generated by many aspects, such as insufficient good sanitation system, contaminants resulting from industries and extreme use of fertiliser for agricultural purposes, climate change, and non-existent management strategy for groundwater (Trevett et al. 2005; Alam et al. 2007; Loecke et al. 2017; Islam et al. 2018). Moreover, water quality assessment includes issues such as large-scale sample collection, laboratory testing, and data manipulation, which are often time-consuming and costly in relation to equipment, chemicals, reagent, and the economic value of the human resources (Tiyasha Tung & Yaseen 2020). Water quality can be impacted by a variety of factors, including the calcium content in natural waters, industrial waste, rocks, and contaminated wastewater, which serve as sources of calcium, leading to poor water quality. Additionally, hard water has been linked to serious and long-term health problems such as heart disease, skin irritation, hair damage, dental issues, respiratory difficulties, and gastrointestinal problems (Sharma & Bhattachary 2017). Impurities in water sources due to chemical, physical, and radioactive pollutants are the most common reason for water pollution (Chatterjee et al. 2017). In fact, the consequences of polluted drinking water are extremely harmful and pose a serious condition to human health, environment, and infrastructure. Rendering to a United Nations (UN) report, 1.5 million people die every year as a result of diseases that result in polluted water. Water pollution is documented to cause 80% of health issues in poor countries. Every year 5 million deaths and 2.5 billion illnesses are documented (Aldhyani et al. 2020). In order to come up with solutions to deal with and overcome these conditions, it was necessary to use realistic, cost-effective, accurate, and quick methods to assess the quality of water. In order to come up with the optimal solution, in this case, an artificial neural network (ANN) model is an alternate choice for creating neural networks that help forecast the underground water quality founded on the results of laboratory analyses that do not require costly and highly advanced measurement tools. Artificial intelligence (AI) technology is a potential and powerful multifunctional method in fields related to the sciences of water (Kisi et al. 2018; Kim et al. 2019; Abba et al. 2020; Bilali et al. 2021; Hayder et al. 2021; Singha et al. 2021). A number of researchers have used AI methods around the world, such as ANN, support vector machine (SVM), and random forest (RF), in several different water-related studies. The learning machine RF algorithm has been developed for its application to predict the quality of groundwater (Singha et al. 2021), and worked on predicting the quality of river waters (Asadollah et al. 2021). ANN technology has been widely used in various fields, including science and engineering. For example, this technology has been used to predict heavy metals pollution (Singha et al. 2020) and the water table prediction (Zhu et al. 2020). Apart from these previously mentioned investigations, many researchers have conducted many studies to predict WQI by assessing the performance of the varied number of AI models. Wang et al. (2017) have used a support vector regression (SVR) model based on swarm optimisation to forecasting WQI. Muharemi et al. (2018) have used neural network and K-nerest neighbours (KNN) algorithm for classification purposes created by the logistic regression algorithm (LogR) to attain a suitable method to solve and report the problem of changes in drinking water quality. Mohammed Pour et al. (2015) have studied the water quality problem, using three different algorithms, including SVM and other two methods of ANNs. Then the performance of the developed networks using root-mean-square error (RMSE), mean absolute error (MAE), and coefficient of determination (R2) was used for comparison purposes. Based on the study's results, the SVM algorithm can compete with neural networks. Najafzadeh and other researchers have conducted multiple studies on the use of machine learning (ML) algorithms for predicting water quality in the Karun River and Rafsanjan Plain, Iran. In their research, they have proposed modifications to SVR, used multivariate adaptive regression spline (MARS), and least square-support vector machine (LS-SVM), and employed gene expression programming (GEP), evolutionary polynomial regression (EPR), model tree (MT), and four well-known DDMs for water quality prediction. In a separate study, they also applied four robust data-driven techniques (DDTs) for predicting groundwater quality index (GQI) values (Najafzadeh & Ghaemi 2019; Najafzadeh et al. 2019, 2021, 2022; Najafzadeh & Niazmardi 2021). A study carried out by Ahmed et al. (2019) applied 15 algorithms owned to AI to predict the WQI, where the classification and regression developed networks outperformed other models. It has been found (Bui et al. 2020a) that the prediction performance of hybrid AI models is better than the classical models of WQI prediction using 4 classical methods and 12 AI hybrid methods. A deep learning machine (Singha et al. 2021) has been used to predict WQI using three conventional models. The prediction results showed that the predictive model of deep learning is a more powerful and precise method than the classical model in predicting groundwater quality. In the study by Kouadri et al. (2021a, 2021b), the authors used various physicochemical and biological variables such as temperature, pH, conductivity, dissolved oxygen, and faecal coliforms to classify water quality using ML algorithms such as LogR, multilayer perceptron (MLP), decision tree (DT), naive Bayes (NB), and KNN. They found that the DT algorithm performed best among the models with a classification accuracy of 99%.
According to the literature reviewed, a variety of AI models have been utilized in different hydrogeological conditions with varying degrees of accuracy for predicting WQI. LogR, DT, long short-term memory (LSTM), SVR, multiple perceptron neural network (MLP-NN), and KNN were among the models used in these studies. However, these AI techniques are not commonly used in hydrology for predicting groundwater quality. A thorough review of the literature revealed that no prior study has examined or validated the performance of these AI methods for predicting the WQI of the coastal aquifer in the Gaza Strip. This study aims to address this gap by investigating the application of five WQI prediction models based on ML in the Gaza Strip coastal aquifer, including LogR, DT, MLP-NN, KNN, and SVM algorithms. This study focuses on the importance of regular assessment of groundwater quality in the Gaza coastal aquifer, as groundwater is a crucial resource for human consumption and is largely impacted by human-caused pollution. To the authors' knowledge, no prior research has been conducted in this area. The novelty of this study is the use of ML techniques to forecast the WQI, which proves to be more efficient than conventional methods. The study investigates several models using five algorithms to predict WQI using various physicochemical variables as inputs. This approach is intended to reduce the time consumed in evaluating the water quality and to allow for quicker predictions in critical situations in the Gaza Strip coastal aquifer. We aspirate that the utilisation of ML algorithms in this study to predict the WQI can provide a more efficient, accurate, and effective means of monitoring and managing the water quality of the Gaza coastal aquifer. Through this, the PWA can acquire a clearer comprehension of the factors affecting the water quality and take proactive measures to maintain or improve its quality.
MATERIALS AND METHODS
Study area description
The Pleistocene granular aquifer in the Gaza Strip is an extension of the coastal aquifer on the Mediterranean coast. It extends from Ashqelon in the north to Rafah in the south and from the sea coast to 10 km inland. The aquifer consists of various layers of dune sandstone, silty clay, and clay that occur as lenses, begin on the coastline, and extend to a distance of about 5 km from the sea. The aquifer is divided into an upper and a deep subaquifer. The aquifer is built on the sea soil clay (Saqiye Group) of the Neocene age, which has a hydraulic conductivity of about 108 m/s. The coastal aquifer, located in the east-south part of the Gaza Strip, is relatively thin and has no apparent subaquifers (Aish 2013). The water demand in the Gaza Strip is influenced by population growth and economic development and is primarily met by pumping from over 8,000 wells. In 2020, around 97 million cubic metres were used for irrigation and 93.5 million cubic metres for domestic and industrial purposes. However, the unsustainable pumping practices have led to the depletion of groundwater reserves and 97% of the water pumped from the coastal aquifer does not meet the water quality standards set by the World Health Organization (WHO). The water table is 19 m below sea level and the sustainable water pumping limit is estimated to be 50–60 million cubic metres annually (PCBS & PWA 2022). The Gaza Strip relies heavily on groundwater from the coastal aquifer as its main source of water. Intensive pumping from over 4,000 wells has led to seawater intrusion, which in turn has affected the quality of the groundwater. The groundwater quality is not consistent throughout the region and is affected by factors such as excessive withdrawal and human activities, leading to high levels of nitrates and chlorides and making much of it unsuitable for drinking (El Baba et al. 2020).
Data collection
After applying these techniques, we focused on modelling and obtaining results from the proposed model, which was also based on the prepared dataset of the test part. Finally, all the obtained results were compared based on the accuracy of the developed models and possibly some existing methods. This methodology ensures the rationality and reliability of the whole study. The dataset for this study was collected from PWA. The dataset contains 10 water quality parameters consisting of physical elements (TDS) and chemical elements (pH, Ca2+, Mg2+, Na+, K+), anions (Cl−, , ), and pollution indicators (). These parameters were considered significant values. Table 1 shows the given weights and relative weights of the water quality parameters, and Table 3 shows the statistical analysis of the parameters used in this study.
Variable . | Unit . | WHOs . | Weight (wi) . | Relative weight (Wi) . |
---|---|---|---|---|
pH | 6.5–8.5 | 3 | 0.103 | |
TDS | mg/L | 500 | 5 | 0.172 |
Calcium | mg/L | 75 | 2 | 0.069 |
Magnesium | mg/L | 50 | 2 | 0.069 |
Sodium | mg/L | 200 | 3 | 0.103 |
Potassium | mg/L | 12 | 1 | 0.034 |
Chloride | mg/L | 250 | 4 | 0.138 |
Nitrate | mg/L | 45 | 5 | 0.172 |
Sulphate | mg/L | 250 | 3 | 0.103 |
Alkalinity | mg/L | 120 | 1 | 0.034 |
∑wi = 29 | ∑Wi = 1.000 |
Variable . | Unit . | WHOs . | Weight (wi) . | Relative weight (Wi) . |
---|---|---|---|---|
pH | 6.5–8.5 | 3 | 0.103 | |
TDS | mg/L | 500 | 5 | 0.172 |
Calcium | mg/L | 75 | 2 | 0.069 |
Magnesium | mg/L | 50 | 2 | 0.069 |
Sodium | mg/L | 200 | 3 | 0.103 |
Potassium | mg/L | 12 | 1 | 0.034 |
Chloride | mg/L | 250 | 4 | 0.138 |
Nitrate | mg/L | 45 | 5 | 0.172 |
Sulphate | mg/L | 250 | 3 | 0.103 |
Alkalinity | mg/L | 120 | 1 | 0.034 |
∑wi = 29 | ∑Wi = 1.000 |
Box plot analysis and outlier detection
In this study, box plots were used for outlier discovery analysis due to their ability to show the distribution, dispersion, and variation of univariate and categorical data. The box plot analysis showed that most variables had outliers that were considered normal, so an upper bound strategy was used to filter them out. The maximum threshold was set as the variable value just below the outlier values, and this process was repeated for all variables. The outliers were removed manually to avoid losing data, and the researchers were lenient in choosing the upper threshold to preserve the dataset and only penalize values that seemed unlikely to occur (Gazzaz et al. 2012; Ahmed et al. 2019).
WQI calculation
WQI rate . | Water class . |
---|---|
0–50 | Excellent |
50–100 | Good |
100–200 | Poor |
200–300 | Very poor |
Above 300 | Unsuitable for drinking |
WQI rate . | Water class . |
---|---|
0–50 | Excellent |
50–100 | Good |
100–200 | Poor |
200–300 | Very poor |
Above 300 | Unsuitable for drinking |
In this study, five types of water quality were classified which are excellent, good, poor, very poor, and unsuitable for human use (Sahu & Sikdar 2008). When the WQI rate is 0–50, then it is excellent; when it is 50–100, then it is good; when it is 100–200, then it is poor; when it is 200–300, then it is very poor, and when it is above 300, then it is unsuitable for drinking. Once the WQI is calculated, each sample's water quality class (WQC) is determined using the WQI in the classification algorithms (Srivastava & Kumar 2013; Ahmed et al. 2019). The classification of groundwater quality is shown in Table 2.
Application of ML-based prediction models
Regression and classification algorithms were used in this study. Regression algorithms were used to estimate the WQI, and classification algorithms were used to classify the samples into the previously determined WQC. Five classification and regression algorithms were used. The algorithms used are listed below:
Logistic regression (LogR)
LogR is a classification algorithm. It is created by applying the logistic function or the sigmoid function. It is the most commonly used algorithm in binary classification, but in this study, multinomial LogR is used because there are more than two classes (Ahmed et al. 2019). During this work, the tuning of hyperparameters was performed using GridSearchCV method to obtain the best parameters, which were then fed into the LogR model that provided optimal prediction results.
Decision tree (DT)
A DT is a simple, understandable algorithm that can be generally used for both regression and recognition. The DT makes decisions based on the values of all relevant input variables after training. It randomly selects the root variable and tends to the values of the other variables accordingly. It contains all parameter decisions organised in a top-down tree and evolves the decision based on different parameter values (Quinlan 1990). The prediction used hyperparameter optimisation using grid search and implementing the standard scaling function on a dataset, as well as cross-validation to avoid overfitting.
K-nearest neighbours (KNN)
The KNN algorithm generally classifies by finding the given points closest to the N neighbours and assigning the class to the majority of the n neighbours. In the case of a tie, various techniques can be applied to solve the problem, such as increasing n or adding a bias towards a category. KNN is not suggested for large datasets because all processing occurs during testing, iterating all training data and computing nearest neighbours every time (Beyer et al. 1999). In this study, KNN was tuned by tune hyperparameter using GridSearchCV for k to achieve the best prediction performance. The best value for n was found to be 9, while k_range = range (1.31).
Support vector machine (SVM)
SVM is generally used for classification but can also be used for regression. When visualising data points plotted on a plane, SVMs outline the hyperplane between classes and expand the margin to maximise the discrimination between two classes, resulting in fewer nearby errors (Ahmed et al. 2019). In this prediction model, the default hyperparameter used was the C value of 1, the gamma value of scale, and the kernel value of ‘rbf’, which gave the best performance results.
Neural network/Multilayer perceptron (MLP)
ANN is a model based on the structure of nodes that consists of multiple layers of neurons. It has an input layer that takes in prediction variables and an output layer that displays the prediction. During training, the model updates the weights of each neuron in each layer by iterating with each training data point. Once trained, the model uses these weights to activate specific units based on the inputs. MLP is a commonly used ANN model for classification and regression tasks (Ahmed et al. 2019). In this study, an MLP-NN with a configuration (10,30,1) of max 100 eps and a learning rate (‘constant’, ‘adaptive’) using Python version 3.9.7 was used for classification and prediction of WQI and WQC.
Model development
Model calibration
Model calibration involves adjusting the training algorithm by reducing the cost function. Weights are calculated by the model learning from the used training dataset. At this point, a communal deficiency can happen, namely, overfitting, which leads to noise and adverse effects during training. Hyperparameters cannot gain information directly from the dataset used in training, but they increase the complexity to achieve the optimal structure of the model. Therefore, model hyperparameters were set for all models during model calibration.
Model performance metrics
As present in the equation, n is the number of observations in the period under consideration, Oi is the observed first-order value, O is the observed mean value, Pi is the expected value from the first model, and P is the expected mean value from the model (Golmohammadi et al. 2014).
RESULTS AND DISCUSSION
Groundwater quality statistical analysis
Parameters . | Min . | 1st Quartile . | Mean . | 3rd Quartile . | SD . | Max . | Skewness . | WHO Standards . | Number of samples exceeding standards . |
---|---|---|---|---|---|---|---|---|---|
(mg/L) | 45.23 | 211 | 275.03 | 323 | 100.35 | 1,568.4 | 1.53 | 120 | 2,382 |
(mg/L) | 1.42 | 43 | 164.77 | 241 | 160.59 | 1,873 | 1.94 | 250 | 565 |
Cl− (mg/L) | 25.52 | 170 | 536.75 | 784.1 | 445.69 | 2,759 | 1.40 | 75 | 1,570 |
Na+ (mg/L) | 2.7 | 110 | 346.49 | 520 | 273.18 | 1,470 | 0.92 | 200 | 1,432 |
Mg2+ (mg/L) | 1.62 | 38 | 63.99 | 79 | 39.83 | 379 | 1.87 | 50 | 1,312 |
K+ (mg/L) | 1.06 | 2.8 | 5.99 | 6.2 | 11.13 | 430 | 24.52 | 12 | 195 |
Ca2+ (mg/L) | 7.05 | 55 | 93.71 | 114 | 75.77 | 2,376 | 12.89 | 75 | 1,344 |
(mg/L) | 10.2 | 58.44 | 118.89 | 155 | 81.38 | 528 | 1.53 | 45 | 2,085 |
TDS (mg/L) | 154 | 727.3 | 1,540.82 | 2,141 | 989.6473 | 9,219 | 1.25 | 500 | 2,249 |
pH | 6.1 | 7.3 | 7.58 | 7.84 | 0.394 | 8.96 | 0.146 | 6.5–8.5 | 35 |
WQI | 33.53 | 105.20 | 184.21 | 249.05 | 94.37 | 499.57 | 0.719 | – | – |
Parameters . | Min . | 1st Quartile . | Mean . | 3rd Quartile . | SD . | Max . | Skewness . | WHO Standards . | Number of samples exceeding standards . |
---|---|---|---|---|---|---|---|---|---|
(mg/L) | 45.23 | 211 | 275.03 | 323 | 100.35 | 1,568.4 | 1.53 | 120 | 2,382 |
(mg/L) | 1.42 | 43 | 164.77 | 241 | 160.59 | 1,873 | 1.94 | 250 | 565 |
Cl− (mg/L) | 25.52 | 170 | 536.75 | 784.1 | 445.69 | 2,759 | 1.40 | 75 | 1,570 |
Na+ (mg/L) | 2.7 | 110 | 346.49 | 520 | 273.18 | 1,470 | 0.92 | 200 | 1,432 |
Mg2+ (mg/L) | 1.62 | 38 | 63.99 | 79 | 39.83 | 379 | 1.87 | 50 | 1,312 |
K+ (mg/L) | 1.06 | 2.8 | 5.99 | 6.2 | 11.13 | 430 | 24.52 | 12 | 195 |
Ca2+ (mg/L) | 7.05 | 55 | 93.71 | 114 | 75.77 | 2,376 | 12.89 | 75 | 1,344 |
(mg/L) | 10.2 | 58.44 | 118.89 | 155 | 81.38 | 528 | 1.53 | 45 | 2,085 |
TDS (mg/L) | 154 | 727.3 | 1,540.82 | 2,141 | 989.6473 | 9,219 | 1.25 | 500 | 2,249 |
pH | 6.1 | 7.3 | 7.58 | 7.84 | 0.394 | 8.96 | 0.146 | 6.5–8.5 | 35 |
WQI | 33.53 | 105.20 | 184.21 | 249.05 | 94.37 | 499.57 | 0.719 | – | – |
Spatial distribution of WQI
Performance of developed ML models
ML algorithms are used in a number of studies across areas with a high accuracy rate. This study proposed that ML methods can predict the WQI in the Gaza Strip coastal aquifer with both accuracy and precision. This study compared five ML algorithms under classification and regression modes. Three of the five algorithms accurately predicted the groundwater class and quality parameters. The data were split into training and testing data, and their respective performances were good. Groundwater monitoring is always expensive, and ML algorithms can make classification and regression accurate for the unknown or yet to be explored for WQI. This study can be extended to wastewater quality parameters and propagation of pollutants. The coastal aquifer of Gaza selected for this study is not conducive to systematic groundwater investigations due to topographic inconvenience and the unstable political situation. It calls for a need to use ML algorithms. In this study, two types of supervised ML algorithms are employed, i.e., classification and regression. In this study, we have worked on evaluating the results obtained from the two types of algorithms differently. Several evaluation metrics are used for regression, such as RMSE, MAE, R, DR, SI, and RSR and the following measures are used for classification: accuracy, precision, recall, and FI score.
Results for classification algorithms
Classification algorithms were used to predict the WQC assigned to the samples based on their previously calculated WQI. The 10 parameters listed in Table 3 were used for classification. At the beginning, the same 10 parameters were considered. The prediction results showed that SVM performed better than the other algorithms in training the dataset in such an environment, with an accuracy of 0.95, a precision of 0.95, a recall of 0.96, and an F1 score of 0.95, as given in Table 4. In this part, we went through the results of our study and found that SVM performs better in predicting WQC, while MLP-NN performs better than the other three learning machines (Table 4). These results are significantly better than the results of a previous research study conducted by Nair & Vijaya (2022), which had an accuracy of 0.61, a precision of 0.43, a recall of 0.51, and an F1 score of 0.42.
Algorithm . | Accuracy . | Precision . | Recall . | F1 score . |
---|---|---|---|---|
Logistic regression | 0.91 | 0.90 | 0.86 | 0.89 |
Decision tree | 0.90 | 0.85 | 0.89 | 0.87 |
K-nearest neighbours | 0.87 | 0.89 | 0.78 | 0.81 |
SVM | 0.95 | 0.95 | 0.96 | 0.95 |
MLP-NN | 0.92 | 0.93 | 0.93 | 0.93 |
Algorithm . | Accuracy . | Precision . | Recall . | F1 score . |
---|---|---|---|---|
Logistic regression | 0.91 | 0.90 | 0.86 | 0.89 |
Decision tree | 0.90 | 0.85 | 0.89 | 0.87 |
K-nearest neighbours | 0.87 | 0.89 | 0.78 | 0.81 |
SVM | 0.95 | 0.95 | 0.96 | 0.95 |
MLP-NN | 0.92 | 0.93 | 0.93 | 0.93 |
Results for regression algorithms
Table 5 presents the results obtained in terms of MSE, RMSE, MAE, R Squared, and RSR values with the training and testing dataset for groundwater quality prediction using the calculated WQI. Comparison of these values indicates a slight improvement in WQI performance with the adjusted MLP-NN [RMSE = (0.1158–0.1106), MAE = (0.0099–0.0095), R = (0.9945–0.9948), DR = (0.0012–0.0011), SI = (0.0629–0.0601) ,and RSR = (0.1043–0.1007)] as compared with the SVM [RMSE = (0.1583–0.1690), MAE = (0.0169–0.0204), R = (0.9897–0.9880), DR = (0.0017–0.0018), SI = (0.0859–0.0919), and RSR = (0.1426–0.1539)], LogR [RMSE =(0.2291–0.2182), MAE = (0.0373–0.0340), R = (0.9784–0.9800), DR = (0.0024–0.0023), SI = (0.1243–0.1187), and RSR = (0.2063–0.1987)], KNN [RSME = (0.3582–0.4173), MAE = (0.0886–0.0204), R = (0.9464–0.9247), DR = (0.0037–0.0044), SI = (0.1944–0.2271), and RSR = (0.3226–0.3801)], and DT [RMSE = (0.4079–0.4607), MAE = (0.1022–0.1387), R = (0.9301–0.9064), DR = (0.0043–0.0048), SI = (0.2214–0.2507), and RSR = (0.3621–0.4196)]. From the obtained results, it is clear that the MLP-NN algorithm is the most efficient regression model, although SVM and LogR were found to perform well in the prediction of the WQI, while the performance of KNN and DT algorithms was slightly poorer in comparison with the mentioned above algorithms (Table 5). Supervised learning-based algorithms prediction models (LogR, DT, KNN, SVM, and MLP) are trained and validated, and then their performances are compared to find the best prediction model for the present study. Table 4 shows that the developed MLP-NN model attained the highest precision in terms of MSE (0.0134), MAE (0.0099), RMSE (0.1158), RSR (0.1043), DR (0.0012), SI (0.0629), and R (0.9948) throughout model training compared with the other models where it is understood that MLP algorithm performs good with the current datasets. Moreover, as compared with the other five ML models, the MLP-NN-based prediction model attains the highest accuracy during model testing in terms of RMSE (0.1106), MAE (0.0095), RSR (0.1007), DR (0.0011), SI (0.0601), and R (0.9948) (Table 5).
Algorithm . | RMSE . | MAE . | DR . | SI . | R . | RSR . |
---|---|---|---|---|---|---|
Logistic regression | ||||||
Training data | 0.2291 | 0.0373 | 0.0024 | 0.1243 | 0.9784 | 0.2063 |
Testing data | 0.2182 | 0.0340 | 0.0023 | 0.1187 | 0.9800 | 0.1987 |
Decision tree | ||||||
Training data | 0.4079 | 0.1022 | 0.0043 | 0.2214 | 0.9301 | 0.3621 |
Testing data | 0.4607 | 0.1387 | 0.0048 | 0.2507 | 0.9064 | 0.4196 |
K-nearest neighbours | ||||||
Training data | 0.3582 | 0.0886 | 0.0037 | 0.1944 | 0.9464 | 0.3226 |
Testing data | 0.4173 | 0.1251 | 0.0044 | 0.2271 | 0.9247 | 0.3801 |
SVM | ||||||
Training data | 0.1583 | 0.0169 | 0.0017 | 0.0859 | 0.9897 | 0.1426 |
Testing data | 0.1690 | 0.0204 | 0.0018 | 0.0919 | 0.9880 | 0.1539 |
MLP-NN | ||||||
Training data | 0.1158 | 0.0099 | 0.0012 | 0.0629 | 0.9945 | 0.1043 |
Testing data | 0.1106 | 0.0095 | 0.0011 | 0.0601 | 0.9948 | 0.1007 |
Algorithm . | RMSE . | MAE . | DR . | SI . | R . | RSR . |
---|---|---|---|---|---|---|
Logistic regression | ||||||
Training data | 0.2291 | 0.0373 | 0.0024 | 0.1243 | 0.9784 | 0.2063 |
Testing data | 0.2182 | 0.0340 | 0.0023 | 0.1187 | 0.9800 | 0.1987 |
Decision tree | ||||||
Training data | 0.4079 | 0.1022 | 0.0043 | 0.2214 | 0.9301 | 0.3621 |
Testing data | 0.4607 | 0.1387 | 0.0048 | 0.2507 | 0.9064 | 0.4196 |
K-nearest neighbours | ||||||
Training data | 0.3582 | 0.0886 | 0.0037 | 0.1944 | 0.9464 | 0.3226 |
Testing data | 0.4173 | 0.1251 | 0.0044 | 0.2271 | 0.9247 | 0.3801 |
SVM | ||||||
Training data | 0.1583 | 0.0169 | 0.0017 | 0.0859 | 0.9897 | 0.1426 |
Testing data | 0.1690 | 0.0204 | 0.0018 | 0.0919 | 0.9880 | 0.1539 |
MLP-NN | ||||||
Training data | 0.1158 | 0.0099 | 0.0012 | 0.0629 | 0.9945 | 0.1043 |
Testing data | 0.1106 | 0.0095 | 0.0011 | 0.0601 | 0.9948 | 0.1007 |
Besides, an innovative model named LSTM was developed to predict some of the water quality parameters such as pH and temperature, with a notable value of R2 98.56 and 98.97% in the short-term, while R2 is 95.76 and 96.88% in the long-term prediction (Hu et al. 2018). Moreover, in a recent study, a significant reduction in RMSEs, i.e., 84.98, 76.81, and 82.83%, was noticed in the case of the DL model compared with RF, XGBoost, and ANN model, respectively (Singha et al. 2021). The results obtained in this study were found to be similar to the results of previous studies for predicting the WQI. However, the results in this study were significantly better than those of a study conducted by Nair & Vijaya (2022), which used an MLP model and had an RMSE of 2.432 and an MAE of 1.9143. This suggests that the method used in this study was more effective in predicting the WQI compared with the previous study.
Variable importance by ML models
CONCLUSIONS
The WQI is traditionally calculated using water quality parameters determined by time-consuming laboratory analyses. This work investigated alternative ML methods for predicting the WQI of the Gaza coastal aquifer, and some studies were found to apply them. In this study, three ML models performed well in classifying and predicting the WQI class, which may be due to a large amount of data and normalisation of the data between zero and one. The results showed that MLP-NN performed better in WQI prediction and SVM performed better in WQC classification of water, while LogR performed better than the other two learning machines. The prediction performances of all models were compared using performance metrics, and the result clearly indicates that the prediction model MLP-NN exceeded the other models by attaining the highest model training and testing accuracy in terms of MLP-NN RMSE = (0.1158–0.1106), MAE = (0.0099–0.0095), R = (0.9945–0.9948), DR = (0.0012–0.0011), SI = (0.0629–0.0601), and RSR = (0.1043–0.1007). Though, the model MLP-NN was found to have relatively higher predictive performance than the SVM, LogR, KNN, and DT models. The order of performance of the developed models is MLP-NN > SVM > LogR > KNN and > DT according to their R values in the test phase, i.e., 0.9948, 0.9880, 0.9800, 0.9247, and 0.9064, respectively. The result also confirms that the MLP-NN and SVM models are able to effectively identify the significance of input variables in the WQI calculation. Therefore, the developed ML models MLP-NN and SVM models can be efficiently used to evaluate the groundwater quality in the current study area. In addition, these models can also be used in various water research studies, such as predicting water quality parameters. The only limitation of this study is that the sample dataset was collected once a year, i.e., the samples were collected in one of the seasons considered in the predictive models. Data from multiple seasons may lead to a deeper understanding of groundwater quality in this study. This consideration is likely to promote the high adoption of ML models in the field of water resource studies. The present study can be further improved by investigating the predictive capability of the developed models in comparison with other ML models considering various possible hydrometeorological inputs.
ACKNOWLEDGEMENTS
The authors appreciate the Palestinian Water Authority for providing the required water quality dataset and information to complete this research.
FUNDING
This research has not received any kind of funding.
DATA AVAILABILITY STATEMENT
Data cannot be made publicly available; readers should contact the corresponding author for details.
CONFLICT OF INTEREST
The authors declare there is no conflict.