Development of a Rapid Ammonia Concentration Prediction Model for Pig Manure Reactor Composting Based on Infrared Spectroscopy
This study was conducted through an international collaboration involving Northeast Agricultural University and the Agro-Environmental Protection Institute of China’s Ministry of Agriculture and Rural Affairs, together with NIBIO the Norwegian Institute of Bioeconomy Research, and the University of Duisburg-Essen in Germany.

Abstract
To address the challenges of delayed sample collection, the loss of valid samples, and unstable concentration predictions during the monitoring of ammonia emissions from pig-manure reactor composting, this study developed an in situ online monitoring system integrating photoacoustic spectroscopy and infrared spectroscopy. A multi-indicator iterative outlier-removal method based on logarithmic binning, referred to as Method A, was developed and compared with a conventional single-indicator method using a global threshold, referred to as Method B. Partial least squares regression, random forest, and extremely randomized trees were used to construct quantitative ammonia-concentration prediction models for different concentration bins. Model performance was then systematically assessed using multiple evaluation indicators.
Compared with Method B, Method A increased the sample-retention rate by 22.4% and reduced the loss of dynamic range by 96.2%. During model development, the extremely randomized trees model achieved prediction coefficients of determination ranging from 0.894 to 0.973 across the concentration bins, with residual predictive deviation values of at least 3.0 and mean absolute error as a percentage of full scale ranging from ±2.19% to ±2.68%. Its performance was superior to that of the random forest and partial least squares models.
In subsequent validation, the extremely randomized trees models for the three concentration bins achieved coefficients of determination of 0.908, 0.978, and 0.989, respectively. The corresponding residual predictive deviation values were 3.217, 6.184, and 6.157, while the mean absolute errors as percentages of full scale were ±2.98%, ±3.20%, and ±3.59%, respectively. These results meet the requirements for high-precision quantitative analysis under complex operating conditions.
The findings demonstrate that combining logarithmic binning-based multi-indicator iterative outlier removal with extremely randomized trees enables rapid quantitative prediction of ammonia concentrations. This approach provides technical support for the accurate monitoring of ammonia-emission levels during reactor composting.
Keywords
Keywords: Pig manure; reactor composting; ammonia; quantitative prediction; infrared spectroscopy; outlier removal; prediction model.
Reference
Jia, Y., Yang, Z., Cordeiro, C. M., Sindhöj, E., Siesler, H. W., Qin, W., Zhao, R., & Zhang, K. (2026). 基于红外光谱的猪粪反应器堆肥氨排放浓度速测模型构建 / Development of a rapid ammonia concentration prediction model for pig manure reactor composting based on infrared spectroscopy. 农业环境科学学报 / Journal of Agro-Environment Science. Advance online publication. PDF download.
