Artificial Neural Network Models for the Prediction of Ammonia Concentrations in a Mediterranean Dairy Barn
Abstract
Simple Summary
Abstract
1. Introduction
2. Materials and Methods
2.1. Barn Features and Timeframe of Investigation
2.2. Input Environmental Parameters and Output Gas Concentration Measurements
2.3. Artificial Neural Network Models and Approaches for NH3 Prediction
2.3.1. Dataset Definition
2.3.2. Model Architecture
2.3.3. Training Process
2.3.4. Performance Evaluation
2.3.5. Outlier Management
2.3.6. Application of the Models
3. Results
- MLP (1–5–1)—6 days, and 12 days for each dataset;
- MLP (1–20–10–5–1)—90 days for each dataset;
- MLP (1–40–20–10–1)—180 days for each dataset.
3.1. First MLP Model
3.2. Second MLP Model
3.3. Third MLP Model
4. Discussion
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
Abbreviations
NH3 | Ammonia |
ANN | Artificial Neural Network |
PLF | Precision Livestock Farming |
MLP | Multilayer Perceptron |
CO2 | Carbon Dioxide |
CH4 | Methane |
RBF | Radial Basis Function |
SE | Southeast |
NE | Northeast |
NW | Northwest |
SW | Southwest |
RG | Ragusa |
R2 | Coefficient of Determination |
R | Coefficient of Correlation |
MAE | Mean Absolute Error |
RMSE | Round Mean Square Error |
MSE | Mean Standard Error |
LM | Levenberg–Marquardt |
BR | Bayesian Regularization |
References
- Thornton, P.K. Livestock production: Recent trends, future prospects. Philos. Trans. R. Soc. B Biol. Sci. 2010, 365, 2853–2867. [Google Scholar] [CrossRef] [PubMed]
- Dominici, F.; Peng, R.D.; Barr, C.D.; Bell, M.L. Protecting human health from air pollution: Shifting from a single-pollutant to a multipollutant approach. Epidemiology 2010, 21, 187–194. [Google Scholar] [CrossRef] [PubMed]
- Cambra-López, M.; Aarnink, A.J.; Zhao, Y.; Calvet, S.; Torres, A.G. Airborne particulate matter from livestock production systems: A review of an air pollution problem. Environ. Pollut. 2010, 158, 1–17. [Google Scholar] [CrossRef] [PubMed]
- Haruna, A.; Tanimu, G.; Ibrahim, I.; Garba, Z.N.; Yahaya, S.M.; Musa, S.G.; Merican, Z.M.A. Mitigating oil and gas pollutants for a sustainable environment—Critical review and prospects. J. Clean. Prod. 2023, 416, 137863. [Google Scholar] [CrossRef]
- Jones, A.P. Indoor air quality and health. Atmos. Environ. 1999, 33, 4535–4564. [Google Scholar] [CrossRef]
- Mujan, I.; Anđelković, A.S.; Munćan, V.; Kljajić, M.; Ružić, D. Influence of indoor environmental quality on human health and productivity—A review. J. Clean. Prod. 2019, 217, 646–657. [Google Scholar] [CrossRef]
- Vogt, E.; Dragosits, U.; Braban, C.F.; Theobald, M.R.; Dore, A.J.; van Dijk, N.; Sutton, M.A. Heterogeneity of atmospheric ammonia at the landscape scale and consequences for environmental impact assessment. Environ. Pollut. 2013, 179, 120–131. [Google Scholar] [CrossRef]
- Wyer, K.E.; Kelleghan, D.B.; Blanes-Vidal, V.; Schauberger, G.; Curran, T.P. Ammonia emissions from agriculture and their contribution to fine particulate matter: A review of implications for human health. J. Environ. Manag. 2022, 323, 116285. [Google Scholar] [CrossRef]
- Castillo, A.R.; Kebreab, E.; Beever, D.E.; France, J. A review of efficiency of nitrogen utilisation in lactating dairy cows and its relationship with environmental pollution. J. Anim. Feed Sci. 2000, 9, 1–32. [Google Scholar] [CrossRef]
- Webb, J.; Misselbrook, T.H. A mass-flow model of ammonia emissions from UK livestock production. Atmos. Environ. 2004, 38, 2163–2176. [Google Scholar] [CrossRef]
- Ding, L.; Li, Q.; Wang, C.; Zhang, G.; Jiang, R.; Yu, L.; Shi, Z. Determination of the mass transfer coefficient of ammonia emissions from dairy open lots using a scale model. Biosyst. Eng. 2020, 190, 145–156. [Google Scholar] [CrossRef]
- Provolo, G.; Brandolese, C.; Grotto, M.; Marinucci, A.; Fossati, N.; Ferrari, O.; Riva, E. An Internet of Things framework for monitoring environmental conditions in livestock housing to improve animal welfare and assess environmental impact. Animals 2025, 15, 644. [Google Scholar] [CrossRef] [PubMed]
- Rodrigues, A.R.; Silva, M.E.; Silva, V.F.; Maia, M.R.; Cabrita, A.R.; Trindade, H.; Pereira, J.L. Implications of seasonal and daily variation on methane and ammonia emissions from naturally ventilated dairy cattle barns in a Mediterranean climate: A two-year study. Sci. Total Environ. 2024, 946, 173734. [Google Scholar] [CrossRef] [PubMed]
- Grzesiak, W.; Błaszczyk, P.; Lacroix, R. Methods of predicting milk yield in dairy cows—Predictive capabilities of Wood’s lactation curve and artificial neural networks (ANNs). Comput. Electron. Agric. 2006, 54, 69–83. [Google Scholar] [CrossRef]
- Rashamol, V.P.; Sejian, V.; Pragna, P.; Lees, A.M.; Bagath, M.; Krishnan, G.; Gaughan, J.B. Prediction models, assessment methodologies and biotechnological tools to quantify heat stress response in ruminant livestock. Int. J. Biometeorol. 2019, 63, 1265–1281. [Google Scholar] [CrossRef]
- Jose, V.S.; Sejian, V.; Bagath, M.; Ratnakaran, A.P.; Lees, A.M.; Al-Hosni, Y.A.; Gaughan, J.B. Modeling of greenhouse gas emission from livestock. Front. Environ. Sci. 2016, 4, 27. [Google Scholar] [CrossRef]
- D’Urso, P.R.; Arcidiacono, C.; Valenti, F.; Cascone, G. Assessing influence factors on daily ammonia and greenhouse gas concentrations from an open-sided cubicle barn in hot mediterranean climate. Animals 2021, 11, 1400. [Google Scholar] [CrossRef]
- Basak, J.K.; Okyere, F.G.; Arulmozhi, E.; Park, J.; Khan, F.; Kim, H.T. Artificial neural networks and multiple linear regression as potential methods for modelling body surface temperature of pig. J. Appl. Anim. Res. 2020, 48, 207–219. [Google Scholar] [CrossRef]
- Chen, X.; Zheng, H.; Wang, H.; Yan, T. Can machine learning algorithms perform better than multiple linear regression in predicting nitrogen excretion from lactating dairy cows. Sci. Rep. 2022, 12, 12478. [Google Scholar] [CrossRef]
- Suzuki, K. Artificial Neural Networks-Architectures and Applications; IntechOpen Limited: London, UK, 2013. [Google Scholar] [CrossRef]
- Basak, J.K.; Arulmozhi, E.; Moon, B.E.; Bhujel, A.; Kim, H.T. Modelling methane emissions from pig manure using statistical and machine learning methods. Air Qual. Atmos. Health 2022, 15, 575–589. [Google Scholar] [CrossRef]
- Stamenković, L.J.; Antanasijević, D.; Ristić, M.; Perić-Grujić, A.; Pocajt, V. Modeling of methane emissions using the artificial neural network approach. J. Serbian Chem. Soc. 2015, 80, 421–433. [Google Scholar] [CrossRef]
- Peng, S.; Zhu, J.; Liu, Z.; Hu, B.; Wang, M.; Pu, S. Prediction of ammonia concentration in a pig house based on machine learning models and environmental parameters. Animals 2022, 13, 165. [Google Scholar] [CrossRef] [PubMed]
- Sun, G.; Hoff, S.J.; Zelle, B.C.; Smith, M.A. Development and comparison of backpropagation and generalized regression neural network models to predict diurnal and seasonal gas and PM10 concentrations and emissions from swine buildings. In 2008 Providence, Rhode Island, June 29–July 2, 2008; American Society of Agricultural and Biological Engineers: St. Joseph, MI, USA, 2008; p. 1. [Google Scholar] [CrossRef]
- Shi, Y.; Shi, Y.; Niu, H.; Liu, J.; Sun, P. Structure Optimization and Data Processing Method of Electronic Nose Bionic Chamber for Detecting Ammonia Emissions from Livestock Excrement Fermentation. Sensors 2024, 24, 1628. [Google Scholar] [CrossRef] [PubMed]
- Shadpour, S.; Chud, T.C.; Hailemariam, D.; Plastow, G.; Oliveira, H.R.; Stothard, P.; Schenkel, F.S. Predicting methane emission in Canadian Holstein dairy cattle using milk mid-infrared reflectance spectroscopy and other commonly available predictors via artificial neural networks. J. Dairy Sci. 2022, 105, 8272–8285. [Google Scholar] [CrossRef]
- Rodriguez, M.R.; Besteiro, R.; Ortega, J.A.; Fernandez, M.D.; Arango, T. Evolution and neural network prediction of CO2 emissions in weaned piglet farms. Sensors 2022, 22, 2910. [Google Scholar] [CrossRef]
- Piotrowski, A.P.; Napiorkowski, J.J. A comparison of methods to avoid overfitting in neural networks training in the case of catchment runoff modelling. J. Hydrol. 2013, 476, 97–111. [Google Scholar] [CrossRef]
- Fratianni, S.; Acquaotta, F. The climate of Italy. In Landscapes and Landforms of Italy; Springer International Publishing: Cham, Switzerland, 2017; pp. 29–38. [Google Scholar]
- D’Urso, P.R.; Arcidiacono, C.; Cascone, G. Analysis of the horizontal distribution of sampling points for gas concentrations monitoring in an open-sided dairy barn. Animals 2022, 12, 3258. [Google Scholar] [CrossRef]
- Janke, D.; Willink, D.; Ammon, C.; Hempel, S.; Schrade, S.; Demeyer, P.; Amon, T. Calculation of ventilation rates and ammonia emissions: Comparison of sampling strategies for a naturally ventilated dairy barn. Biosyst. Eng. 2020, 198, 15–30. [Google Scholar] [CrossRef]
- Hodson, T.O.; Over, T.M.; Foks, S.S. Mean squared error, deconstructed. J. Adv. Model. Earth Syst. 2021, 13, e2021MS002681. [Google Scholar] [CrossRef]
- Popescu, M.C.; Balas, V.E.; Perescu-Popescu, L.; Mastorakis, N. Multilayer perceptron and neural networks. WSEAS Trans. Circuits Syst. 2009, 8, 579–588. [Google Scholar]
- Kruse, R.; Mostaghim, S.; Borgelt, C.; Braune, C.; Steinbrecher, M. Multi-layer perceptrons. In Computational Intelligence: A Methodological Introduction; Springer International Publishing: Cham, Switzerland, 2022; pp. 53–124. [Google Scholar] [CrossRef]
- Zhou, T.; Jiang, Z.; Liu, X.; Tan, K. Research on the long-term and short-term forecasts of navigable river’s water-level fluctuation based on the adaptive multilayer perceptron. J. Hydrol. 2020, 591, 125285. [Google Scholar] [CrossRef]
- Burden, F.; Winkler, D. Bayesian regularization of neural networks. Artif. Neural Netw. Methods Appl. 2009, 458, 23–42. [Google Scholar] [CrossRef]
- Boukerche, A.; Zheng, L.; Alfandi, O. Outlier detection: Methods, models, and classification. ACM Comput. Surv. (CSUR) 2020, 53, 1–37. [Google Scholar] [CrossRef]
- Hodge, V.; Austin, J. A survey of outlier detection methodologies. Artif. Intell. Rev. 2004, 22, 85–126. [Google Scholar] [CrossRef]
- D’Urso, P.R.; Arcidiacono, C.; Casone, G. Ammonia and greenhouse gas distribution in a dairy barn during warm periods. Front. Agric. Sci. Eng. 2024, 11, 428–441. [Google Scholar] [CrossRef]
- Lovanh, N.; Quintanar, A.; Rysz, M.; Loughrin, J.; Mahmood, R. Effect of heat fluxes on ammonia emission from swine waste lagoon based on neural network analyses. J. Environ. Sci. Technol. 2013, 7, 16–29. [Google Scholar] [CrossRef]
- Küçüktopcu, E.; Cemek, B. The use of artificial neural networks to estimate optimum insulation thickness, energy savings, and carbon dioxide emissions. Environ. Prog. Sustain. Energy 2021, 40, e13478. [Google Scholar] [CrossRef]
- Besteiro, R.; Arango, T.; Ortega, J.A.; Rodríguez, M.R.; Fernández, M.D.; Velo, R. Prediction of carbon dioxide concentration in weaned piglet buildings by wavelet neural network models. Comput. Electron. Agric. 2017, 143, 201–207. [Google Scholar] [CrossRef]
- Genedy, R.A.; Chung, M.; Shortridge, J.E.; Ogejo, J.A. A physics-informed long short-term memory (LSTM) model for estimating ammonia emissions from dairy manure during storage. Sci. Total Environ. 2024, 912, 168885. [Google Scholar] [CrossRef]
- Kolasa-Wiecek, A. Use of artificial neural networks in predicting direct nitrous oxide emissions from agricultural soils. Ecol. Chem. Eng. 2014, 20, 419. [Google Scholar]
- Hempel, S.; Adolphs, J.; Landwehr, N.; Janke, D.; Amon, T. How the selection of training data and modeling approach affects the estimation of ammonia emissions from a naturally ventilated dairy barn—Classical statistics versus machine learning. Sustainability 2020, 12, 1030. [Google Scholar] [CrossRef]
- Kadhim, Z.S.; Abdullah, H.S.; Ghathwan, K.I. Artificial Neural Network Hyperparameters Optimization: A Survey. Int. J. Online Biomed. Eng. 2022, 18, 59–87. [Google Scholar] [CrossRef]
- Kostopoulos, A.E.; Grapsa, T.N. Self-scaled conjugate gradient training algorithms. Neurocomputing 2009, 72, 3000–3019. [Google Scholar] [CrossRef]
- Prechelt, L. Early stopping-but when? In Neural Networks: Tricks of the Trade; Springer: Berlin/Heidelberg, Germany, 2002; pp. 55–69. [Google Scholar] [CrossRef]
- Occupational Safety and Health Administration. Ammonia; OSHA: Washington, DC, USA, 2025. Available online: https://www.osha.gov/chemicaldata/623 (accessed on 2 September 2025).
- Llonch, P.; Haskell, M.J.; Dewhurst, R.J.; Turner, S.P. Current available strategies to mitigate greenhouse gas emissions in livestock systems: An animal welfare perspective. Animal 2017, 11, 274–284. [Google Scholar] [CrossRef] [PubMed]
- Aan den Toorn, S.I.; Worrell, E.; Van Den Broek, M.A. How much can combinations of measures reduce methane and nitrous oxide emissions from European livestock husbandry and feed cultivation? J. Clean. Prod. 2021, 304, 127138. [Google Scholar] [CrossRef]
Training Algorithms | Description |
---|---|
Levemberg–Marquardt | The Levenberg–Marquardt algorithm is a fast and robust method for solving non-linear least squares problems, blending gradient descent with Gauss–Newton |
Bayesian Regularization | Bayesian Regularization improves neural network generalization by penalizing complexity and preventing overfitting through a probabilistic framework |
Number of Outliers | |||
---|---|---|---|
Subdataset | Hot | Cold | Transition |
6 days | 22 | 18 | 15 |
12 days | 49 | 45 | 25 |
30 days | 377 | 268 | 283 |
90 days | 784 | 514 | 574 |
Hot Weather | ||||
6 days | 12 days | |||
Data without Outliers | Raw Data | Data without Outliers | Raw Data | |
R | 0.92 | 0.84 | 0.92 | 0.85 |
R2 | 0.85 | 0.70 | 0.84 | 0.73 |
MAE | 0.44 | 0.60 | 0.47 | 0.65 |
MSE | 0.36 | 0.70 | 0.45 | 0.84 |
RMSE | 0.60 | 0.83 | 0.67 | 0.92 |
Cold Weather | ||||
6 days | 12 days | |||
Data without Outliers | Raw Data | Data without Outliers | Raw Data | |
R | 0.93 | 0.87 | 0.96 | 0.92 |
R2 | 0.85 | 0.76 | 0.92 | 0.83 |
MAE | 0.25 | 0.48 | 0.36 | 0.45 |
MSE | 0.22 | 0.35 | 0.25 | 0.55 |
RMSE | 0.47 | 0.59 | 0.50 | 0.74 |
Transitional Weather | ||||
6 days | 12 days | |||
Data without Outliers | Raw Data | Data without Outliers | Raw Data | |
R | 0.97 | 0.84 | 0.96 | 0.92 |
R2 | 0.92 | 0.70 | 0.93 | 0.85 |
MAE | 0.36 | 0.75 | 0.36 | 0.39 |
MSE | 0.25 | 0.94 | 0.22 | 0.43 |
RMSE | 0.50 | 0.97 | 0.47 | 0.65 |
Hot Weather | ||
90 days | ||
Data without Outliers | Raw Data | |
R | 0.93 | 0.88 |
R2 | 0.85 | 0.73 |
MAE | 0.32 | 0.41 |
MSE | 0.54 | 0.97 |
RMSE | 0.73 | 0.98 |
Cold Weather | ||
90 days | ||
Data without Outliers | Raw Data | |
R | 0.93 | 0.85 |
R2 | 0.85 | 0.73 |
MAE | 0.32 | 0.50 |
MSE | 0.53 | 0.64 |
RMSE | 0.72 | 0.80 |
Transitional Weather | ||
90 days | ||
Data without Outliers | Raw Data | |
R | 0.94 | 0.90 |
R2 | 0.88 | 0.80 |
MAE | 0.24 | 0.32 |
MSE | 0.27 | 0.48 |
RMSE | 0.50 | 0.69 |
Hot Weather | ||
180 days | ||
Data without Outliers | Raw Data | |
R | 0.86 | 0.85 |
R2 | 0.71 | 0.70 |
MAE | 0.52 | 0.60 |
MSE | 0.80 | 0.78 |
RMSE | 0.90 | 0.88 |
Cold Weather | ||
180 days | ||
Data without Outliers | Raw Data | |
R | 0.87 | 0.85 |
R2 | 0.72 | 0.70 |
MAE | 0.50 | 0.40 |
MSE | 0.76 | 0.80 |
RMSE | 0.87 | 0.90 |
Transitional Weather | ||
180 days | ||
Data without Outliers | Raw Data | |
R | 0.91 | 0.89 |
R2 | 0.81 | 0.76 |
MAE | 0.37 | 0.46 |
MSE | 0.49 | 0.56 |
RMSE | 0.70 | 0.76 |
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
Santoro, L.M.; D’Urso, P.R.; Arcidiacono, C.; Frattale Mascioli, F.M.; Coco, S. Artificial Neural Network Models for the Prediction of Ammonia Concentrations in a Mediterranean Dairy Barn. Animals 2025, 15, 2967. https://doi.org/10.3390/ani15202967
Santoro LM, D’Urso PR, Arcidiacono C, Frattale Mascioli FM, Coco S. Artificial Neural Network Models for the Prediction of Ammonia Concentrations in a Mediterranean Dairy Barn. Animals. 2025; 15(20):2967. https://doi.org/10.3390/ani15202967
Chicago/Turabian StyleSantoro, Luciano Manuel, Provvidenza Rita D’Urso, Claudia Arcidiacono, Fabio Massimo Frattale Mascioli, and Salvatore Coco. 2025. "Artificial Neural Network Models for the Prediction of Ammonia Concentrations in a Mediterranean Dairy Barn" Animals 15, no. 20: 2967. https://doi.org/10.3390/ani15202967
APA StyleSantoro, L. M., D’Urso, P. R., Arcidiacono, C., Frattale Mascioli, F. M., & Coco, S. (2025). Artificial Neural Network Models for the Prediction of Ammonia Concentrations in a Mediterranean Dairy Barn. Animals, 15(20), 2967. https://doi.org/10.3390/ani15202967