Low-Cost NIR Spectroscopy Versus NMR Spectroscopy for Liquid Manure Characterization
Abstract
1. Introduction
2. Material and Methods
2.1. Manure Sampling
- Manure mixing: Liquid manure in the storage facility was thoroughly mixed using a mixer (Thermomix TM31, Cloyes-les-Trois-Rivières, France) to ensure uniformity;
- Sample extraction: A closed system with input and output lines transferred liquid manure from the lagoon to a 6 m3 tank using a vacuum pump;
- Homogenization: The manure circulated continuously for 10 min within the tank using a rotary lobe pump (Vogelsang R136-420S, Germany) for complete blending and homogenization;
- Representative sample collection: A dedicated valve extracted a sample from the closed system into a 100 L barrel containing approximately 60 L of pre-mixed manure;
- Enhanced homogeneity: The sample underwent further mixing within the barrel using a macerator (Dynamic SMX 800 T Supermixer, 11,000 rpm, 1000 W, Kehl Auenheim, Germany) to ensure a representative sampling;
- Subsampling and preservation: After the homogenization, three 1 L aliquots were collected for laboratory analysis, and for scanning with NIR and NMR sensors. These subsamples were promptly cooled and preserved during transport. At the end of the day, all samples were frozen at −21 °C to store for further analysis.
2.2. Data Acquisition
2.2.1. Reference Analysis
2.2.2. NIR Spectra Acquisition
2.2.3. Model Validation Enhancements
2.3. NIR Spectral Data Processing: Pre-Processing and Feature Selection
2.3.1. Spectral Pre-Processing
2.3.2. Feature Selection
2.4. Modeling
2.4.1. Machine Learning Methods
2.4.2. Model Performance Assessment
- Excellent: RPD > 4.0
- Successful: 3.0 ≤ RPD ≤ 4.0
- Useful: 2.2 ≤ RPD ≤ 3.0
- Moderately useful: 1.7 ≤ RPD ≤ 2.2
- Acceptable: 1.5 ≤ RPD ≤ 1.7
- Poor: RPD < 1.5
2.4.3. Implementation Platform
2.5. NMR Measurements
3. Results and Discussion
3.1. Reference Laboratory Results
3.2. NIRS Results
3.2.1. Performance of Different Calibration Models
3.2.2. Performance of Different Feature Selection Methods
3.2.3. Performance of the Two- and Three-Band Indices Transformations
3.2.4. Model Transferability and Assessment of R2 Differences
3.3. Performance of the NIRS vs. NMR
3.4. Calibration Limitations and Comparison Fairness
4. Conclusions
Supplementary Materials
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Jawaid, M.; Khan, A. Manure Technology and Sustainable Development; Springer Nature: Singapore, 2023; ISBN 978-981-19-4119-1. [Google Scholar]
- Abrar, M.M.; Shah, S.A.A.; Sun, N.; Mehmood, K.; Aziz, T.; Waqas, M.A.; Luo, Y.; Zhou, B.; Ma, X.; Xu, M.; et al. Long-term manure application enhances organic carbon and nitrogen stocks in Mollisol subsoil. Land. Degrad. Dev. 2023, 34, 815–832. [Google Scholar] [CrossRef]
- Amanullah; Khan, U. Enriching Soil Organic Carbon for Sustainable Agriculture, Food Security, and Health. JISDeP 2024, 5, 67–75. [Google Scholar] [CrossRef]
- Goldan, E.; Nedeff, V.; Barsan, N.; Culea, M.; Panainte-Lehadus, M.; Mosnegutu, E.; Tomozei, C.; Chitimus, D.; Irimia, O. Assessment of Manure Compost Used as Soil Amendment—A Review. Processes 2023, 11, 1167. [Google Scholar] [CrossRef]
- Hua, W.; Luo, P.; An, N.; Cai, F.; Zhang, S.; Chen, K.; Yang, J.; Han, X. Manure application increased crop yields by promoting nitrogen use efficiency in the soils of 40-year soybean-maize rotation. Sci. Rep. 2020, 10, 14882. [Google Scholar] [CrossRef] [PubMed]
- Sanford, J.R.; Larson, R.A.; Digman, M.F. Assessing Certified Manure Analysis Laboratory Accuracy and Variability. Appl. Eng. Agric. 2020, 36, 905–912. [Google Scholar] [CrossRef]
- Lavine, B. A user-friendly guide to multivariate calibration and classification, Tomas Naes, Tomas Isakson, Tom Fearn and Tony Davies, NIR Publications, Chichester, 2002, ISBN 0-9528666-2-5, £45.00. J. Chemom. 2003, 17, 571–572. [Google Scholar] [CrossRef]
- Horf, M.; Vogel, S.; Drücker, H.; Gebbers, R.; Olfs, H.-W. Optical Spectrometry to Determine Nutrient Concentrations and other Physicochemical Parameters in Liquid Organic Manures: A Review. Agronomy 2022, 12, 514. [Google Scholar] [CrossRef]
- Horf, M.; Gebbers, R.; Olfs, H.-W.; Vogel, S. Effects of sample pre-treatments on the analysis of liquid organic manures by visible and near-infrared spectrometry. Heliyon 2024, 10, e27136. [Google Scholar] [CrossRef]
- Gogé, F.; Thuriès, L.; Fouad, Y.; Damay, N.; Davrieux, F.; Moussard, G.; Le Roux, C.; Trupin-Maudemain, S.; Valé, M.; Morvan, T. Dataset of chemical and near-infrared spectroscopy meas-urements of fresh and dried poultry and cattle manure. Data Brief. 2021, 34, 106647. [Google Scholar] [CrossRef] [PubMed]
- Feng, X.; Larson, R.A.; Digman, M.F. Evaluating the Feasibility of a Low-Field Nuclear Magnetic Resonance (NMR) Sensor for Manure Nutrient Prediction. Sensors 2022, 22, 2438. [Google Scholar] [CrossRef]
- Turner, B.L. Optimizing Phosphorus Characterization in Animal Manures by Solution Phosphorus—31 Nuclear Magnetic Resonance Spectroscopy. J. Env. Quality 2004, 33, 757–766. [Google Scholar] [CrossRef]
- Horf, M.; Gebbers, R.; Olfs, H.-W.; Vogel, S. Determining nutrients, dry matter, and pH of liquid organic manures using visual and near-infrared spectrometry. Sci. Total Environ. 2024, 908, 168045. [Google Scholar] [CrossRef]
- Jensen, O.N.; Beyer, M.; Sørensen, M.K.; Kreimeyer, M.; Nielsen, N.C. Fast and Accurate Quantification of Nitrogen and Phosphorus Constituents in Animal Slurries Using NMR Sensor Technology. ACS Omega 2021, 6, 17335–17341. [Google Scholar] [CrossRef]
- Reeves, J.B.; van Kessel, J.S. Near-Infrared spectroscopic determination of carbon, total nitrogen, and ammonium-N in dairy manures. J. Dairy. Sci. 2000, 83, 1829–1836. [Google Scholar] [CrossRef] [PubMed]
- Reeves, J.B. Near-infrared diffuse reflectance spectroscopy for the analysis of poultry manures. J. Agric. Food Chem. 2001, 49, 2193–2197. [Google Scholar] [CrossRef]
- Saeys, W.; Mouazen, A.M.; Ramon, H. Potential for Onsite and Online Analysis of Pig Manure using Visible and Near Infrared Reflectance Spectroscopy. Biosyst. Eng. 2005, 91, 393–402. [Google Scholar] [CrossRef]
- Rech, Â.F.; Werner, S.S. UTILIZAÇÃO DA TECNOLOGIA NIRS PARA PREDIÇÃO DOS VALORES NUTRICIONAIS DE FORRAGEIRAS. RAC 2020, 33, 11–14. [Google Scholar] [CrossRef]
- Xing, L.; Chen, L.J.; Han, L.J. Rapid analysis of layer manure using near-infrared reflectance spectros-copy. Poult. Sci. 2008, 87, 1281–1286. [Google Scholar] [CrossRef] [PubMed]
- Malley, D.F.; Yesmin, L.; Eilers, R.G. Rapid Analysis of Hog Manure and Manure—Amended Soils Using Near—Infrared Spectroscopy. Soil. Sci. Soc. of Amer J. 2002, 66, 1677–1686. [Google Scholar] [CrossRef]
- Rinnan, Å.; van den Berg, F.; Engelsen, S.B. Review of the most common pre-processing techniques for near-infrared spectra. TrAC Trends Anal. Chem. 2009, 28, 1201–1222. [Google Scholar] [CrossRef]
- Tavakoli, H.; Correa, J.; Sabetizade, M.; Vogel, S. Predicting key soil properties from Vis-NIR spectra by applying dual-wavelength indices transformations and stacking machine learning approaches. Soil. Tillage Res. 2023, 229, 105684. [Google Scholar] [CrossRef]
- Eslamifar, M.; Tavakoli, H.; Thiessen, E.; Kock, R.; Correa, J.; Hartung, E. Effective spectral pre-processing methods enhance accuracy of soil property prediction by NIR spectroscopy. Discov. Appl. Sci. 2025, 7, 896. [Google Scholar] [CrossRef]
- Kapadia, C.; Taylor, C.; Crawford, J. An Atlas of Gastroenterology; CRC Press: Boca Raton, FL, USA, 2002; ISBN 978-1-85070-581-9. [Google Scholar]
- Mehmood, T.; Liland, K.H.; Snipen, L.; Sæbø, S. A review of variable selection methods in Partial Least Squares Regression. Chemom. Intell. Lab. Syst. 2012, 118, 62–69. [Google Scholar] [CrossRef]
- Saeys, Y.; Inza, I.; Larrañaga, P. A review of feature selection techniques in bioinformatics. Bioinformatics 2007, 23, 2507–2517. [Google Scholar] [CrossRef]
- Zhao, B.; Yang, B.; Hu, X.; Liu, B. Two colorimetric and ratiometric fluorescence probes for hydrogen sulfide based on AIE strategy of α-cyanostilbenes. Spectrochim. Acta A Mol. Biomol. Spectrosc. 2018, 199, 117–122. [Google Scholar] [CrossRef]
- Zimmermann, A.; Hartung, E. Nährstoffgesteuerte Gülleausbringung: Christian-Albrechts-Universität; Institut für Landwirtschaftliche Verfahrenstechnik: Kiel, Germany, 2009; pp. 1–130. [Google Scholar]
- Cabassi, G.; Cavalli, D.; Fuccella, R.; Marino Gallina, P. Evaluation of four NIR spectrometers in the analysis of cattle slurry. Biosyst. Eng. 2015, 133, 1–13. [Google Scholar] [CrossRef]
- Wold, S.; Sjöström, M.; Eriksson, L. PLS-regression: A basic tool of chemometrics. Chemom. Intell. Lab. Syst. 2001, 58, 109–130. [Google Scholar] [CrossRef]
- Kohavi, R. A study of cross-validation and bootstrap for accuracy estimation and model selection. In Proceedings of the 14th International Joint Conference on Artificial Intelligence, San Francisco, CA, USA, 20–25 August 1995; pp. 1137–1145. [Google Scholar]
- DIN EN 13342; Characterization of Sludges—Determination of Phosphorus—Spectrometric Determination of Phosphorus Soluble in Nitric Acid. Deutsches Institut für Normung (DIN): Berlin, Germany, 2001.
- DIN EN ISO 11885; Water Quality—Determination of Selected Elements by Inductively Coupled Plasma Optical Emission Spectrometry (ICP-OES). Deutsches Institut für Normung (DIN): Berlin, Germany, 2009.
- DIN 38406-5-2; German Standard Methods for the Examination of Water, Waste Water and Sludge—Cations (Group E)—Determination of Ammonium Nitrogen (E 5-2). Deutsches Institut für Normung (DIN): Berlin, Germany, 1983.
- DIN EN 15934; Sludge, Treated Biowaste and Soil—Determination of Dry Residue and Water Content. Deutsches Institut für Normung (DIN): Berlin, Germany, 2012.
- Savitzky, A.; Golay, M.J.E. Smoothing and Differentiation of Data by Simplified Least Squares Procedures. Anal. Chem. 1964, 36, 1627–1639. [Google Scholar] [CrossRef]
- Beć, K.B.; Grabska, J.; Huck, C.W. Near-Infrared Spectroscopy in Bio-Applications. Molecules 2020, 25, 2948. [Google Scholar] [CrossRef]
- Schirrmann, M.; Gebbers, R.; Kramer, E. Performance of Automated Near-Infrared Reflectance Spec-trometry for Continuous in Situ Mapping of Soil Fertility at Field Scale. Vadose Zone J. 2013, 12, 1–14. [Google Scholar] [CrossRef]
- Ciurczak, E.W.; Igne, B.; Workman, J.; Burns, D.A.; Workman, J. Handbook of Near-Infrared Analysis, 4th ed.; CRC Press: Boca Raton, FL, USA; Taylor and Francis: Boca Raton, FL, USA, 2021; ISBN 9781351269889. [Google Scholar]
- Torres, L.F.; Oliveira, M.R.; Barbalho, T.C.; Dariva, C.; Borges, G.R.; Ndiaye, P.M.; Tavares, F.W. The use of NIR spectroscopy for the quantification of water content and compositional analysis in compressed gas-systems. Vib. Spectrosc. 2025, 139, 103815. [Google Scholar] [CrossRef]
- Ailavajhala, R.; Querido, W.; Rajapakse, C.S.; Pleshko, N. Near infrared spectroscopic assessment of loosely and tightly bound cortical bone water. Analyst 2020, 145, 3713–3724. [Google Scholar] [CrossRef]
- Tibshirani, R. Regression Shrinkage and Selection Via the Lasso. J. R. Stat. Soc. Ser. B Stat. Methodol. 1996, 58, 267–288. [Google Scholar] [CrossRef]
- James, G.; Witten, D.; Hastie, T.; Tibshirani, R. An Introduction to Statistical Learning; Springer: New York, NY, USA, 2021; ISBN 978-1-0716-1417-4. [Google Scholar]
- Hastie, T.; Tibshirani, R.; Friedman, J. The Elements of Statistical Learning; Springer: New York, NY, USA, 2009; ISBN 978-0-387-84857-0. [Google Scholar]
- Linow, F. Near-Infrared Technology in the Agriculture and Food Industries. Herausgegeben von P. Williams und K. Norris. 330 Seiten, zahlr. Abb. und Tab. American Association of Cereal Chemists, Inc., St. Paul, Minnesota, USA, 1987. Preis: 175,90 $ (USA 169,00 $). Nahrung 1988, 32, 803. [Google Scholar] [CrossRef]
- Dietterich, T.G. Approximate Statistical Tests for Comparing Supervised Classification Learning Algo-rithms. Neural Comput. 1998, 10, 1895–1923. [Google Scholar] [CrossRef]
- Sørensen, M.K.; Jensen, O.; Bakharev, O.N.; Nyord, T.; Nielsen, N.C. NPK NMR Sensor: Online Mon-itoring of Nitrogen, Phosphorus, and Potassium in Animal Slurry. Anal. Chem. 2015, 87, 6446–6450. [Google Scholar] [CrossRef]
- Finzi, A.; Oberti, R.; Negri, A.S.; Perazzolo, F.; Cocolo, G.; Tambone, F.; Cabassi, G.; Provolo, G. Effects of measurement technique and sample preparation on NIR spectroscopy analysis of livestock slurry and digestates. Biosyst. Eng. 2015, 134, 42–54. [Google Scholar] [CrossRef]
- Morvan, T.; Gogé, F.; Oboyet, T.; Carel, O.; Fouad, Y. A dataset of the chemical composition and near-infrared spectroscopy measurements of raw cattle, poultry and pig manure. Data Brief. 2021, 39, 107475. [Google Scholar] [CrossRef]
- Phatak, A. A User-Friendly Guide to Multivariate Calibration and Classificationtion, T. Næs, T. Isaksson, T. Fearn, T. Davies. Chemom. Intell. Lab. Syst. 2004, 71, 79–81. [Google Scholar] [CrossRef]
- Büning-Pfaue, H. Analysis of water in food by near infrared spectroscopy. Food Chem. 2003, 82, 107–115. [Google Scholar] [CrossRef]
- Tangorra, F.M.; Buoio, E.; Finzi, A.; Costa, A.; Ferrari, O.; Provolo, G. Nutrient quantification of live-stock slurry and digestate using a low-cost handheld NIR spectrometer and multi-biomass calibration models. Biosyst. Eng. 2024, 240, 100–106. [Google Scholar] [CrossRef]
- Workman, J.J.; Weyer, L. Practical Guide to Interpretive Near-Infrared Spectroscopy; CRC Press: Boca Raton, FL, USA, 2007; ISBN 9780429119576. [Google Scholar]
- Chen, L.; Xing, L.; Han, L. Review of the application of near-infrared spectroscopy technology to de-termine the chemical composition of animal manure. J. of Env. Quality 2013, 42, 1015–1028. [Google Scholar] [CrossRef] [PubMed]
- Wali, K.; Khan, H.A.; Sica, P.; van Henten, E.J.; Meers, E.; Brunn, S. Application of fourier transform infrared photoacoustic spectroscopy for quantification of nutrient contents and their plant availability in manure and digestate. Heliyon 2024, 10, e28487. [Google Scholar] [CrossRef] [PubMed]
- Wang, L.; Jiang, S.; Jiang, S. A feature selection method via analysis of relevance, redundancy, and in-teraction. Expert Syst. Appl. 2021, 183, 115365. [Google Scholar] [CrossRef]
- Bhalaji, N.; Kumar, K.S.; Selvaraj, C. Empirical study of feature selection methods over classification algorithms. IJISTA 2018, 17, 98. [Google Scholar] [CrossRef]
- Zhang, Z.; Li, Y.; Li, C.; Wang, Z.; Chen, Y. Algorithm of Stability-Analysis-Based Feature Selection for NIR Calibration Transfer. Sensors 2022, 22, 1659. [Google Scholar] [CrossRef]






