Artificial Intelligence for Optimal Chemical Dosing in Water Treatment Plants: A Comparative Study Using Random Forest and XGBoost Algorithms
DOI:
https://doi.org/10.52716/jprs.v16i3.1153Keywords:
Water treatment, Chemical dosing, Random Forest, XGBoost, Machine learning, Artificial intelligence, Ensemble learning, Jar test replacement.Abstract
This research relies on artificial intelligence (AI) instead of laboratory testing (jar test) to determine the optimal dosage of chemicals (polymer, alum and micro sand) used to treat water at the Qarmat Ali site in Basra Governorate, which is used for reservoir injection in the Rumaila oil field. The research utilized the XGBoost and Random Forest algorithms. The results demonstrated high consistency with experimental results collected over three years. When comparing these two algorithms, the Random Forest algorithm consistently outperformed XGBoost in accuracy across all variable river water specifications. The results support the use of AI to determine the optimal dosage at any given moment and in all seasons, thereby improving export capacity and produced water specifications.
References
A. S. Abd Al-Hussein, “Using sulfuric acid (H2SO4) for pH adjustment in water treatment,” Journal of Petroleum Research and Studies, vol. 11, no. 3, pp. 19-27, Sep. 2021, doi: http://doi.org/10.52716/jprs.v11i3.530.
M. Zainal-Abideen, A. Aris, F. Yusof, Z. Abdul-Majid, A. Selamat, and S. Omar, "Optimizing the coagulation process in a drinking water treatment plant–comparison between traditional and statistical experimental design jar tests," Water science and Technology, vol. 65, no. 3, pp. 496-503, 2012, doi: http://doi.org/10.2166/wst.2012.561.
J. G. Gacu, C. E. F. Monjardin, R. G. T. Mangulabnan, G. C. E. Pugat, and J. G. Solmerin, "Artificial Intelligence (AI) in Surface Water Management: A Comprehensive Review of Methods, Applications, and Challenges," Water, vol. 17, no. 11, Art. no. 1707, 2025, doi https://doi.org/10.3390/w17111707.
B. Senthil Rathi, P. Senthil Kumar, S. Sanjay, M. Prem Kumar, and G. Rangasamy, "Artificial intelligence integration in conventional wastewater treatment techniques: techno-economic evaluation, recent progress and its future direction," International Journal of Environmental Science and Technology, vol. 22, pp. 633-658, 2025, doi: http://doi.org/10.1007/s13762-024-05725-2.
A. Alenezi and Y. Alabaiadly, "Artificial Intelligence Applications in Water Treatment and Desalination: A Comprehensive Review," Water, vol. 17, no. 8, Art. no. 1169, 2025, doi: http://doi.org/10.3390/w17081169.
S. Chen, Y. Liu, I. Gorton, and A. Liu, "Performance prediction of component-based applications," Journal of Systems and Software, vol. 74, no. 1, pp. 35-43, 2005, doi: http://doi.org/10.1016/j.jss.2003.05.005.
S. K. Kiangala and Z. Wang, "An effective adaptive customization framework for small manufacturing plants using extreme gradient boosting-XGBoost and random forest ensemble learning algorithms in an Industry 4.0 environment," Machine Learning with Applications, vol. 4, Art. no. 100024, 2021, doi: http://doi.org/10.1016/j.mlwa.2021.100024.
M. Zamani Joharestani, C. Cao, X. Ni, B. Bashir, and S. Talebiesfandarani, "PM2. 5 prediction based on random forest, XGBoost, and deep learning using multisource remote sensing data," Atmosphere, vol. 10, no. 7, Art. no. 373, 2019, doi: http://doi.org/10.3390/atmos10070373.
K. Yetilmezsoy, B. Ozkaya, and M. Cakmakci, "Artificial intelligence-based prediction models for environmental engineering," Neural Network World, vol. 21, no. 3, 2011, doi: http://doi.org/10.14311/nnw.2011.21.012.
Q. Zhang, Z. Li, S. Snowling, A. Siam, and W. El-Dakhakhni, "Predictive models for wastewater flow forecasting based on time series analysis and artificial neural network," Water Science and Technology, vol. 80, no. 2, pp. 243-253, 2019, doi: http://doi.org/10.2166/wst.2019.263.
S. Pan, Z. Zheng, Z. Guo, and H. Luo, "An optimized XGBoost method for predicting reservoir porosity using petrophysical logs," Journal of Petroleum Science and Engineering, vol. 208, Art. no. 109520, 2022, doi: http://doi.org/10.1016/j.petrol.2021.109520.
D. S. Mahdi, E. A. Al-Khdheeawi, and Y. Yuan, "AI-Based Estimation of Poisson’s Ratio for Carbonate Formations Using Drilling Parameters in a Southern Iraqi Oil Field," Journal of Petroleum Research and Studies, vol. 15, no. 2, pp. 44-59, 2025, doi: http://doi.org/10.52716/jprs.v15i2.1072.
Cuantum Technologies LLC, Feature Engineering for Modern Machine Learning with Scikit-Learn: Mastering Data Preparation and Transformation for Robust ML Models. Birmingham, U.K.: Packt Publishing, 2025.
O. B. Sezer, M. U. Gudelek, and A. M. Ozbayoglu, "Financial time series forecasting with deep learning: A systematic literature review: 2005–2019," Applied soft computing, vol. 90, Art. no. 106181, 2020, doi: http://doi.org/10.1016/j.asoc.2020.106181.
V. Plevris, G. Solorzano, N. P. Bakas, and M. E. A. Ben Seghier, "Investigation of performance metrics in regression analysis and machine learning-based prediction models," in Proc. 8th European Congress on Computational Methods in Applied Sciences and Engineering (ECCOMAS Congress 2022), Oslo, Norway, Jun. 5–9, 2022, doi: http://dx.doi.org/10.23967/eccomas.2022.155.
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 Ali S. Abdulhussein

This work is licensed under a Creative Commons Attribution 4.0 International License.







