Answers are grounded in this paper and cite their sources.
Reliable monitoring of indoor ammonia (NH 3 ) concentration in dairy housing is essential for environmental management and precision livestock farming. However, continuous barn-scale measurement remains costly and technically demanding. Machine learning (ML) offers a data-driven alternative using routinely collected farm and environmental variables; however, in temporally autocorrelated livestock systems, apparent performance may be inflated when evaluation ignores temporal structure. In this study, four tree-based ensemble models (Random Forest, HistGradientBoosting, XGBoost, and CatBoost) estimated hourly NH 3 concentration in a naturally ventilated dairy barn (NVDB). The study used a unique high-temporal-resolution (hourly) dataset of 5,225 validated NH 3 measurements obtained with research-grade CRDS instrumentation, with routinely available, non-gas proxy variables describing barn climate and wind conditions, herd state, farm management practices, and milk production and quality. CatBoost achieved high apparent performance under random splitting (R 2 = 0.84) but declined markedly under time-aware validation (R 2 = 0.103; strict weekly walk-forward validation). A lag -1 persistence baseline consistently outperformed CatBoost, and leave-one-season-out (LOSO) testing yielded near-zero or negative R 2 values, especially in summer (R 2 ≈ –1.47), indicating failure to generalize across unseen seasonal conditions. SHAP feature-relevance scores, permutation importance, drop-one feature ablation, and cumulative R 2 analysis showed that multiple variables drove predictive skill, with Cleaning_h and climate/wind as the dominant contributors at the individual and group levels, respectively. Input-perturbation tests (100 realizations per noise level) showed a gradual decline in R 2 from 0.836 to 0.760 at 10% noise, but they do not address robustness to seasonal shift. These results show that routinely available non-gas farm features explained much of the variance in NH 3 under random splitting but did not generalize to unseen weeks or seasons, and that random validation overstates performance, highlighting the need for rigorous time-aware validation and persistence benchmarking in sensor-reduced monitoring systems.
No takes yet. Share an insight, caveat, or question.
Mehmood et al. (2026) studied this question.
Synapse has enriched 10 related papers. Consider them for comparative context: