Explainable AI for Smart Characterization of Dairy-Lagoon Wastewater Using Farm-Held-Out Validation
Abdullah Al Rawi, Prachi Pandey, Behrooz Pakzadeh, Pramod Pandey
Key points
From the paper's conclusion- These findings apply to flush-based dairies in California’s Central Valley, and this approach can support low-cost screening of dairy-lagoon manure for organic matter while directing chemically governed properties to laboratory measurement.
Abstract
Commercial dairy farms are essential to milk production, food security, and rural economies, but they also generate large volumes of manure and wastewater requiring reliable characterization. Measuring solids, organic matter, and dissolved constituents is important for pollution control, nutrient management, and resource recovery. Artificial intelligence may reduce analytical burden, although its usefulness depends on demonstrating that predictions generalize across farms and that model explanations are scientifically credible. This study evaluated 205 lagoon-manure samples collected between May and August 2021, within a four-year project, from 18 commercial dairies in California’s Central Valley. Sample availability varied among measurements and modeling tasks because of missing observations. Gravimetric and chemical measurements were analyzed using polynomial ridge regression, random forest, and XGBoost with farm-held-out cross-validation; validated models were interpreted using SHAP and LIME. All 205 samples had complete gravimetric records, and chemical measurements were available for 155 samples. Samples averaged 96.02% moisture, 3.98% total solids, and 3.06% organic matter. Organic matter was predicted from the combined gravimetric measurements (R2 = 0.975, RMSE = 0.97 percentage points, MAE = 0.39, and RPD = 6.32). Total solids alone produced similar pooled performance (R2 = 0.979; RPD = 6.86), and a linear regression on total solids performed comparably (R2 = 0.980). However, prediction errors were strongly concentration dependent. For the linear benchmark, mean absolute errors represented approximately 56%, 21%, and 11% of mean organic-matter concentrations in samples containing <1%, 1–10%, and >10% total solids, respectively. These findings indicate that strong pooled performance does not establish reliable screening accuracy for highly dilute samples. In contrast, nitrate, sodium, salinity, calcium, and pH could not be predicted reliably (R2 = −0.431 to 0.091; RPD = 0.84–1.05). SHAP identified moisture–solids as the dominant contributor to organic-matter predictions, whereas LIME supported sample-level interpretation. These findings apply to flush-based dairies in California’s Central Valley, and this approach can support low-cost screening of dairy-lagoon manure for organic matter while directing chemically governed properties to laboratory measurement.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Artificial intelligence for predicting volatile fatty acids rejection in nanofiltration membranesJournal of Water Process Engineering · 2026
- AI-Driven Membrane-Integrated Wastewater Biorefineries for Resource Recovery and Hydrogen Production: A Critical Review.Membranes · 2026
- Multi-target machine learning prediction of constructed wetland effluent quality with model interpretation and experimental validation.Journal of environmental management · 2026
- Groundwater Nitrate Modelling Using Optimized Machine Learning, Feature Selection and Explainable Artificial Intelligence (XAI)Nitrogen · 2026
- Data-driven machine learning approach for water quality anomaly detection and NPS-FM non-compliance risk prediction: A study with five New Zealand rivers.Water research · 2026
- Statistical Outlier Removal in High-Frequency River Water-Quality Data: Effects on Total Phosphorus Virtual Sensing and on the Retention of Rainfall-Driven EventsWater · 2026