The Use of Near Infrared Spectroscopy in Creating Prediction Models for Total Nitrogen and Total Phosphorus in Dairy Slurry

Fact checked by" Jerome Workman, Jr.

A recent study shows how near-infrared spectroscopy can be used to analyze total nitrogen and total phosphorus levels in dairy slurry.

Near-infrared spectroscopy (NIR) models can be used to accurately determine the total nitrogen (TN) and total phosphorus (TP) contents in dairy slurry from various farms and under different seasonal conditions, according to a recent study published in Spectrochimica Acta Part A: Molecular and Biomolecular Spectroscopy (1).

Comprised of cow manure and water, slurry is often used on farms as a fertilizer for crops (2). Dairy slurry, a byproduct of intensive dairy farming, is rich in essential nutrients like nitrogen and phosphorus (1). However, the precise measurement of these nutrients before their application to fields is vital to avoid environmental issues and ensure effective usage. The danger of slurry is when it is mixed. Once the waste material from animals is collected, it must be broken up and mixed together with water to create the slurry. It is during this process that high amounts of gases can be released, which could be toxic (2).

industrial slurry pipeline | Image Credit: © Evgeny -

industrial slurry pipeline | Image Credit: © Evgeny -

As a result, the researchers sought in their study to develop a NIR model that can determine the TN and TP contents in dairy slurry from various farms and under different seasonal conditions to inform farmers when and how to safely apply slurry to their crops. This study, led by Run Zhao and Keqiang Zhang, saw the researchers collect a substantial data set comprising 828 samples from 33 intensive dairy farms across Tianjin City throughout the four seasons: spring, summer, autumn, and winter (1). This extensive sampling allowed the team to analyze the seasonal influences on TN and TP distribution in the slurry and their effects on the NIRS predictive models (1).

Using partial least squares (PLS) regression, the team established single-season models to predict TN and TP contents. The results were promising, showing that the TN models performed excellently in all seasons (1). Specifically, the models achieved Rp² values ranging from 0.94 to 0.95 and residual predictive deviation (RPD) values between 3.88 and 4.29, which is considered to represent excellent predictive ability where RPD ≥ 3.0 (1).

For TP, the single-season models demonstrated superior performance during spring, summer, and winter, with autumn showing slightly less accuracy (1). This variability highlights the impact of seasonal changes on nutrient distribution and the importance of seasonal-specific models for precise measurements.

The researchers also developed global models of four seasons (GMFS) to predict TN and TP contents, combining data from all seasons. The GMFS for TN achieved Rp² and RPD values of 0.85 and 2.38, respectively, which are considered very good (1). For TP, the GMFS showed Rp² and RPD values of 0.76 and 1.87, indicating good performance but with slightly reduced precision compared to the single-season models (1).

As a result, the GMFS system that the researchers created proved that it can be applied in cases where seasonal variability is important to the analysis. By providing a reliable method for rapidly measuring TN and TP in dairy slurry, the study empowers farmers to make better, well-informed decisions about slurry application, enhancing nutrient management and minimizing environmental risks (1). This advancement supports sustainable agricultural practices by promoting the efficient use of dairy farm byproducts as valuable resources rather than waste.

By ensuring accurate and rapid assessment of TN and TP in dairy slurry, the models developed by Zhao, Zhang, and their team pave the way for more sustainable and efficient agricultural practices, reinforcing the essential link between technology and environmental stewardship.


(1) Li, M.; Sun, D.; Liu, S.; et al. Construction of Rapid Prediction Models for TN and TP in Dairy Farms Slurry Under Different Seasons by Near Infrared Spectroscopy. Spectrochimica Acta Part A: Mol. Biomol. Spectrosc. 2024, 305, 123517. DOI: 10.1016/j.saa.2023.123517

(2) Edinburgh Sensors, The Dangers of Farm Slurry and the Production of Slurry Gas. Edinburgh Sensors Organization Website. Available at: (accessed 2024-06-10).

Related Content