STL-Driven Feature Engineering for Enhanced Machine Learning in River Water Quality Prediction
Water quality prediction has emerged as a primary focus of aquatic ecosystem management. This study used water quality monitoring data (November 2021–July 2024) from 10 river section monitoring stations in the Pearl River Basin, South China. Seasonal-trend decomposition using Loess (STL) was adopted as a feature engineering tool to extract seasonal factors. Taking water temperature, turbidity, pH, conductivity, and dissolved oxygen as input features, machine learning algorithms including random forest (RF), extreme gradient boosting (XGBoost), light gradient boosting machine (LightGBM), and support vector machine (SVM) were compared for the prediction of ammonia nitrogen (NH4+-N), total phosphorus (TP), and the permanganate index (CODMn). The results demonstrated that STL effectively enhanced the predictive performance of the models. The XGBoost-STL model performed best, with the coefficient of determination (R2) on the validation set being 0.7921, 0.8677, and 0.8897 and test set R2 values being 0.8243, 0.9116, and 0.8860 for NH4+-N, TP, and CODMn, respectively. Compared with the pristine models, XGBoost-STL improved the prediction accuracy by 47.72%, 22.56%, and 25.27%, respectively. Shapley additive explanations (SHAP) analysis indicated that the seasonal factor played a crucial role in the prediction process. The method proposed in this study strengthened machine learning prediction models through artificial feature engineering, exhibiting a promising practicality.
Institutions
- Central Pollution Control Board (IN)
- University of Cape Town (ZA)
- Ecological Consulting (Czechia) (CZ)
- Centre de Géosciences (FR)
- South China University of Technology (CN)
- Delft University of Technology (NL)
Publication Details
- Journal
- ACS ES&T Water
- Published
- 2026-05-19
- DOI
- https://doi.org/10.1021/acsestwater.6c00008
- Primary Topic
- Hydrological Forecasting Using AI
- Type
- article
- Field-Weighted Citation Impact
- 0.00
Funders
- National Natural Science Foundation of China
- Guangdong Science and Technology Department
- Guangdong Provincial Pearl River Talents Program