Implementing machine learning methods for in-depth analysis and classification of surface water quality in Central Java
摘要
Water quality monitoring plays a critical role in environmental protection and public health, particularly in the context of growing ecological challenges and the need for sustainable resource management. This study proposes and evaluates a predictive classification framework for assessing water pollution levels using machine learning techniques—support vector machine (SVM) and extreme gradient boosting (XGBoost)—within the Pollution Mitigation Classification (PMC) scheme. The models were optimized using the Synthetic Minority Over-sampling Technique (SMOTE-Tomek) resampling technique to address data imbalance. XGBoost demonstrated superior performance with an accuracy of 98.76% and an F1-Macro score of 97.62%, while SVM achieved an accuracy of 90.25% and an F1-Macro score of 83.57%. Interpretability analyses via SHAP and LIME revealed that biological and chemical indicators, such as fecal coliform, BOD, and COD, had the highest feature importance. Validation using dummy features confirmed that both models learned meaningful patterns rather than fitting to noise or spurious correlations. Beyond statistical accuracy, this research integrates a regulatory compliance validation against Indonesia’s Government Regulation No. 22/2021 (Class II water quality standards). Findings indicate that several predictions labeled as “Safe” by the models violated one or more legal thresholds, raising concerns over potential false-safe classifications. To mitigate this risk, the study proposes the implementation of a regulatory-aware layer, comprising rule-based validation modules, probabilistic calibration methods (e.g., Platt Scaling), and early warning systems to enhance real-world applicability. The proposed framework underscores the importance of harmonizing predictive performance with legal compliance, offering a scalable, interpretable, and policy-aligned solution for AI-driven environmental monitoring systems.