{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,9,8]],"date-time":"2026-09-08T19:13:58Z","timestamp":1788894838577,"version":"build-2803163510"},"reference-count":49,"publisher":"MDPI AG","issue":"6","license":[{"start":{"date-parts":[[2024,3,11]],"date-time":"2024-03-11T00:00:00Z","timestamp":1710115200000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"funder":[{"name":"Shanxi Province Collaborative Research Project","award":["YZGG-06"],"award-info":[{"award-number":["YZGG-06"]}]},{"name":"Shanxi Province Collaborative Research Project","award":["CYYL23-23"],"award-info":[{"award-number":["CYYL23-23"]}]},{"name":"Integration and Demonstration Promotion of Efficient Pig Farming Technologies","award":["YZGG-06"],"award-info":[{"award-number":["YZGG-06"]}]},{"name":"Integration and Demonstration Promotion of Efficient Pig Farming Technologies","award":["CYYL23-23"],"award-info":[{"award-number":["CYYL23-23"]}]}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Animals"],"abstract":"<jats:p>Temperature and humidity, along with concentrations of ammonia and hydrogen sulfide, are critical environmental factors that significantly influence the growth and health of pigs within porcine habitats. The ability to accurately predict these environmental variables in pig houses is pivotal, as it provides crucial decision-making support for the precise and targeted regulation of the internal environmental conditions. This approach ensures an optimal living environment, essential for the well-being and healthy development of the pigs. The existing methodologies for forecasting environmental factors in pig houses are currently hampered by issues of low predictive accuracy and significant fluctuations in environmental conditions. To address these challenges in this study, a hybrid model incorporating the improved dung beetle algorithm (DBO), temporal convolutional networks (TCNs), and gated recurrent units (GRUs) is proposed for the prediction and optimization of environmental factors in pig barns. The model enhances the global search capability of DBO by introducing the Osprey Eagle optimization algorithm (OOA). The hybrid model uses the optimization capability of DBO to initially fit the time-series data of environmental factors, and subsequently combines the long-term dependence capture capability of TCNs and the non-linear sequence processing capability of GRUs to accurately predict the residuals of the DBO fit. In the prediction of ammonia concentration, the OTDBO\u2013TCN\u2013GRU model shows excellent performance with mean absolute error (MAE), mean square error (MSE), and coefficient of determination (R2) of 0.0474, 0.0039, and 0.9871, respectively. Compared with the DBO\u2013TCN\u2013GRU model, OTDBO\u2013TCN\u2013GRU achieves significant reductions of 37.2% and 66.7% in MAE and MSE, respectively, while the R2 value is improved by 2.5%. Compared with the OOA model, the OTDBO\u2013TCN\u2013GRU achieved 48.7% and 74.2% reductions in the MAE and MSE metrics, respectively, while the R2 value improved by 3.6%. In addition, the improved OTDBO\u2013TCN\u2013GRU model has a prediction error of less than 0.3 mg\/m3 for environmental gases compared with other algorithms, and has less influence on sudden environmental changes, which shows the robustness and adaptability of the model for environmental prediction. Therefore, the OTDBO\u2013TCN\u2013GRU model, as proposed in this study, optimizes the predictive performance of environmental factor time series and offers substantial decision support for environmental control in pig houses.<\/jats:p>","DOI":"10.3390\/ani14060863","type":"journal-article","created":{"date-parts":[[2024,3,11]],"date-time":"2024-03-11T11:05:10Z","timestamp":1710155110000},"page":"863","update-policy":"https:\/\/doi.org\/10.3390\/mdpi_crossmark_policy","source":"Crossref","is-referenced-by-count":23,"title":["Research on Indoor Environment Prediction of Pig House Based on OTDBO\u2013TCN\u2013GRU Algorithm"],"prefix":"10.3390","volume":"14","author":[{"given":"Zhaodong","family":"Guo","sequence":"first","affiliation":[{"name":"College of Software, Shanxi Agricultural University, Jinzhong 030801, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Zhe","family":"Yin","sequence":"additional","affiliation":[{"name":"College of Software, Shanxi Agricultural University, Jinzhong 030801, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Yangcheng","family":"Lyu","sequence":"additional","affiliation":[{"name":"College of Software, Shanxi Agricultural University, Jinzhong 030801, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Yuzhi","family":"Wang","sequence":"additional","affiliation":[{"name":"College of Software, Shanxi Agricultural University, Jinzhong 030801, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Sen","family":"Chen","sequence":"additional","affiliation":[{"name":"College of Software, Shanxi Agricultural University, Jinzhong 030801, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Yaoyu","family":"Li","sequence":"additional","affiliation":[{"name":"College of Agricultural Engineering, Shanxi Agricultural University, Jinzhong 030801, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Wuping","family":"Zhang","sequence":"additional","affiliation":[{"name":"College of Software, Shanxi Agricultural University, Jinzhong 030801, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0000-0001-8464-7212","authenticated-orcid":false,"given":"Pengfei","family":"Gao","sequence":"additional","affiliation":[{"name":"College of Animal Science, Shanxi Agricultural University, Jinzhong 030801, China"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"1968","published-online":{"date-parts":[[2024,3,11]]},"reference":[{"key":"ref_1","doi-asserted-by":"crossref","first-page":"565","DOI":"10.1016\/S1352-2310(97)00167-2","article-title":"Critical loads and the relevance of ammonia to an effects-based nitrogen protocol","volume":"32","author":"Bull","year":"1998","journal-title":"Atmos. Environ."},{"key":"ref_2","doi-asserted-by":"crossref","first-page":"105150","DOI":"10.1016\/j.prevetmed.2020.105150","article-title":"Environment-, health-, performance-and welfare-related parameters in pig barns with natural and mechanical ventilation","volume":"183","author":"Chantziaras","year":"2020","journal-title":"Prev. Vet. Med."},{"key":"ref_3","doi-asserted-by":"crossref","first-page":"1085","DOI":"10.2527\/jas1980.5061085x","article-title":"Effects of aerial ammonia on growth and health of young pigs","volume":"50","author":"Drummond","year":"1980","journal-title":"J. Anim. Sci."},{"key":"ref_4","doi-asserted-by":"crossref","first-page":"245","DOI":"10.1016\/j.agee.2011.03.012","article-title":"Ammonia emissions from pig houses: Influencing factors and mitigation techniques","volume":"141","author":"Philippe","year":"2011","journal-title":"Agric. Ecosyst. Environ."},{"key":"ref_5","first-page":"353","article-title":"Thermal environment prediction and validation based on deep learning algorithm in closed pig house","volume":"51","author":"Xie","year":"2020","journal-title":"Trans. Chin. Soc. Agric. Mach."},{"key":"ref_6","doi-asserted-by":"crossref","first-page":"1385","DOI":"10.2527\/2005.8361385x","article-title":"Effects of increasing temperatures on physiological changes in pigs at different relative humidities","volume":"83","author":"Huynh","year":"2005","journal-title":"J. Anim. Sci."},{"key":"ref_7","doi-asserted-by":"crossref","first-page":"1023","DOI":"10.1111\/rda.14400","article-title":"A review on the effect of light\u2013thermal\u2013humidity environment in sow houses on sow reproduction and welfare","volume":"58","author":"Ma","year":"2023","journal-title":"Reprod. Domest. Anim."},{"key":"ref_8","doi-asserted-by":"crossref","first-page":"106238","DOI":"10.1016\/j.buildenv.2019.106238","article-title":"A thermal environmental model for indoor air temperature prediction and energy consumption in pig building","volume":"161","author":"Xie","year":"2019","journal-title":"Build. Environ."},{"key":"ref_9","first-page":"1","article-title":"Current Situation and Development Trend of Pig Automated Farming Equipment Application","volume":"53","author":"Shen","year":"2022","journal-title":"Nongye Jixie Xuebao\/Trans. Chin. Soc. Agric. Mach."},{"key":"ref_10","doi-asserted-by":"crossref","unstructured":"Arulmozhi, E., Basak, J.K., Sihalath, T., Park, J., Kim, H.T., and Moon, B.E. (2021). Machine learning-based microclimate model for indoor air temperature and relative humidity prediction in a swine building. Animals, 11.","DOI":"10.3390\/ani11010222"},{"key":"ref_11","doi-asserted-by":"crossref","unstructured":"Gody\u0144, D., Nowicki, J., and Herbut, P. (2019). Effects of environmental enrichment on pig welfare\u2014A review. Animals, 9.","DOI":"10.3390\/ani9060383"},{"key":"ref_12","doi-asserted-by":"crossref","unstructured":"Peng, S., Zhu, J., Liu, Z., Hu, B., Wang, M., and Pu, S. (2022). Prediction of Ammonia Concentration in a Pig House Based on Machine Learning Models and Environmental Parameters. Animals, 13.","DOI":"10.3390\/ani13010165"},{"key":"ref_13","doi-asserted-by":"crossref","first-page":"91","DOI":"10.1016\/j.biosystemseng.2011.10.012","article-title":"Modelling of internal environmental conditions in a full-scale commercial pig house containing animals","volume":"111","author":"Seo","year":"2012","journal-title":"Biosyst. Eng."},{"key":"ref_14","doi-asserted-by":"crossref","unstructured":"Zhang, L., Zhang, M., Yu, Q., Su, S., Wang, Y., Fang, Y., and Dong, W. (2024). Optimizing Winter Air Quality in Pig-Fattening Houses: A Plasma Deodorization Approach. Sensors, 24.","DOI":"10.3390\/s24020324"},{"key":"ref_15","doi-asserted-by":"crossref","first-page":"181","DOI":"10.4236\/jcc.2020.812017","article-title":"An industrial internet platform for massive pig farming (IIP4MPF)","volume":"8","author":"Gu","year":"2020","journal-title":"J. Comput. Commun."},{"key":"ref_16","doi-asserted-by":"crossref","first-page":"104530","DOI":"10.1016\/j.livsci.2021.104530","article-title":"An overview of the current trends in precision pig farming technologies","volume":"249","author":"Tzanidakis","year":"2021","journal-title":"Livest. Sci."},{"key":"ref_17","first-page":"18","article-title":"Advances in environmental monitoring technology and methods for piggery","volume":"57","author":"Han","year":"2021","journal-title":"Chin. J. Anim. Sci."},{"key":"ref_18","first-page":"148","article-title":"Simulation and verification of microclimate environment in closed swine piggery based on energy and mass balance","volume":"35","author":"Xie","year":"2019","journal-title":"Trans. Chin. Soc. Agric. Eng. (Trans. CSAE)"},{"key":"ref_19","doi-asserted-by":"crossref","first-page":"301","DOI":"10.1016\/j.jhazmat.2016.12.010","article-title":"A prediction model of ammonia emission from a fattening pig room based on the indoor concentration using adaptive neuro fuzzy inference system","volume":"325","author":"Xie","year":"2017","journal-title":"J. Hazard. Mater."},{"key":"ref_20","doi-asserted-by":"crossref","first-page":"124441","DOI":"10.1016\/j.jclepro.2020.124441","article-title":"Correlations, variations, and modelling of indoor environment in a mechanically-ventilated pig building","volume":"282","author":"Xie","year":"2021","journal-title":"J. Clean. Prod."},{"key":"ref_21","first-page":"9","article-title":"Research and application of precipitation prediction model based on EMD-DBO-GRU","volume":"59","author":"Wang","year":"2023","journal-title":"Gansu Water Resour. Hydropower Technol."},{"key":"ref_22","doi-asserted-by":"crossref","first-page":"121219","DOI":"10.1016\/j.eswa.2023.121219","article-title":"Dung beetle optimization algorithm based on quantum computing and multi-strategy fusion for solving engineering problems","volume":"236","author":"Zhu","year":"2024","journal-title":"Expert Syst. Appl."},{"key":"ref_23","doi-asserted-by":"crossref","first-page":"113612","DOI":"10.1016\/j.eswa.2020.113612","article-title":"A whale optimization algorithm with chaos mechanism based on quasi-opposition for global optimization problems","volume":"158","author":"Chen","year":"2020","journal-title":"Expert Syst. Appl."},{"key":"ref_24","unstructured":"Ren, T., Zhou, R., Xia, J., and Dong, Z. (2016, January 12\u201314). Three-dimensional path planning of UAV based on an improved A algorithm. Proceedings of the 2016 IEEE Chinese Guidance, Navigation and Control Conference (CGNCC), Nanjing, China."},{"key":"ref_25","doi-asserted-by":"crossref","first-page":"129604","DOI":"10.1016\/j.energy.2023.129604","article-title":"A dual-optimization wind speed forecasting model based on deep learning and improved dung beetle optimization algorithm","volume":"286","author":"Li","year":"2024","journal-title":"Energy"},{"key":"ref_26","first-page":"351","article-title":"Solar Greenhouse Environment Prediction Model Based on SSA-LSTM","volume":"54","author":"Zu","year":"2023","journal-title":"Trans. Chin. Soc. Agric. Mach."},{"key":"ref_27","first-page":"67","article-title":"Research on Greenhouse Environment Prediction and Film Rolling Decision Method Based on XGBoost Model","volume":"3","author":"Li","year":"2023","journal-title":"Water Sav. Irrig."},{"key":"ref_28","first-page":"249","article-title":"Multi-Scale Stock Prediction Based on Deep Transfer Learning","volume":"58","author":"Cheng","year":"2022","journal-title":"Comput. Eng. Appl."},{"key":"ref_29","first-page":"133","article-title":"Time series prediction method of clean coal ash content in dense medium separation based on EMD\u2014LSTM","volume":"54","author":"Cheng","year":"2022","journal-title":"Coal Eng."},{"key":"ref_30","unstructured":"Qiao, Y., Jia, X., Guan, Y., and Hao, J. (2023). Air quality prediction method and its application of Elman neural network based on DE-WOA. Control Eng. China, 1\u20138."},{"key":"ref_31","first-page":"62","article-title":"Short-term Load Forecasting Method Based on EMD-LSTM Model","volume":"41","author":"Wang","year":"2022","journal-title":"Res. Explor. Lab."},{"key":"ref_32","doi-asserted-by":"crossref","first-page":"111071","DOI":"10.1016\/j.asoc.2023.111071","article-title":"A stacked ensemble method based on TCN and convolutional bi-directional GRU with multiple time windows for remaining useful life estimation","volume":"150","author":"Guo","year":"2024","journal-title":"Appl. Soft Comput."},{"key":"ref_33","first-page":"81","article-title":"Short-term Power Load Forecasting Method Based on EMD-CNN-LSTM Hybrid Model","volume":"49","author":"Xu","year":"2022","journal-title":"J. North China Electr. Power Univ."},{"key":"ref_34","doi-asserted-by":"crossref","unstructured":"Ismaeel, A.A., Houssein, E.H., Khafaga, D.S., Abdullah Aldakheel, E., AbdElrazek, A.S., and Said, M. (2023). Performance of Osprey Optimization Algorithm for Solving Economic Load Dispatch Problem. Mathematics, 11.","DOI":"10.3390\/math11194107"},{"key":"ref_35","doi-asserted-by":"crossref","first-page":"270","DOI":"10.1177\/1094428112470848","article-title":"Best-practice recommendations for defining, identifying, and handling outliers","volume":"16","author":"Aguinis","year":"2013","journal-title":"Organ. Res. Methods"},{"key":"ref_36","doi-asserted-by":"crossref","first-page":"105524","DOI":"10.1016\/j.asoc.2019.105524","article-title":"Investigating the impact of data normalization on classification performance","volume":"97","author":"Singh","year":"2020","journal-title":"Appl. Soft Comput."},{"key":"ref_37","doi-asserted-by":"crossref","first-page":"129904","DOI":"10.1016\/j.energy.2023.129904","article-title":"A hybrid short-term wind power point-interval prediction model based on combination of improved preprocessing methods and entropy weighted GRU quantile regression network","volume":"288","author":"Liu","year":"2024","journal-title":"Energy"},{"key":"ref_38","doi-asserted-by":"crossref","first-page":"118949","DOI":"10.1016\/j.atmosenv.2022.118949","article-title":"Long-term PM2.5 source analyses in New York City from the perspective of dispersion normalized PMF","volume":"272","author":"Chen","year":"2022","journal-title":"Atmos. Environ."},{"key":"ref_39","first-page":"63","article-title":"A review of least squares fitting principles for Savitzky-Golay smoothing filters","volume":"38","author":"Cai","year":"2011","journal-title":"Digit. Commun."},{"key":"ref_40","unstructured":"Van Rossum, G., and Drake, F.L. (1995). Python Reference Manual, Centrum voor Wiskunde en Informatica Amsterdam."},{"key":"ref_41","unstructured":"Sweet, S.A., and Grace-Martin, K. (1999). Data Analysis with SPSS, Allyn & Bacon."},{"key":"ref_42","doi-asserted-by":"crossref","first-page":"7305","DOI":"10.1007\/s11227-022-04959-6","article-title":"Dung beetle optimizer: A new meta-heuristic algorithm for global optimization","volume":"79","author":"Xue","year":"2023","journal-title":"J. Supercomput."},{"key":"ref_43","doi-asserted-by":"crossref","first-page":"172","DOI":"10.54097\/ajst.v5i3.8009","article-title":"PM2.5 Concentration Prediction Method Based on Temporal Attention Mechanism and CNN-LSTM","volume":"5","author":"Zhou","year":"2023","journal-title":"Acad. J. Sci. Technol."},{"key":"ref_44","first-page":"211","article-title":"Research on environmental prediction method of solar greenhouse based on LSTM-GRU","volume":"50","author":"Qiao","year":"2022","journal-title":"Jiangsu Agric. Sci."},{"key":"ref_45","doi-asserted-by":"crossref","first-page":"1126450","DOI":"10.3389\/fmech.2022.1126450","article-title":"Osprey optimization algorithm: A new bio-inspired metaheuristic algorithm for solving engineering optimization problems","volume":"8","author":"Dehghani","year":"2023","journal-title":"Front. Mech. Eng."},{"key":"ref_46","doi-asserted-by":"crossref","first-page":"90","DOI":"10.1016\/j.jprocont.2014.12.010","article-title":"Fault diagnosis of downhole drilling incidents using adaptive observers and statistical change detection","volume":"30","author":"Willersrud","year":"2015","journal-title":"J. Process Control"},{"key":"ref_47","first-page":"1410","article-title":"Arithmetic optimization algorithm based on adaptive t-distribution and improved dynamic boundary strategy","volume":"39","author":"Zheng","year":"2022","journal-title":"Appl. Res. Comput."},{"key":"ref_48","first-page":"353","article-title":"Prediction of Ammonia Concentra-tion in Fattening Piggery Based on EMD-LSTM","volume":"50","author":"Yang","year":"2019","journal-title":"Trans. CSAM"},{"key":"ref_49","doi-asserted-by":"crossref","first-page":"042055","DOI":"10.1088\/1742-6596\/1624\/4\/042055","article-title":"Piggery Ammonia Concentration Prediction Method Based on CNN-GRU","volume":"1624","author":"Wang","year":"2020","journal-title":"J. Phys. Conf. Ser."}],"container-title":["Animals"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.mdpi.com\/2076-2615\/14\/6\/863\/pdf","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,10,10]],"date-time":"2025-10-10T14:12:06Z","timestamp":1760105526000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.mdpi.com\/2076-2615\/14\/6\/863"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2024,3,11]]},"references-count":49,"journal-issue":{"issue":"6","published-online":{"date-parts":[[2024,3]]}},"alternative-id":["ani14060863"],"URL":"https:\/\/doi.org\/10.3390\/ani14060863","relation":{},"ISSN":["2076-2615"],"issn-type":[{"value":"2076-2615","type":"electronic"}],"subject":[],"published":{"date-parts":[[2024,3,11]]}}}