# Assessing Nitrate Contamination Risks in Groundwater: A Machine Learning Approach
###### Abstract
ML has been used in various fields and domains of science such as agricultural sciences [48], concrete properties prediction [46], bushfire analyses [49], and flood detection and management [13; 50], among others. Nevertheless, the applications of ML techniques are very limited or do not exist for mapping the groundwater contamination risk in developing countries, particularly Pakistan. This study does not claim that ML has not been used for groundwater assessment. In fact, it has been used for modeling groundwater level changes in agricultural regions of the USA [51]. Other examples include mapping the groundwater contamination risk of multiple aquifers [52], and predicting groundwater nitrate concentrations from spatial data [53]. Specific to nitrate assessments, ML has been used to assess nitrates in groundwater in many countries [10; 31]. [PERSON] et al. [54] used three advanced ML techniques, including \(K\)-nearest neighbor algorithm, random forest, and support-vector machines (SVM) to spatially model groundwater nitrate concentrations in Iran. [PERSON] et al. [25] used a spatially distributed, physically-based modeling approach for estimating agricultural nitrate leaching into groundwater in Italy. [PERSON] et al. [15] also used three ML techniques, including multivariate discriminant analysis (MDA), SVM, and boosted regression trees (BRT), for the probability of nitrate groundwater contamination occurrence in Iran. Several ML techniques have also been used in other fields. For example, ML has been used to construct environmental risk scores beyond standard linear models [55]. In addition, it has been used for engineering risk assessment [56; 57], prediction of bioconcentration factors in fish and invertebrates [58], and general monitoring of the environment [49; 59]. However, even studies that have used ML techniques for groundwater risk assessment miss the assimilated framework for groundwater risk and nitrate evaluation. In developing countries like Pakistan, no or few investigations exist that assessed nitrate contamination risk involving ML techniques. Therefore, this study attempts to fill the gap using a holistic framework for groundwater pollution risk assessment in northern Pakistan. With the advent of CPEC, the northern region is expected to see a boom in economic activities, and there will be an increase in anthropogenic movements there. In addition, new industrial and housing zones are being planned for the future. Moreover, the area is a tourist spot for Pakistani nationals and mountain trackers from around the world. Touristic activities are expected to intensify, as the road infrastructure will be enhanced due to the CPEC. All of these anthropogenic activities will directly or indirectly influence the contamination of groundwater. Therefore, mapping the groundwater contamination risk for this area is of great importance. It will lay a road map for the policymakers to devise policies and regulations to protect this precious natural resource. Previously, the DRASTIC method, which is an index method based on expert opinion, had been employed in the same study area by [PERSON] et al. [3]. The biggest disadvantage of this method is subjectivity, as the rating values are assumed based on expert opinion [60]. However, this study focuses on the assessment of three ML models: multivariate discriminant analysis (MDA), boosted regression trees (BRT), and support-vector machines (SVM), to predict the incidence of groundwater contamination in the same area in northern Pakistan. The present study evaluates groundwater contamination using ensemble incidence, and proposes a holistic framework for groundwater risk evaluation. It generates the risk map by combining pollution (nitrate concentration) probability (ML models), and vulnerability (DRASTIC method) maps. Accordingly, the study establishes the most efficient ML approach for groundwater contamination assessment among the practiced techniques. Moreover, it also computes the percentages of the areas that are under different risk zones.