| Manure Property | Unit | Method | Comments |
|---|---|---|---|
| TN * | g/kg | DIN EN 13342: 2001-01 [32] | Kjeldahl |
| TP | g/kg | DIN EN ISO 11885: 2009-09 [33] | ICP-OES ** |
| NH4-N | g/kg | DIN 38406-5-2: 1983-10 [34] | flame photometric |
| DM | % | DIN EN 15934: 2012-11, A [35] | Calculation |
| Manure Property * | Minimum | Maximum | Mean | Median | Range | Q1 | Q3 | CV | SD |
|---|---|---|---|---|---|---|---|---|---|
| DM (%) | 0.86 | 9.68 | 6.35 | 6.62 | 8.82 | 4.83 | 8.06 | 0.34 | 2.18 |
| TN (g/kg) | 0.63 | 6.74 | 3.69 | 3.43 | 6.11 | 3.03 | 4.18 | 0.32 | 1.17 |
| NH4-N (g/kg) | 0.38 | 5.09 | 2.26 | 1.98 | 4.71 | 1.58 | 2.46 | 0.45 | 1.02 |
| TP (g/kg) | 0.26 | 4.10 | 1.69 | 1.38 | 3.84 | 1.17 | 2.09 | 0.52 | 0.89 |
| Manure Property | Model | Pre-Processing Method * | R2 | RMSE | RPD |
|---|---|---|---|---|---|
| DM ** | PLSR | FS_MLR_TBI3 | 0.78 | 1.02% | 2.2 |
| TN | PLSR | SRI_ALL | 0.66 | 0.70 g/kg | 1.7 |
| LASSO | SRI_ALL | 0.64 | 0.72 g/kg | 1.6 | |
| NH4-N | PLSR | FS_SVM_TBI3 | 0.84 | 0.42 g/kg | 2.5 |
| PLSR | FS_SVM_SRI | 0.82 | 0.43 g/kg | 2.3 | |
| PLSR | FS_SVM | 0.82 | 0.45 g/kg | 2.3 | |
| LASSO | FS_SVM_NDI | 0.80 | 0.46 g/kg | 2.2 | |
| PLSR | FS_SVM_NDI | 0.80 | 0.46 g/kg | 2.2 | |
| LASSO | Raw-NDI | 0.79 | 0.47 g/kg | 2.2 | |
| LASSO | FS_SVM_SR | 0.77 | 0.49 g/kg | 2.1 | |
| PLSR | Raw-NDI | 0.77 | 0.49 g/kg | 2.1 | |
| LASSO | Raw-SRI | 0.76 | 0.50 g/kg | 2.1 | |
| PLSR | FS_SVM_TBI4 | 0.76 | 0.50 g/kg | 2.0 | |
| LASSO | FS_SVM_TBI2 | 0.75 | 0.50 g/kg | 2.0 | |
| TP | LASSO | FS_LASSO_TBI1 | 0.84 | 0.35 g/kg | 2.5 |
| PLSR | FS_LASSO_TBI1 | 0.83 | 0.36 g/kg | 2.4 | |
| PLSR | FS_LASSO_TBI4 | 0.82 | 0.38 g/kg | 2.4 | |
| LASSO | FS_LASSO_TBI4 | 0.82 | 0.38 g/kg | 2.3 | |
| LASSO | FS_SVM_SRI | 0.78 | 0.41 g/kg | 2.1 | |
| LASSO | FS_SVM_TBI4 | 0.78 | 0.42 g/kg | 2.1 | |
| LASSO | FS_SVM_TBI1 | 0.78 | 0.42 g/kg | 2.1 | |
| PLSR | FS_SVM_TBI4 | 0.77 | 0.43 g/kg | 2.1 | |
| LASSO | FS_LASSO_SRI | 0.76 | 0.44 g/kg | 2.0 | |
| LASSO | FS_LASSO_NDI | 0.75 | 0.44 g/kg | 2.0 | |
| LASSO | FS_SVM_TBI2 | 0.76 | 0.44 g/kg | 2.0 | |
| PLSR | Raw-SRI | 0.75 | 0.44 g/kg | 2.0 | |
| PLSR | FS_SVM_SRI | 0.76 | 0.44 g/kg | 2.0 |
| Manure Property | Mean R2 | SD R2 | Overall R2 | Mean RMSE | SD RMSE | Overall RMSE | Mean RPD | SD RPD | Overall RPD |
|---|---|---|---|---|---|---|---|---|---|
| DM | 0.78 | 0.15 | 0.77 | 1.02% | 0.20% | 1.03% | 2.2 | 0.30 | 2.1 |
| NH4-N | 0.84 | 0.12 | 0.83 | 0.42 g/kg | 0.10 g/kg | 0.43 g/kg | 2.5 | 0.25 | 2.4 |
| TP | 0.84 | 0.13 | 0.83 | 0.35 g/kg | 0.08 g/kg | 0.36 g/kg | 2.5 | 0.28 | 2.5 |
| TN | 0.66 | 0.18 | 0.65 | 0.70 g/kg | 0.15 g/kg | 0.71 g/kg | 1.7 | 0.35 | 1.7 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Eslamifar, M.; Tavakoli, H.; Thiessen, E.; Kock, R.; Lausen, P.; Hartung, E. Low-Cost NIR Spectroscopy Versus NMR Spectroscopy for Liquid Manure Characterization. Sensors 2025, 25, 6745. https://doi.org/10.3390/s25216745
Eslamifar M, Tavakoli H, Thiessen E, Kock R, Lausen P, Hartung E. Low-Cost NIR Spectroscopy Versus NMR Spectroscopy for Liquid Manure Characterization. Sensors. 2025; 25(21):6745. https://doi.org/10.3390/s25216745
Chicago/Turabian StyleEslamifar, Mehdi, Hamed Tavakoli, Eiko Thiessen, Rainer Kock, Peter Lausen, and Eberhard Hartung. 2025. "Low-Cost NIR Spectroscopy Versus NMR Spectroscopy for Liquid Manure Characterization" Sensors 25, no. 21: 6745. https://doi.org/10.3390/s25216745
APA StyleEslamifar, M., Tavakoli, H., Thiessen, E., Kock, R., Lausen, P., & Hartung, E. (2025). Low-Cost NIR Spectroscopy Versus NMR Spectroscopy for Liquid Manure Characterization. Sensors, 25(21), 6745. https://doi.org/10.3390/s25216745

